aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.cc
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2024-11-27 18:00:24 -0500
committerMarek Polacek <polacek@redhat.com>2024-12-10 10:17:07 -0500
commitc628def52c87b40b6270618252488bcd731e1843 (patch)
treeba9a8b2575cfc30f26ccc830add1bf0ae591d1b9 /gcc/ira.cc
parent7a12dc695b1ae70f9fc99baf95b7188af6515ed3 (diff)
downloadgcc-c628def52c87b40b6270618252488bcd731e1843.zip
gcc-c628def52c87b40b6270618252488bcd731e1843.tar.gz
gcc-c628def52c87b40b6270618252488bcd731e1843.tar.bz2
c++: P2865R5, Remove Deprecated Array Comparisons from C++26 [PR117788]
This patch implements P2865R5 by promoting the warning to permerror in C++26 only. In C++20 we should warn even without -Wall. Jason fixed this in r15-5713 but let's add a test that doesn't use -Wall. This caused a FAIL in conditionally_borrowed.cc because we end up comparing two array types in equality_comparable_with -> __weakly_eq_cmp_with. That could be fixed in libstc++, perhaps by adding std::decay in the appropriate place. PR c++/117788 gcc/c-family/ChangeLog: * c-warn.cc (do_warn_array_compare): Emit a permerror in C++26. gcc/cp/ChangeLog: * typeck.cc (cp_build_binary_op) <case EQ_EXPR>: Don't check warn_array_compare. Check tf_warning_or_error instead of just tf_warning. Maybe return an error_mark_node in C++26. <case LE_EXPR>: Likewise. gcc/testsuite/ChangeLog: * c-c++-common/Warray-compare-1.c: Expect an error in C++26. * c-c++-common/Warray-compare-3.c: Likewise. * c-c++-common/Warray-compare-4.c: New test. * c-c++-common/Warray-compare-5.c: New test. * g++.dg/warn/Warray-compare-1.C: New test. libstdc++-v3/ChangeLog: * testsuite/std/ranges/adaptors/conditionally_borrowed.cc: Add a FIXME, adjust. Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/ira.cc')
0 files changed, 0 insertions, 0 deletions