Debian Codegraph @

gcc/testsuite/g++.dg/ext/char8_t-string-literal-2.C

raw
1 // Test that UTF-8 string literals have type const char8_t[] if -fchar8_t is enabled.
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-fchar8_t" }
4
5 template<typename T1, typename T2>
6 struct is_same
7 { static const bool value = false; };
8 template<typename T>
9 struct is_same<T, T>
10 { static const bool value = true; };
11
12 static_assert(is_same<decltype(u8""), const char8_t(&)[1]>::value, "Error");