[LLVMbugs] [Bug 9944] New: Doesn't SFINAE away an invalid substitution into toplevel parameter type "T[N]"
    bugzilla-daemon at llvm.org 
    bugzilla-daemon at llvm.org
       
    Wed May 18 12:46:23 PDT 2011
    
    
  
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: unassignedclangbugs at nondot.org
        ReportedBy: schaub.johannes at googlemail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
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.
    
    
More information about the llvm-bugs
mailing list