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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 5 13:53:42 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; "
----------------
erichkeane wrote:

I wonder if this should just say 'is ill formed in C++26' or something instead of just repeating the same message?

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


More information about the cfe-commits mailing list