xref: /llvm-project/clang/test/CXX/lex/lex.literal/lex.ext/p14.cpp (revision 99d63ccff04b672694f8a2b3eed024b873dc163d)
1 // RUN: %clang_cc1 -std=c++2a -verify -triple x86_64-unknown-linux %s
2 
3 template <typename T, T... cs> struct check; // expected-note {{template is declared here}}
4 template <>
5 struct check<wchar_t, 34, 1090, 1077, 1089, 1090, 32, 65536> {};
operator ""_x()6 template <typename T, T... str> int operator""_x() { // #1 expected-warning {{string literal operator templates are a GNU extension}}
7   check<T, str...> chars;                            // expected-error {{implicit instantiation of undefined template 'check<wchar_t, L'"', L'\u0442', L'\u0435', L'\u0441', L'\u0442', L'_', L'\U00010000'>'}}
8   return 1;
9 }
10 void *operator""_x(const char *); // #2
11 int h = LR"("тест_��)"_x;          // expected-note {{in instantiation of function template specialization 'operator""_x<wchar_t, L'"', L'\u0442', L'\u0435', L'\u0441', L'\u0442', L'_', L'\U00010000'>' requested here}}
12