Discussion of P2865R5 mentioned that we only enabled this warning with
-Wall; we should handle it like other deprecations.
gcc/c-family/ChangeLog:
* c-opts.cc (c_common_post_options): Enable -Warray-compare
in C++20.
gcc/testsuite/ChangeLog:
* g++.dg/tree-ssa/pr15791-1.C: Add -Wno-array-compare.
warn_deprecated_literal_operator,
deprecated_in (cxx23));
+ /* -Warray-compare is enabled by default in C++20. */
+ SET_OPTION_IF_UNSET (&global_options, &global_options_set,
+ warn_array_compare,
+ warn_array_compare || deprecated_in (cxx20));
+
/* -Wtemplate-id-cdtor is enabled by default in C++20. */
SET_OPTION_IF_UNSET (&global_options, &global_options_set,
warn_template_id_cdtor,
/* { dg-do link } */
+/* { dg-additional-options -Wno-array-compare } */
void link_error ();