Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/g++.dg/ext/char8_t-udl-1.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
131:84e7813d76e9 | 145:1830386684a0 |
---|---|
1 // Test overloading for UTF-8 user defined literals when -fchar8_t is not in effect. | |
2 // { dg-do compile } | |
3 // { dg-options "-std=c++17 -fno-char8_t" } | |
4 | |
5 template<typename T1, typename T2> | |
6 struct is_same | |
7 { static const bool value = false; }; | |
8 | |
9 template<typename T> | |
10 struct is_same<T, T> | |
11 { static const bool value = true; }; | |
12 | |
13 int operator "" _udcl(char); | |
14 static_assert(is_same<decltype('x'_udcl), int>::value, "Error"); | |
15 static_assert(is_same<decltype(u8'x'_udcl), int>::value, "Error"); | |
16 | |
17 int operator "" _udsl(const char*, __SIZE_TYPE__); | |
18 static_assert(is_same<decltype("x"_udsl), int>::value, "Error"); | |
19 static_assert(is_same<decltype(u8"x"_udsl), int>::value, "Error"); |