[LLVMbugs] [Bug 8462] New: Argument deduction failure in function templates

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 25 13:33:02 PDT 2010


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

           Summary: Argument deduction failure in function templates
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: andreas.pokorny at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5661)
 --> (http://llvm.org/bugs/attachment.cgi?id=5661)
Test case

There is a problem with deducing template parameters of function templates when
multiple inheritance is involved. 

The attached source code procduces the follow error messages

reduction.cpp:32:16: error: no matching function for call to 'F'
        T *n = ::F<tag>(*t);
               ^~~~~~~~
reduction.cpp:42:10: note: in instantiation of member function 'context<struct
D, struct T1>::doit' requested here
    con1.doit(&d);
         ^
reduction.cpp:21:4: note: candidate template ignored: failed template argument
deduction
T* F(sugar<T, Tag> &b) { return static_cast<T*>(b.n); }
   ^
reduction.cpp:23:4: note: candidate template ignored: failed template argument
deduction
T* F(B<T, Tag> &b) { return b.n; }
   ^
reduction.cpp:25:4: note: candidate template ignored: failed template argument
deduction
T* F(BT<T, Tag> &b) { return b.n; }
   ^
reduction.cpp:32:16: error: no matching function for call to 'F'
        T *n = ::F<tag>(*t);
               ^~~~~~~~
reduction.cpp:44:10: note: in instantiation of member function 'context<struct
D, struct T2>::doit' requested here
    con2.doit(&d);
         ^
reduction.cpp:21:4: note: candidate template ignored: failed template argument
deduction
T* F(sugar<T, Tag> &b) { return static_cast<T*>(b.n); }
   ^
reduction.cpp:23:4: note: candidate template ignored: failed template argument
deduction
T* F(B<T, Tag> &b) { return b.n; }
   ^
reduction.cpp:25:4: note: candidate template ignored: failed template argument
deduction
T* F(BT<T, Tag> &b) { return b.n; }
   ^
10 diagnostics 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