[Bug c++/48534] New: [C++0x][SFINAE] Compiler break down on explicit scoped enum => bool conversion
daniel.kruegler at googlemail dot com
gcc-bugzilla@gcc.gnu.org
Sat Apr 9 21:22:00 GMT 2011
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: unassigned@gcc.gnu.org
ReportedBy: daniel.kruegler@googlemail.com
CC: jason@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.
More information about the Gcc-bugs
mailing list