[LLVMbugs] [Bug 10777] New: QoI: poor diagnostic for silly code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 26 10:30:58 PDT 2011


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: nlewycky at google.com
        ReportedBy: chandlerc at gmail.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


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.



More information about the llvm-bugs mailing list