testsuite: Fix up unevalstr2.C test
The CWG2521 changes adjusted the unevalstr1.C test but didn't adjust unevalstr2.C test, which now FAILs in C++23 mode. The intent in both of those tests was to test the separate (now deprecated) syntax, so instead of removing the space between closing " and _ I've adjusted the testcase to expect those 17 extra warnings. And I've also adjusted the unevalstr1.C testcase to do the same, when it is removed from C++29 or whatever, that can be just guarded by #if. But it is actually useful to also test the UDL variant without space between closing " and _, so I've added new test coverage for that too to both tests. 2024-10-04 Jakub Jelinek <jakub@redhat.com> * g++.dg/cpp26/unevalstr1.C: Revert the 2024-10-03 changes, instead expect extra warnings. Add another set of tests without space between " and _. * g++.dg/cpp26/unevalstr2.C: Expect extra warnings for C++23. Add another set of tests without space between " and _.
This commit is contained in:
parent
f000cb8cbc
commit
c679cafb0d
2 changed files with 92 additions and 20 deletions
|
@ -83,21 +83,57 @@ extern "\o{0103}" { int f14 (); } // { dg-error "numeric escape sequence in unev
|
|||
[[nodiscard ("\x{20}")]] int h19 (); // { dg-error "numeric escape sequence in unevaluated string" }
|
||||
[[nodiscard ("\h")]] int h20 (); // { dg-error "unknown escape sequence" }
|
||||
|
||||
float operator ""_my0 (const char *);
|
||||
float operator "" ""_my1 (const char *);
|
||||
float operator L""_my2 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u""_my3 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U""_my4 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8""_my5 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator L"" ""_my6 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" ""_my7 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U"" ""_my8 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8"" ""_my9 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" L""_my10 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u""_my11 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" U""_my12 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u8""_my13 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "\0"_my14 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\x00"_my15 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\h"_my16 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "" _my0 (const char *);
|
||||
float operator "" "" _my1 (const char *);
|
||||
float operator L"" _my2 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" _my3 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U"" _my4 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8"" _my5 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator L"" "" _my6 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" "" _my7 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U"" "" _my8 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8"" "" _my9 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" L"" _my10 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u"" _my11 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" U"" _my12 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u8"" _my13 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "\0" _my14 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\x00" _my15 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\h" _my16 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
// { dg-error "unknown escape sequence" "" { target *-*-* } .-1 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target *-*-* } .-18 }
|
||||
|
||||
float operator ""_my20 (const char *);
|
||||
float operator "" ""_my21 (const char *);
|
||||
float operator L""_my22 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u""_my23 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U""_my24 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8""_my25 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator L"" ""_my26 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" ""_my27 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U"" ""_my28 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8"" ""_my29 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" L""_my30 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u""_my31 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" U""_my32 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u8""_my33 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "\0"_my34 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\x00"_my35 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\h"_my36 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
// { dg-error "unknown escape sequence" "" { target *-*-* } .-1 }
|
||||
|
|
|
@ -92,9 +92,9 @@ extern "\o{0103}" { int f14 (); } // { dg-warning "delimited escape sequences ar
|
|||
|
||||
float operator "" _my0 (const char *);
|
||||
float operator "" "" _my1 (const char *);
|
||||
float operator L"" _my2 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" _my3 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U"" _my4 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator L"" _my2 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" _my3 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U"" _my4 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8"" _my5 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator L"" "" _my6 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" "" _my7 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
|
@ -108,3 +108,39 @@ float operator "\0" _my14 (const char *); // { dg-error "expected empty string a
|
|||
float operator "\x00" _my15 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\h" _my16 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
// { dg-warning "unknown escape sequence" "" { target *-*-* } .-1 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
// { dg-warning "space between quotes and suffix is deprecated" "" { target c++23 } .-18 }
|
||||
|
||||
float operator ""_my20 (const char *);
|
||||
float operator "" ""_my21 (const char *);
|
||||
float operator L""_my22 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u""_my23 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U""_my24 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8""_my25 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator L"" ""_my26 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u"" ""_my27 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator U"" ""_my28 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator u8"" ""_my29 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" L""_my30 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u""_my31 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" U""_my32 (const char *); // { dg-error "invalid encoding prefix in literal operator" }
|
||||
float operator "" u8""_my33 (const char *); // { dg-error "invalid encoding prefix in literal operator" "" { target c++20 } }
|
||||
float operator "\0"_my34 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\x00"_my35 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
float operator "\h"_my36 (const char *); // { dg-error "expected empty string after 'operator' keyword" }
|
||||
// { dg-warning "unknown escape sequence" "" { target *-*-* } .-1 }
|
||||
|
|
Loading…
Add table
Reference in a new issue