1 | // RUN: %clang_cc1 -fsyntax-only -verify %s -include %s -std=gnu++98 |
2 | // RUN: %clang_cc1 -fsyntax-only -verify %s -include %s -std=c++11 |
3 | // RUN: %clang_cc1 -fsyntax-only -verify %s -include %s -std=c++14 -DCXX14=1 |
4 | |
5 | // expected-no-diagnostics |
6 | |
7 | #ifndef HEADER |
8 | #define HEADER |
9 | |
10 | _Complex int val1 = 2i; |
11 | _Complex long val2 = 2il; |
12 | _Complex long long val3 = 2ill; |
13 | _Complex float val4 = 2.0if; |
14 | _Complex double val5 = 2.0i; |
15 | _Complex long double val6 = 2.0il; |
16 | |
17 | #if CXX14 |
18 | |
19 | #pragma clang system_header |
20 | |
21 | namespace std { |
22 | template<typename T> struct complex {}; |
23 | complex<float> operator""if(unsigned long long); |
24 | complex<float> operator""if(long double); |
25 | |
26 | complex<double> operator"" i(unsigned long long); |
27 | complex<double> operator"" i(long double); |
28 | |
29 | complex<long double> operator"" il(unsigned long long); |
30 | complex<long double> operator"" il(long double); |
31 | } |
32 | |
33 | using namespace std; |
34 | |
35 | complex<float> f1 = 2.0if; |
36 | complex<float> f2 = 2if; |
37 | complex<double> d1 = 2.0i; |
38 | complex<double> d2 = 2i; |
39 | complex<long double> l1 = 2.0il; |
40 | complex<long double> l2 = 2il; |
41 | |
42 | #endif |
43 | |
44 | #endif |
45 | |