| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
// { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } } |
| 3 |
|
| 4 |
#include <cassert> |
| 5 |
#include <experimental/type_traits> |
| 6 |
|
| 7 |
auto c = 'c'; |
| 8 |
auto u8c = u8'c'; |
| 9 |
|
| 10 |
#if __cpp_char8_t |
| 11 |
static_assert(!std::experimental::is_same_v<decltype(u8c), decltype(c)>, ""); |
| 12 |
#else |
| 13 |
static_assert(std::experimental::is_same_v<decltype(u8c), decltype(c)>, ""); |
| 14 |
#endif |
| 15 |
|
| 16 |
auto u8s = u8"c"; |
| 17 |
auto x = u8s[0]; |
| 18 |
|
| 19 |
static_assert(std::experimental::is_same_v<decltype(u8c), decltype(x)>, ""); |