c++: hash table ICE with variadic alias [PR105003]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / udlit-string-length.C
blobc76b0af9a2879e0ca433cbca544a1bca2018b206
1 // { dg-do compile { target c++11 } }
2 // PR c++/50941
4 typedef decltype(sizeof(0)) size_type;
6 constexpr size_type
7 operator"" _len(const char*, size_type len)
9   return len;
12 #if __cpp_char8_t
13 constexpr size_type
14 operator"" _len(const char8_t*, size_type len)
16   return len;
18 #endif
20 constexpr size_type
21 operator"" _len(const wchar_t*, size_type len)
23   return len;
26 constexpr size_type
27 operator"" _len(const char16_t*, size_type len)
29   return len;
32 constexpr size_type
33 operator"" _len(const char32_t*, size_type len)
35   return len;
38 static_assert(  ""_len == 0, "Ouch");
39 static_assert(u8""_len == 0, "Ouch");
40 static_assert( L""_len == 0, "Ouch");
41 static_assert( u""_len == 0, "Ouch");
42 static_assert( U""_len == 0, "Ouch");
44 static_assert(  "1"_len == 1, "Ouch");
45 static_assert(u8"1"_len == 1, "Ouch");
46 static_assert( L"1"_len == 1, "Ouch");
47 static_assert( u"1"_len == 1, "Ouch");
48 static_assert( U"1"_len == 1, "Ouch");
50 static_assert(  "123"_len == 3, "Ouch");
51 static_assert(u8"123"_len == 3, "Ouch");
52 static_assert( L"123"_len == 3, "Ouch");
53 static_assert( u"123"_len == 3, "Ouch");
54 static_assert( U"123"_len == 3, "Ouch");