Daily bump.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / udlit-sfinae.C
blobe69dd5a4255f4bccccaf699f4a5aef88566586ee
1 // { dg-do run { target c++11 } }
2 // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } }
4 #include <cassert>
6 template<bool, typename _Tp = void> struct enable_if { };
7 template<typename _Tp> struct enable_if<true, _Tp> { typedef _Tp type; };
10 template <char... c>
11 constexpr typename enable_if<sizeof...(c) == 2, int>::type operator""_t ()
13   return 2;
16 template <char... c>
17 constexpr typename enable_if<sizeof...(c) == 1, int>::type operator""_t ()
19   return 1;
22 template <char... c>
23 constexpr typename enable_if<sizeof...(c) >= 3, int>::type operator""_t ()
25   return 100;
28 int operator""_t (long double)
30   return 200;
33 int main ()
35   assert (45_t == 2);
36   assert (4_t == 1);
37   assert (100000_t == 100);
38   assert (200.0_t == 200);