http://llvm.org/bugs/show_bug.cgi?id=9944

           Summary: Doesn't SFINAE away an invalid substitution into
                    toplevel parameter type "T[N]"
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [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.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to