Home | History | Annotate | Download | only in SemaCXX
      1 // RUN: %clang_cc1 -std=c++1y %s -include %s -verify
      2 
      3 #ifndef INCLUDED
      4 #define INCLUDED
      5 
      6 #pragma clang system_header
      7 namespace std {
      8   using size_t = decltype(sizeof(0));
      9 
     10   struct duration {};
     11   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);
     17 
     18   struct string {};
     19   string operator"" s(const char*, size_t);
     20 }
     21 
     22 #else
     23 
     24 using namespace std;
     25 duration a = 1ns, b = 1us, c = 1ms, d = 1s, e = 1min, f = 1h;
     26 string s = "foo"s;
     27 char error = 'x's; // expected-error {{invalid suffix}} expected-error {{expected ';'}}
     28 
     29 int _1z = 1z; // expected-error {{invalid suffix}}
     30 int _1b = 1b; // expected-error {{invalid digit}}
     31 
     32 #endif
     33