]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: fix cpp0x/constexpr-ex1.C in C++23
authorMarek Polacek <polacek@redhat.com>
Wed, 13 Dec 2023 23:25:47 +0000 (18:25 -0500)
committerMarek Polacek <polacek@redhat.com>
Wed, 13 Dec 2023 23:55:11 +0000 (18:55 -0500)
Since r14-6505 I see:

FAIL: g++.dg/cpp0x/constexpr-ex1.C  -std=c++23  at line 91 (test for errors, line 89)
FAIL: g++.dg/cpp0x/constexpr-ex1.C  -std=c++23 (test for excess errors)
FAIL: g++.dg/cpp0x/constexpr-ex1.C  -std=c++26  at line 91 (test for errors, line 89)
FAIL: g++.dg/cpp0x/constexpr-ex1.C  -std=c++26 (test for excess errors)

and it wasn't fixed by r14-6511.  So I'm fixing it with the below.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-ex1.C: Adjust expected diagnostic line.

gcc/testsuite/g++.dg/cpp0x/constexpr-ex1.C

index 383d38a42d452a19e088f5459a7f34b2cc1ea9bc..b26eb5d0c905b82f3968829f53760a613124a443 100644 (file)
@@ -88,7 +88,7 @@ struct resource {
 };
 constexpr resource f(resource d)
 { return d; }                  // { dg-error "non-.constexpr." "" { target { { { ! implicit_constexpr } && c++20_down } || c++11_only } } }
-// { dg-error "non-.constexpr." "" { target { c++23 && { ! implicit_constexpr } } } .-2 }
+// { dg-error "non-.constexpr." "" { target { c++23 && { ! implicit_constexpr } } } .-1 }
 constexpr resource d = f(9);   // { dg-message ".constexpr." "" { target { { ! implicit_constexpr } || c++11_only } } }
 
 // 4.4 floating-point constant expressions