2 // { dg-do compile { target c++11 } }
4 void operator""_x(const char *, decltype(sizeof(0)));
6 #include ""_x // { dg-error "'#include' expects" }
7 #line ""_x // { dg-error "not a positive integer" }
8 #if __has_include(""_x) // { dg-error "requires a header-name" }
11 #pragma message "hi"_x // { dg-warning "string literal with user-defined suffix is invalid in this context" }
13 extern "C"_x { void g(); } // { dg-error "before user-defined string literal" }
14 static_assert(true, "foo"_x); // { dg-error "'static_assert' with non-string message only available with" "" { target c++23_down } }
15 // { dg-error "constexpr string must be a string literal or object with 'size' and 'data' members" "" { target *-*-* } .-1 }
16 // { dg-error "invalid use of 'void'" "" { target *-*-* } .-2 }
18 [[deprecated("oof"_x)]] // { dg-error "string literal with user-defined suffix is invalid in this context" "" { target c++26 } }
20 lol () // { dg-error "not a string" }
22 asm (""_x); // { dg-error "string literal with user-defined suffix is invalid in this context" }