Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1z/utf8.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
rev | line source |
---|---|
131 | 1 // { dg-do compile { target c++17 } } |
111 | 2 |
3 #include <cassert> | |
4 #include <experimental/type_traits> | |
5 | |
6 auto c = 'c'; | |
7 auto u8c = u8'c'; | |
8 | |
145 | 9 #if __cpp_char8_t |
10 static_assert(!std::experimental::is_same_v<decltype(u8c), decltype(c)>, ""); | |
11 #else | |
111 | 12 static_assert(std::experimental::is_same_v<decltype(u8c), decltype(c)>, ""); |
145 | 13 #endif |
111 | 14 |
15 auto u8s = u8"c"; | |
16 auto x = u8s[0]; | |
17 | |
18 static_assert(std::experimental::is_same_v<decltype(u8c), decltype(x)>, ""); |