| 1 | // RUN: %clang_cc1 -std=c++2a -verify %s |
|---|---|
| 2 | // RUN: %clang_cc1 -std=c++2a -verify %s -fchar8_t |
| 3 | |
| 4 | #if defined(__cpp_char8_t) && __is_identifier(char8_t) |
| 5 | #error char8_t is an identifier under -fchar8_t |
| 6 | #endif |
| 7 | |
| 8 | #if !defined(__cpp_char8_t) && !__is_identifier(char8_t) |
| 9 | #error char8_t is a keyword under -fno-char8_t |
| 10 | #endif |
| 11 | |
| 12 | char8_t c8t; |
| 13 | #ifndef __cpp_char8_t |
| 14 | // expected-error@-2 {{unknown type}} |
| 15 | #else |
| 16 | // expected-no-diagnostics |
| 17 | #endif |
| 18 |