Richard Smith | 9fcce65 | 2012-03-07 08:35:16 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s |
| 2 | |
Richard Smith | 425663a | 2013-02-22 05:54:51 +0000 | [diff] [blame] | 3 | // CHECK: auto operator "" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr); |
Richard Smith | 9fcce65 | 2012-03-07 08:35:16 +0000 | [diff] [blame] | 4 | auto operator"" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr); |
| 5 | |
Richard Smith | 9168830 | 2012-03-08 09:02:38 +0000 | [diff] [blame] | 6 | // CHECK: decltype(""_foo) operator "" _bar(unsigned long long); |
| 7 | decltype(""_foo) operator"" _bar(unsigned long long); |
| 8 | |
| 9 | // CHECK: decltype(42_bar) operator "" _baz(long double); |
| 10 | decltype(42_bar) operator"" _baz(long double); |
| 11 | |
Richard Smith | ef9f298 | 2012-03-09 10:10:02 +0000 | [diff] [blame] | 12 | // CHECK: decltype(4.5_baz) operator "" _baz(char); |
| 13 | decltype(4.5_baz) operator"" _baz(char); |
| 14 | |
| 15 | // CHECK: const char *operator "" _quux(const char *); |
| 16 | const char *operator"" _quux(const char *); |
| 17 | |
| 18 | // CHECK: template <char...> const char *operator "" _fritz(); |
| 19 | template<char...> const char *operator"" _fritz(); |
| 20 | |
Richard Smith | 9fcce65 | 2012-03-07 08:35:16 +0000 | [diff] [blame] | 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; |
Richard Smith | 9168830 | 2012-03-08 09:02:38 +0000 | [diff] [blame] | 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; |
Richard Smith | ef9f298 | 2012-03-09 10:10:02 +0000 | [diff] [blame] | 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; |
Michael Han | 684aa73 | 2013-02-22 17:15:32 +0000 | [diff] [blame] | 41 | // CHECK: ; |
| 42 | ; |
Michael Han | 6980f17 | 2013-02-25 18:40:11 +0000 | [diff] [blame] | 43 | // CHECK-NOT: ; |
Enea Zaffanella | dc17384 | 2013-05-04 08:27:07 +0000 | [diff] [blame] | 44 | |
| 45 | |