• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s
2 
3 // FIXME: Print the trailing-return-type properly.
4 // CHECK: decltype(nullptr) operator "" _foo(const char *p, decltype(sizeof(int)));
5 auto operator"" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
6 
7 // CHECK: decltype(""_foo) operator "" _bar(unsigned long long);
8 decltype(""_foo) operator"" _bar(unsigned long long);
9 
10 // CHECK: decltype(42_bar) operator "" _baz(long double);
11 decltype(42_bar) operator"" _baz(long double);
12 
13 // CHECK: decltype(4.5_baz) operator "" _baz(char);
14 decltype(4.5_baz) operator"" _baz(char);
15 
16 // CHECK: const char *operator "" _quux(const char *);
17 const char *operator"" _quux(const char *);
18 
19 // CHECK: template <char...> const char *operator "" _fritz();
20 template<char...> const char *operator"" _fritz();
21 
22 // CHECK: const char *p1 = "bar1"_foo;
23 const char *p1 = "bar1"_foo;
24 // CHECK: const char *p2 = "bar2"_foo;
25 const char *p2 = R"x(bar2)x"_foo;
26 // CHECK: const char *p3 = u8"bar3"_foo;
27 const char *p3 = u8"bar3"_foo;
28 // CHECK: const char *p4 = 297_bar;
29 const char *p4 = 0x129_bar;
30 // CHECK: const char *p5 = 1.0E+12_baz;
31 const char *p5 = 1e12_baz;
32 // CHECK: const char *p6 = 'x'_baz;
33 const char *p6 = 'x'_baz;
34 // CHECK: const char *p7 = 123_quux;
35 const char *p7 = 123_quux;
36 // CHECK: const char *p8 = 4.9_quux;
37 const char *p8 = 4.9_quux;
38 // CHECK: const char *p9 = 0x42e3F_fritz;
39 const char *p9 = 0x42e3F_fritz;
40 // CHECK: const char *p10 = 3.300e+15_fritz;
41 const char *p10 = 3.300e+15_fritz;
42