[clang] [clang-tools-extra] [Clang] Warning as error Array Comparisons from C++26 (PR #118872)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Sat Dec 7 05:15:27 PST 2024


================
@@ -10274,6 +10274,11 @@ def warn_array_comparison : Warning<
   "to compare array addresses, use unary '+' to decay operands to pointers">,
   InGroup<DiagGroup<"array-compare">>;
 
+def warn_array_comparison_cxx26 : Warning<
+  "comparison between two arrays compare their addresses not their contents; "
----------------
AmrDeveloper wrote:

I found that we have diagnostics with 'not allowed' and 'ill-formed' in the codebase, I am okay with both, and we can agree on opinion.

What do you think the best option here?

@erichkeane @cor3ntin @zwuis 

https://github.com/llvm/llvm-project/pull/118872


More information about the cfe-commits mailing list