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

Reply via email to