[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / SemaCXX / imaginary-constants.cpp
blobbbff92755a1fd5c8d31936c8b6376c691b0cb856
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
5 // expected-no-diagnostics
7 #ifndef HEADER
8 #define HEADER
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;
17 #if CXX14
19 #pragma clang system_header
21 namespace std {
22 template<typename T> struct complex {};
23 complex<float> operator""if(unsigned long long);
24 complex<float> operator""if(long double);
26 complex<double> operator"" i(unsigned long long);
27 complex<double> operator"" i(long double);
29 complex<long double> operator"" il(unsigned long long);
30 complex<long double> operator"" il(long double);
33 using namespace std;
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;
42 #endif
44 #endif