Debian Codegraph @

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

raw
1 // Test that UTF-8 string literals have type const char[] if -fchar8_t is not enabled.
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-fno-char8_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 char(&)[1]>::value, "Error");