http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48534
Summary: [C++0x][SFINAE] Compiler break down on explicit scoped enum => bool conversion Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: daniel.krueg...@googlemail.com CC: ja...@redhat.com The following code should be ill-formed, but is not: //-------------- template<class T> T&& create(); template<class T, class U, class = decltype(static_cast<T>(create<U>())) > char f(int); template<class, class> char (&f(...))[2]; enum class SEB : bool; static_assert(sizeof(f<bool, SEB>(0)) == 1, "Error"); // # something that went wrong...; // Should be ill-formed, but is not //-------------- After the line marked with # the compiler does no longer compile code, but dies a silent death. Any following lines are ignored. It seems that this is specifically isolated to a conversion from a scoped enum *with underlying type bool* to bool.