Fortran: default-initialization of derived-type function results [PR98454]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / utf8.C
blobed413f30976c124afbcfaa8ae0fb2d87da1d508d
1 // { dg-do compile { target c++17 } }
3 #include <cassert>
4 #include <experimental/type_traits>
6 auto c = 'c';
7 auto u8c = u8'c';
9 #if __cpp_char8_t
10 static_assert(!std::experimental::is_same_v<decltype(u8c), decltype(c)>, "");
11 #else
12 static_assert(std::experimental::is_same_v<decltype(u8c), decltype(c)>, "");
13 #endif
15 auto u8s = u8"c";
16 auto x = u8s[0];
18 static_assert(std::experimental::is_same_v<decltype(u8c), decltype(x)>, "");