[LLVMbugs] [Bug 15488] New: clang incorrectly rejects member function because of template substitution failure (out-of-line definition)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Mar 11 08:00:56 PDT 2013


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

            Bug ID: 15488
           Summary: clang incorrectly rejects member function because of
                    template substitution failure (out-of-line definition)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: martin.kronbichler at it.uu.se
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10167
  --> http://llvm.org/bugs/attachment.cgi?id=10167&action=edit
Reduced testcase.

In the attached reduced testcase, clang incorrectly gives me the compile error:

bug_clang_template_deduction.cpp:46:18: error: out-of-line definition of 'bar'
does not match any
      declaration in 'derived<a>'
void derived<a>::bar(Matrix<baseclass::n*baseclass::n>& F_x)

clang fails because of the combination of the following four aspects:
- the class "derived" and its base class "base" are templates
- the template parameter of the method is the result of a multiplication
- the factors are static const int's defined in the base class
- the operator * is overloaded for an unrelated data type (a simplified form of
std::complex) that can be implicitly constructed from int.

Removing any of these four aspects makes the code compile. The code is valid
afaict.

Tested on clang 3.2 and trunk:
clang version 3.3 (trunk 176804)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130311/5d5633cb/attachment.html>


More information about the llvm-bugs mailing list