[clang] [clang-tools-extra] [Clang] Warning as error Array Comparisons from C++26 (PR #118872)
Yanzuo Liu via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 6 17:24:59 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; "
----------------
zwuis wrote:
I would prefer "not allowed" instead of "ill-formed".
Example:
https://github.com/llvm/llvm-project/blob/02ad623bb560afa1a789b49f715c9a0e48ea9b16/clang/include/clang/Basic/DiagnosticSemaKinds.td#L665-L667
https://github.com/llvm/llvm-project/pull/118872
More information about the cfe-commits
mailing list