]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: nodiscard-reason-nonstring.C FAIL in C++26
authorMarek Polacek <polacek@redhat.com>
Tue, 7 Nov 2023 15:41:41 +0000 (10:41 -0500)
committerMarek Polacek <polacek@redhat.com>
Tue, 7 Nov 2023 17:08:17 +0000 (12:08 -0500)
Since r14-5071, we emit an extra error for this test (the first one):

nodiscard-reason-nonstring.C:5:13: error: expected string-literal before numeric constant
nodiscard-reason-nonstring.C:5:36: error: 'nodiscard' attribute argument must be a string constant

so the test needs adjusting.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/nodiscard-reason-nonstring.C: Adjust dg-error.

gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C

index 091c3e56bd23c50953378acbc6428a4827d1bc1d..cbc04b406c6fb73e830c0b49ab396021ee171453 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-do compile { target c++20 } } */
 /* { dg-options "-O" } */
 
-[[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant" } */
+[[nodiscard(123)]] int check1 (void); /* { dg-error "nodiscard\[^\n\r]*must be a string constant|expected string-literal" } */
 
 void
 test (void)