This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48744] New: [C++0x][SFINAE] Hard errors with list-initialization and void initializers
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 23 Apr 2011 21:39:10 +0000
- Subject: [Bug c++/48744] New: [C++0x][SFINAE] Hard errors with list-initialization and void initializers
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48744
Summary: [C++0x][SFINAE] Hard errors with list-initialization
and void initializers
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
gcc 4.7.0 20110422 (experimental) in C++0x mode rejects the following code
at the line marked with #:
//-------------------------
template<class T>
struct add_rval_ref {
typedef T&& type;
};
template<>
struct add_rval_ref<void> {
typedef void type;
};
template<class T>
typename add_rval_ref<T>::type create();
template<class T, class Arg>
decltype(T{create<Arg>()}, char()) f(int);
template<class, class>
char (&f(...))[2];
static_assert(sizeof(f<int, void>(0)) != 1, "Error"); // #
//-------------------------
"error: void value not ignored as it ought to be"
The code should be accepted.