diff mbox series

testsuite: nodiscard-reason-nonstring.C FAIL in C++26

Message ID 20231107155042.242699-1-polacek@redhat.com
State New
Headers show
Series testsuite: nodiscard-reason-nonstring.C FAIL in C++26 | expand

Commit Message

Marek Polacek Nov. 7, 2023, 3:50 p.m. UTC
Tested on x86_64-pc-linux-gnu, ok for trunk?

-- >8 --
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 75e5a467811da4237d5c43b455202c832f6e064e

Comments

Jakub Jelinek Nov. 7, 2023, 3:54 p.m. UTC | #1
On Tue, Nov 07, 2023 at 10:50:42AM -0500, Marek Polacek wrote:
> Tested on x86_64-pc-linux-gnu, ok for trunk?
> 
> -- >8 --
> 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.

LGTM.

	Jakub
diff mbox series

Patch

diff --git a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
index 091c3e56bd2..cbc04b406c6 100644
--- a/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
+++ b/gcc/testsuite/g++.dg/cpp2a/nodiscard-reason-nonstring.C
@@ -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)