PR c++/64959
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / udlit-char-template-sfinae.C
bloba9c577fd110f073d4c42738e3c4679215d891730
1 // { dg-do run { target c++14 } }
3 #include <cassert>
5 template<bool, typename _Tp = void>struct enable_if {};
6 template<typename _Tp> struct enable_if<true, _Tp> { typedef _Tp type; };
9 template<typename CharT, CharT... String>
10 typename enable_if<sizeof...(String) == 6, int>::type operator"" _script () {
11   return 5;
14 template<typename CharT, CharT... String>
15 typename enable_if<sizeof...(String) == 3, int>::type operator"" _script () {
16   return 3;
19 template<typename CharT, CharT... String>
20 typename enable_if<sizeof...(String) != 3 && sizeof...(String) != 6, int>::type operator"" _script () {
21   return 1;
24 int main ()
26   assert ("hello!"_script == 5);
27   assert (u8"hi!"_script == 3);
28   assert ("hey!"_script == 1);