[PATCH] c++: Implement C++26 P2558R2 - Add @, $, and ` to the basic character set [PR110343]

Jakub Jelinek jakub@redhat.com
Fri Jul 26 15:55:17 GMT 2024


On Fri, Jul 26, 2024 at 11:43:13AM -0400, Jason Merrill wrote:
> I'm now seeing a -std=c++26 failure on g++.dg/cpp/ucn-1.C.

I don't remember seeing it when I wrote the patch, but today I see it as
well.

The following patch seems to fix that, tested on i686-linux, ok for trunk?

2024-07-26  Jakub Jelinek  <jakub@redhat.com>

	* g++.dg/cpp/ucn-1.C (main): Expect error on c\u0024c identifier also
	for C++26.

--- gcc/testsuite/g++.dg/cpp/ucn-1.C.jj	2020-01-14 20:02:46.702611047 +0100
+++ gcc/testsuite/g++.dg/cpp/ucn-1.C	2024-07-26 17:52:33.881518790 +0200
@@ -9,7 +9,7 @@ int main()
 
   int c\u0041c;		// { dg-error "not valid in an identifier" }
 		// $ is OK on most targets; not part of basic source char set
-  int c\u0024c;	// { dg-error "not valid in an identifier" "" { target { powerpc-ibm-aix* } } }
+  int c\u0024c;	// { dg-error "not valid in an identifier" "" { target { { powerpc-ibm-aix* } || c++26 } } }
 
   U"\uD800";		  // { dg-error "not a valid universal character" }
 


	Jakub



More information about the Gcc-patches mailing list