http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49051
Summary: Doesn't SFINAE away an invalid substitution into
toplevel parameter type "T[N]"
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
GCC incorrectly fails to compile this code
template<typename T> void f(T[1]) = delete;
template<typename T> void f(...);
int main() { f<void>(0); }
The substitution into "T" should fail, because "T[1]" is an invalid type, and
hence the call should use the second template.
Note that I think it's unspecified in the spec what happens when we tweak
things as follows
template<typename T> void f(T[1]) = delete;
template<typename T> void f(T*);
template<typename T> void f(...);
int main() { f<void>(0); }
The first two templates are equivalent, but behave different during
substitution. The spec doesn't specify what the outcome of this is, I think.