https://gcc.gnu.org/g:b7e77644d1b27810c5db1944644b6c5eca74cf93
commit r16-356-gb7e77644d1b27810c5db1944644b6c5eca74cf93 Author: Jason Merrill <ja...@redhat.com> Date: Fri May 2 09:33:39 2025 -0400 c++: fix some testcases After r16-332 these tests started failing. constexpr-89285.C should have always given this error, and the new nonlit19.C needs to remove the destructor body to prevent -fimplicit-constexpr from making the testcase well-formed. gcc/testsuite/ChangeLog: * g++.dg/cpp1y/constexpr-89285.C: Always diagnose reinterpret_cast. * g++.dg/cpp23/constexpr-nonlit19.C: Remove ~A body. Diff: --- gcc/testsuite/g++.dg/cpp1y/constexpr-89285.C | 2 +- gcc/testsuite/g++.dg/cpp23/constexpr-nonlit19.C | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-89285.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-89285.C index efbf9bd15dde..d1aaecc1013b 100644 --- a/gcc/testsuite/g++.dg/cpp1y/constexpr-89285.C +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-89285.C @@ -10,7 +10,7 @@ struct B { int *c = &x->a; while (*c) c = reinterpret_cast<int *>((reinterpret_cast<char *>(c) + *c)); - *c = reinterpret_cast<char *>(this) - reinterpret_cast<char *>(c); // { dg-error "reinterpret_cast" "" { target c++20_down } } + *c = reinterpret_cast<char *>(this) - reinterpret_cast<char *>(c); // { dg-error "reinterpret_cast" } } }; struct C : A { // { dg-error "" "" { target c++14_down } } diff --git a/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit19.C b/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit19.C index 1b73e2d8209d..834dc631778e 100644 --- a/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit19.C +++ b/gcc/testsuite/g++.dg/cpp23/constexpr-nonlit19.C @@ -1,6 +1,6 @@ // { dg-do compile { target c++23 } } -struct A { ~A() { } }; +struct A { ~A(); }; struct B { constexpr B() {