blob: fa4ff03fad7fd917a0b6768725aadb4f634658c3 [file] [log] [blame]
Richard Smithf4198b72013-07-23 08:14:48 +00001// RUN: %clang_cc1 -std=c++1y %s -include %s -verify
2
3#ifndef INCLUDED
4#define INCLUDED
5
6#pragma clang system_header
7namespace std {
8 using size_t = decltype(sizeof(0));
9
10 struct duration {};
Richard Smith2a988622013-09-24 04:06:10 +000011 duration operator""ns(unsigned long long);
12 duration operator""us(unsigned long long);
13 duration operator""ms(unsigned long long);
14 duration operator""s(unsigned long long);
15 duration operator""min(unsigned long long);
16 duration operator""h(unsigned long long);
Richard Smithf4198b72013-07-23 08:14:48 +000017
18 struct string {};
Richard Smith2a988622013-09-24 04:06:10 +000019 string operator""s(const char*, size_t);
20
21 template<typename T> struct complex {};
22 complex<float> operator""if(long double);
23 complex<float> operator""if(unsigned long long);
24 complex<double> operator""i(long double);
25 complex<double> operator""i(unsigned long long);
26 complex<long double> operator""il(long double);
27 complex<long double> operator""il(unsigned long long);
Richard Smithf4198b72013-07-23 08:14:48 +000028}
29
30#else
31
32using namespace std;
33duration a = 1ns, b = 1us, c = 1ms, d = 1s, e = 1min, f = 1h;
34string s = "foo"s;
35char error = 'x's; // expected-error {{invalid suffix}} expected-error {{expected ';'}}
36
37int _1z = 1z; // expected-error {{invalid suffix}}
38int _1b = 1b; // expected-error {{invalid digit}}
39
Richard Smith2a988622013-09-24 04:06:10 +000040complex<float> cf1 = 1if, cf2 = 2.if, cf3 = 0x3if;
41complex<double> cd1 = 1i, cd2 = 2.i, cd3 = 0b0110101i;
42complex<long double> cld1 = 1il, cld2 = 2.il, cld3 = 0047il;
43
Richard Smithf4198b72013-07-23 08:14:48 +000044#endif