diff options
author | Jason Merrill <jason@redhat.com> | 2025-05-02 09:33:39 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-05-02 09:36:58 -0400 |
commit | b7e77644d1b27810c5db1944644b6c5eca74cf93 (patch) | |
tree | 251cee8a249e5d9e68d0c596c769d827627ce8d5 /gcc | |
parent | e6e3b0772ed40cc65a544bbe744ece62d8b9713e (diff) | |
download | gcc-b7e77644d1b27810c5db1944644b6c5eca74cf93.zip gcc-b7e77644d1b27810c5db1944644b6c5eca74cf93.tar.gz gcc-b7e77644d1b27810c5db1944644b6c5eca74cf93.tar.bz2 |
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1y/constexpr-89285.C | 2 | ||||
-rw-r--r-- | 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 efbf9bd..d1aaecc 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 1b73e2d..834dc63 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() { |