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: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to