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

           Summary: QoI: poor diagnostic for silly code
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


This code is silly, but GCC actually beats Clang's diagnostics by a fair margin
here:

% cat x3.cc
template <typename T, int N> struct X {};
struct S : public X<S, 1>, public X<S, 2> {
  X x;
};


% ./bin/clang -fsyntax-only x3.cc
x3.cc:3:3: error: member 'X' found in multiple base classes of different types
  X x;
  ^
x3.cc:1:37: note: member found by ambiguous name lookup
template <typename T, int N> struct X {};
                                    ^
x3.cc:1:37: note: member found by ambiguous name lookup
1 error generated.


% gcc -fsyntax-only x3.cc
x3.cc:3:3: error: reference to 'X' is ambiguous
x3.cc:1:39: error: candidates are: struct X<S, 2> X<S, 2>::X
x3.cc:1:39: error:                 struct X<S, 1> X<S, 1>::X
x3.cc:3:3: error: 'X' does not name a type

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

Reply via email to