1 // RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s
3 // CHECK: auto operator""_foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
4 auto operator"" _foo(const char *p
, decltype(sizeof(int))) -> decltype(nullptr);
6 // CHECK: decltype(""_foo) operator""_bar(unsigned long long);
7 decltype(""_foo
) operator"" _bar(unsigned long long);
9 // CHECK: decltype(42_bar) operator""_baz(long double);
10 decltype(42_bar
) operator"" _baz(long double);
12 // CHECK: decltype(4.5_baz) operator""_baz(char);
13 decltype(4.5_baz
) operator"" _baz(char);
15 // CHECK: const char *operator""_quux(const char *);
16 const char *operator"" _quux(const char *);
18 // CHECK: template <char ...> const char *operator""_fritz();
19 template<char...> const char *operator"" _fritz();
21 // CHECK: const char *p1 = "bar1"_foo;
22 const char *p1
= "bar1"_foo
;
23 // CHECK: const char *p2 = "bar2"_foo;
24 const char *p2
= R
"x(bar2)x"_foo
;
25 // CHECK: const char *p3 = u8"bar3"_foo;
26 const char *p3
= u8
"bar3"_foo
;
27 // CHECK: const char *p4 = 297_bar;
28 const char *p4
= 0x129_bar
;
29 // CHECK: const char *p5 = 1.0E+12_baz;
30 const char *p5
= 1e12_baz
;
31 // CHECK: const char *p6 = 'x'_baz;
32 const char *p6
= 'x'_baz
;
33 // CHECK: const char *p7 = 123_quux;
34 const char *p7
= 123_quux
;
35 // CHECK: const char *p8 = 4.9_quux;
36 const char *p8
= 4.9_quux
;
37 // CHECK: const char *p9 = 0x42e3F_fritz;
38 const char *p9
= 0x42e3F_fritz
;
39 // CHECK: const char *p10 = 3.300e+15_fritz;
40 const char *p10
= 3.300e+15_fritz
;
42 template <class C
, C
...> const char *operator"" _suffix();
43 // CHECK: const char *PR23120 = operator""_suffix<char32_t, U'\U00010437'>();
44 const char *PR23120
= U
"𐐷"_suffix
;
51 using A::A
; // CHECK: using A::A;
59 int buffer
[n
]; // CHECK: int buffer[n];
60 [&buffer
]() {}(); // CHECK: [&buffer]