2 // { dg-do compile { target c++11 } }
4 template <bool Pred, class T> struct enable_if { typedef T type; };
5 template <class T> struct enable_if<false, T> {};
7 template <int Idx> struct blows_up { static_assert(Idx != Idx, ""); };
10 // substitution should fail here
11 typename enable_if<Idx != Idx, int>::type = 0,
12 // GCC evaluates this statement
13 class = typename blows_up<Idx>::type
17 // Check the constructor in as SFINAE context
18 template <int I> constexpr auto test(int) -> decltype((Foo<I>(), true)) { return true; }
19 template <int> constexpr bool test(long) { return false; }
21 static_assert(!test<3>(0), ""); // Blows up