[LLVMbugs] [Bug 7505] New: Getting lvalue to function template specialization always takes target type into account

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Jun 26 05:39:57 PDT 2010


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

           Summary: Getting lvalue to function template specialization
                    always takes target type into account
           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 web.de
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Clang doesn't compile this snippet

template<typename T> void f(T) { } 

int main() {
  bool b = &f<int>;
}

It seems that it deduces "void(T)" against "bool" and fails deduction, but the
Standard ('0x draft, which i believe clang aims to implement retroactively in
this case) requires it to ignore the target type when an initial deduction
against it failed and the arguments supplied in the template-id are sufficient
to identify a single function template specialization (see
14.9.1[temp.arg.explicit]/3, 13.4[over.over]/2 and DR #115).

-- 
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