blob: afabf88bd5a7948e24b47571c570500d0832b699 [file] [log] [blame]
Richard Smith9fcce652012-03-07 08:35:16 +00001// 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)));
5auto operator"" _foo(const char *p, decltype(sizeof(int))) -> decltype(nullptr);
6
Richard Smith91688302012-03-08 09:02:38 +00007// CHECK: decltype(""_foo) operator "" _bar(unsigned long long);
8decltype(""_foo) operator"" _bar(unsigned long long);
9
10// CHECK: decltype(42_bar) operator "" _baz(long double);
11decltype(42_bar) operator"" _baz(long double);
12
Richard Smithef9f2982012-03-09 10:10:02 +000013// CHECK: decltype(4.5_baz) operator "" _baz(char);
14decltype(4.5_baz) operator"" _baz(char);
15
16// CHECK: const char *operator "" _quux(const char *);
17const char *operator"" _quux(const char *);
18
19// CHECK: template <char...> const char *operator "" _fritz();
20template<char...> const char *operator"" _fritz();
21
Richard Smith9fcce652012-03-07 08:35:16 +000022// CHECK: const char *p1 = "bar1"_foo;
23const char *p1 = "bar1"_foo;
24// CHECK: const char *p2 = "bar2"_foo;
25const char *p2 = R"x(bar2)x"_foo;
26// CHECK: const char *p3 = u8"bar3"_foo;
27const char *p3 = u8"bar3"_foo;
Richard Smith91688302012-03-08 09:02:38 +000028// CHECK: const char *p4 = 297_bar;
29const char *p4 = 0x129_bar;
30// CHECK: const char *p5 = 1.0E+12_baz;
31const char *p5 = 1e12_baz;
Richard Smithef9f2982012-03-09 10:10:02 +000032// CHECK: const char *p6 = 'x'_baz;
33const char *p6 = 'x'_baz;
34// CHECK: const char *p7 = 123_quux;
35const char *p7 = 123_quux;
36// CHECK: const char *p8 = 4.9_quux;
37const char *p8 = 4.9_quux;
38// CHECK: const char *p9 = 0x42e3F_fritz;
39const char *p9 = 0x42e3F_fritz;
40// CHECK: const char *p10 = 3.300e+15_fritz;
41const char *p10 = 3.300e+15_fritz;