bolt/deps/llvm-18.1.8/clang/test/CXX/lex/lex.literal/lex.ext/p14.cpp
2025-02-14 19:21:04 +01:00

11 lines
861 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// RUN: %clang_cc1 -std=c++2a -verify -triple x86_64-unknown-linux %s
template <typename T, T... cs> struct check; // expected-note {{template is declared here}}
template <>
struct check<wchar_t, 34, 1090, 1077, 1089, 1090, 32, 65536> {};
template <typename T, T... str> int operator""_x() { // #1 expected-warning {{string literal operator templates are a GNU extension}}
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'>'}}
return 1;
}
void *operator""_x(const char *); // #2
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}}