[LLVMbugs] [Bug 12132] New: the candidate template was ignored because of incorrectly failed template argument deduction

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Feb 29 04:58:11 PST 2012


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

             Bug #: 12132
           Summary: the candidate template was ignored because of
                    incorrectly failed template argument deduction
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: kretz at kde.org
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8118
  --> http://llvm.org/bugs/attachment.cgi?id=8118
testcase

It seems that clang fails to get template argument deduction right if the
template arguments are partially defined and a function parameter depends on
both template arguments:

% /opt/clang-3.0/bin/clang++ main.cpp
main.cpp:13:5: error: no matching function for call to 'fun'
    fun<int>(&A::x);          // fails
    ^~~~~~~~
main.cpp:1:39: note: candidate template ignored: failed template argument
deduction
template<typename T, typename S> void fun(const T S::* member) {}
                                      ^
main.cpp:14:5: error: no matching function for call to 'foo'
    Ctor<int>::foo(&A::x);    // fails
    ^~~~~~~~~~~~~~
main.cpp:4:38: note: candidate template ignored: failed template argument
deduction
    template<typename S> static void foo(const T S::* member) {}
                                     ^
2 errors generated.

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