xref: /minix3/external/bsd/llvm/dist/clang/test/SemaCXX/cxx11-ast-print.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // CHECK: auto operator "" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
4*f4a2713aSLionel Sambuc auto operator"" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc // CHECK: decltype(""_foo) operator "" _bar(unsigned long long);
7*f4a2713aSLionel Sambuc decltype(""_foo) operator"" _bar(unsigned long long);
8*f4a2713aSLionel Sambuc 
9*f4a2713aSLionel Sambuc // CHECK: decltype(42_bar) operator "" _baz(long double);
10*f4a2713aSLionel Sambuc decltype(42_bar) operator"" _baz(long double);
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc // CHECK: decltype(4.5_baz) operator "" _baz(char);
13*f4a2713aSLionel Sambuc decltype(4.5_baz) operator"" _baz(char);
14*f4a2713aSLionel Sambuc 
15*f4a2713aSLionel Sambuc // CHECK: const char *operator "" _quux(const char *);
16*f4a2713aSLionel Sambuc const char *operator"" _quux(const char *);
17*f4a2713aSLionel Sambuc 
18*f4a2713aSLionel Sambuc // CHECK: template <char ...> const char *operator "" _fritz();
19*f4a2713aSLionel Sambuc template<char...> const char *operator"" _fritz();
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc // CHECK: const char *p1 = "bar1"_foo;
22*f4a2713aSLionel Sambuc const char *p1 = "bar1"_foo;
23*f4a2713aSLionel Sambuc // CHECK: const char *p2 = "bar2"_foo;
24*f4a2713aSLionel Sambuc const char *p2 = R"x(bar2)x"_foo;
25*f4a2713aSLionel Sambuc // CHECK: const char *p3 = u8"bar3"_foo;
26*f4a2713aSLionel Sambuc const char *p3 = u8"bar3"_foo;
27*f4a2713aSLionel Sambuc // CHECK: const char *p4 = 297_bar;
28*f4a2713aSLionel Sambuc const char *p4 = 0x129_bar;
29*f4a2713aSLionel Sambuc // CHECK: const char *p5 = 1.0E+12_baz;
30*f4a2713aSLionel Sambuc const char *p5 = 1e12_baz;
31*f4a2713aSLionel Sambuc // CHECK: const char *p6 = 'x'_baz;
32*f4a2713aSLionel Sambuc const char *p6 = 'x'_baz;
33*f4a2713aSLionel Sambuc // CHECK: const char *p7 = 123_quux;
34*f4a2713aSLionel Sambuc const char *p7 = 123_quux;
35*f4a2713aSLionel Sambuc // CHECK: const char *p8 = 4.9_quux;
36*f4a2713aSLionel Sambuc const char *p8 = 4.9_quux;
37*f4a2713aSLionel Sambuc // CHECK: const char *p9 = 0x42e3F_fritz;
38*f4a2713aSLionel Sambuc const char *p9 = 0x42e3F_fritz;
39*f4a2713aSLionel Sambuc // CHECK: const char *p10 = 3.300e+15_fritz;
40*f4a2713aSLionel Sambuc const char *p10 = 3.300e+15_fritz;
41*f4a2713aSLionel Sambuc // CHECK: ;
42*f4a2713aSLionel Sambuc ;
43*f4a2713aSLionel Sambuc // CHECK-NOT: ;
44*f4a2713aSLionel Sambuc 
45*f4a2713aSLionel Sambuc 
46