On Tue, Feb 14, 2023 at 12:22:33PM +0100, Jakub Jelinek via Gcc-patches wrote: > 2023-02-14 Jakub Jelinek <ja...@redhat.com> > > * g++.dg/DRs/dr2691.C: New test.
Actually, this one isn't a DR, so maybe it should go into: * gcc/testsuite/c-c++-common/cpp/delimited-escape-seq-8.c: New test. instead. > --- gcc/testsuite/g++.dg/DRs/dr2691.C.jj 2023-02-14 11:48:35.841335492 > +0100 > +++ gcc/testsuite/g++.dg/DRs/dr2691.C 2023-02-14 11:57:21.538669133 +0100 > @@ -0,0 +1,15 @@ > +// DR 2691 - hexadecimal-escape-sequence is too greedy > +// { dg-do run { target c++11 } } > +// { dg-require-effective-target wchar } > +// { dg-options "-pedantic" } > + > +extern "C" void abort (); > + > +const char32_t *a = U"\x{20}ab"; // { dg-warning "delimited escape > sequences are only valid in" "" { target c++20_down } } > + > +int > +main () > +{ > + if (a[0] != U'\x20' || a[1] != U'a' || a[2] != U'b' || a[3] != U'\0') > + abort (); > +} Jakub