// PR c++/78489 // { dg-do compile { target c++11 } } template struct enable_if { typedef T type; }; template struct enable_if {}; template struct blows_up { static_assert(Idx != Idx, ""); }; template ::type = 0, // GCC evaluates this statement class = typename blows_up::type > void Foo() {} // Check the constructor in as SFINAE context template constexpr auto test(int) -> decltype((Foo(), true)) { return true; } template constexpr bool test(long) { return false; } static_assert(!test<3>(0), ""); // Blows up