[LLVMbugs] [Bug 18125] New: Repetition of template name of conversion operator in backtrace

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Dec 3 09:27:44 PST 2013


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

            Bug ID: 18125
           Summary: Repetition of template name of conversion operator in
                    backtrace
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jonathan.sauer at gmx.de
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following (incorrect) code results in a slightly confusing template
backtrace when being compiled with clang r196094:

struct Foo {
    template <typename T>
    operator T() const
    {
        T::bar();
    }
};

template <typename T>
struct Vector {};

int main()
{
    Vector<float>   v = Foo();
}


This results in:

% ~/LLVM/build/Release+Asserts/bin/clang++ -c clang.cppclang.cpp:5:12: error:
no member named 'bar' in 'Vector<float>'
        T::bar();
           ^
clang.cpp:14:25: note: in instantiation of function template specialization
'Foo::operator Vector<Vector<float> >'
      requested here
    Vector<float>   v = Foo();
                        ^
1 error generated.


For some reason, in the note/backtrace the operator is not called
'Foo::operator Vector<float>', but 'Foo::operator Vector<Vector<float> >', with
'Vector' being repeated.

-- 
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/20131203/34907605/attachment.html>


More information about the llvm-bugs mailing list