blob: f7bfc1123a7fcfe02147bdab42d70a489c1529e0 [file] [log] [blame]
Richard Smith9fcce652012-03-07 08:35:16 +00001// RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s
2
Richard Smith425663a2013-02-22 05:54:51 +00003// CHECK: auto operator "" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
Richard Smith9fcce652012-03-07 08:35:16 +00004auto operator"" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
5
Richard Smith91688302012-03-08 09:02:38 +00006// CHECK: decltype(""_foo) operator "" _bar(unsigned long long);
7decltype(""_foo) operator"" _bar(unsigned long long);
8
9// CHECK: decltype(42_bar) operator "" _baz(long double);
10decltype(42_bar) operator"" _baz(long double);
11
Richard Smithef9f2982012-03-09 10:10:02 +000012// CHECK: decltype(4.5_baz) operator "" _baz(char);
13decltype(4.5_baz) operator"" _baz(char);
14
15// CHECK: const char *operator "" _quux(const char *);
16const char *operator"" _quux(const char *);
17
18// CHECK: template <char...> const char *operator "" _fritz();
19template<char...> const char *operator"" _fritz();
20
Richard Smith9fcce652012-03-07 08:35:16 +000021// CHECK: const char *p1 = "bar1"_foo;
22const char *p1 = "bar1"_foo;
23// CHECK: const char *p2 = "bar2"_foo;
24const char *p2 = R"x(bar2)x"_foo;
25// CHECK: const char *p3 = u8"bar3"_foo;
26const char *p3 = u8"bar3"_foo;
Richard Smith91688302012-03-08 09:02:38 +000027// CHECK: const char *p4 = 297_bar;
28const char *p4 = 0x129_bar;
29// CHECK: const char *p5 = 1.0E+12_baz;
30const char *p5 = 1e12_baz;
Richard Smithef9f2982012-03-09 10:10:02 +000031// CHECK: const char *p6 = 'x'_baz;
32const char *p6 = 'x'_baz;
33// CHECK: const char *p7 = 123_quux;
34const char *p7 = 123_quux;
35// CHECK: const char *p8 = 4.9_quux;
36const char *p8 = 4.9_quux;
37// CHECK: const char *p9 = 0x42e3F_fritz;
38const char *p9 = 0x42e3F_fritz;
39// CHECK: const char *p10 = 3.300e+15_fritz;
40const char *p10 = 3.300e+15_fritz;
Michael Han684aa732013-02-22 17:15:32 +000041// CHECK: ;
42;
Michael Han6980f172013-02-25 18:40:11 +000043// CHECK-NOT: ;
Enea Zaffanelladc173842013-05-04 08:27:07 +000044
45