Home | History | Annotate | Download | only in Lexer
      1 // RUN: %clang_cc1 -x c -std=c11 -Werror %s
      2 // RUN: %clang_cc1 -x c++ -std=c++11 -Werror %s
      3 // RUN: %clang_cc1 -x c -std=c11 -Wc99-compat -verify %s
      4 // RUN: %clang_cc1 -x c++ -std=c++11 -Wc++98-compat -verify %s
      5 
      6 #ifndef __cplusplus
      7 typedef __CHAR16_TYPE__ char16_t;
      8 typedef __CHAR32_TYPE__ char32_t;
      9 #else
     10 // expected-warning@17 {{'char16_t' type specifier is incompatible with C++98}}
     11 // expected-warning@18 {{'char32_t' type specifier is incompatible with C++98}}
     12 // expected-warning@20 {{'char16_t' type specifier is incompatible with C++98}}
     13 // expected-warning@21 {{'char32_t' type specifier is incompatible with C++98}}
     14 #endif
     15 
     16 const char *a = u8"abcd"; // expected-warning {{unicode literals are incompatible with}}
     17 const char16_t *b = u"abcd"; // expected-warning {{unicode literals are incompatible with}}
     18 const char32_t *c = U"abcd"; // expected-warning {{unicode literals are incompatible with}}
     19 
     20 char16_t d = u'a'; // expected-warning {{unicode literals are incompatible with}}
     21 char32_t e = U'a'; // expected-warning {{unicode literals are incompatible with}}
     22