1 // RUN: %clang_cc1 -std=c++20 -verify %s -DCHAR8_T 2 // RUN: %clang_cc1 -std=c++20 -verify %s -fchar8_t -DCHAR8_T 3 // RUN: %clang_cc1 -std=c++17 -verify %s -fchar8_t -DCHAR8_T 4 5 // RUN: %clang_cc1 -std=c++17 -verify %s 6 // RUN: %clang_cc1 -std=c++17 -verify %s -fno-char8_t 7 // RUN: %clang_cc1 -std=c++20 -verify %s -fno-char8_t 8 9 #if defined(__cpp_char8_t) != defined(CHAR8_T) 10 #error wrong setting for __cpp_char_t 11 #endif 12 13 #if defined(__cpp_char8_t) && __is_identifier(char8_t) 14 #error char8_t is an identifier under -fchar8_t 15 #endif 16 17 #if !defined(__cpp_char8_t) && !__is_identifier(char8_t) 18 #error char8_t is a keyword under -fno-char8_t 19 #endif 20 21 char8_t c8t; 22 #ifndef __cpp_char8_t 23 // expected-error@-2 {{unknown type}} 24 #else 25 // expected-no-diagnostics 26 #endif 27