On Thu, Oct 03, 2024 at 12:39:59PM -0400, Jason Merrill wrote:
>       * g++.dg/cpp26/unevalstr1.C

This patch didn't touch unevalstr2.C which now FAILs because of the new
warnings in C++23 mode (the testcase is target { c++11 && c++23_down }, so
isn't run in C++26).

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.
Though, maybe the tests should have both the deprecated syntax and the
non-deprecated one...

Tested on x86_64-linux and i686-linux, ok for trunk?

2024-10-04  Jakub Jelinek  <ja...@redhat.com>

        * g++.dg/cpp26/unevalstr1.C: Revert the 2024-10-03 changes, instead 
expect
        extra warnings.
        * g++.dg/cpp26/unevalstr2.C: Expect extra warnings for C++23.

--- gcc/testsuite/g++.dg/cpp26/unevalstr1.C.jj  2024-10-03 20:10:07.392515277 
+0200
+++ gcc/testsuite/g++.dg/cpp26/unevalstr1.C     2024-10-04 11:04:18.309736501 
+0200
@@ -83,21 +83,38 @@ extern "\o{0103}" { int f14 (); }   // { d
 [[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 }
--- gcc/testsuite/g++.dg/cpp26/unevalstr2.C.jj  2023-11-02 07:44:04.447219871 
+0100
+++ gcc/testsuite/g++.dg/cpp26/unevalstr2.C     2024-10-04 11:01:17.909245007 
+0200
@@ -108,3 +108,20 @@ float operator "\0" _my14 (const char *)
 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 }


        Jakub

Reply via email to