http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48737
Summary: [C++0x][SFINAE] Hard errors with array
list-construction with too many elements
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
gcc 4.7.0 20110422 (experimental) in C++0x mode rejects the following code:
//-------------------------
template<class T>
T&& create();
template<class T, class... Args>
decltype(T{create<Args>()...}, char()) f(int);
template<class, class...>
char (&f(...))[2];
static_assert(sizeof(f<int[1], int, int>(0)) != 1, "Error");
//-------------------------
"error: too many initializers for ‘int [1]’"
The code should be accepted.