Richard Smith 3a8244df6f Implement P0482R2, support for char8_t type.
This is not yet part of any C++ working draft, and so is controlled by the flag
-fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a
flag with the same name.)

This implementation is experimental, and will be removed or revised
substantially to match the proposal as it makes its way through the C++
committee.

llvm-svn: 331244
2018-05-01 05:02:45 +00:00

18 lines
429 B
C++

// RUN: %clang_cc1 -std=c++2a -verify %s
// RUN: %clang_cc1 -std=c++2a -verify %s -fchar8_t
#if defined(__cpp_char8_t) && __is_identifier(char8_t)
#error char8_t is an identifier under -fchar8_t
#endif
#if !defined(__cpp_char8_t) && !__is_identifier(char8_t)
#error char8_t is a keyword under -fno-char8_t
#endif
char8_t c8t;
#ifndef __cpp_char8_t
// expected-error@-2 {{unknown type}}
#else
// expected-no-diagnostics
#endif