• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -triple=x86_64-linux-gnu
2 
3 using size_t = decltype(sizeof(int));
4 
5 int &operator "" _x1 (const char *);
6 double &operator "" _x1 (const char *, size_t);
7 double &i1 = "foo"_x1;
8 double &i2 = u8"foo"_x1;
9 double &i3 = L"foo"_x1; // expected-error {{no matching literal operator for call to 'operator""_x1' with arguments of types 'const wchar_t *' and 'unsigned long'}}
10 
11 char &operator "" _x1(const wchar_t *, size_t);
12 char &i4 = L"foo"_x1; // ok
13 double &i5 = R"(foo)"_x1; // ok
14 double &i6 = u\
15 8\
16 R\
17 "(foo)"\
18 _\
19 x\
20 1; // ok
21