See <https://wg21.link/P2621R2>.
Full testcase for the first 2 issues raised in the paper: ``` int \\ u\ 0\ 3\ 9\ 1 = 0; #define CONCAT(x,y) x##y int CONCAT(\,u0393)=0; ``` Testcase for the last one: ``` const char * foo=" // { dg-error "" } ``` as far as I understand from the paper, instead of the above being undefined at compiletime, the first testcase becomes valid and the last one becomes invalid. And right now GCC acts according to the paper already so there is not anything to be done. Maybe add a testcase for these if there is not already one is enough ...
(In reply to Andrew Pinski from comment #1) > Full testcase for the first 2 issues raised in the paper: Thanks, want to add these to the testsuite and close the PR?
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:fca089e8a47314a40ad93527ba9f9d0d374b3afb commit r14-2626-gfca089e8a47314a40ad93527ba9f9d0d374b3afb Author: Marek Polacek <polacek@redhat.com> Date: Tue Jul 18 13:26:39 2023 -0400 c++: Add tests for P2621, no UB in lexer [PR110340] C++26 P2621 removes UB in the lexer and either makes the construct valid or ill-formed. We're already handling this correctly so this patch only adds tests. PR c++/110340 gcc/testsuite/ChangeLog: * g++.dg/cpp/string-4.C: New test. * g++.dg/cpp/ucn-2.C: New test.
Done.