[LLVMbugs] [Bug 14375] New: clang doesn't diagnose some invalid code

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Nov 18 10:30:11 PST 2012


             Bug #: 14375
           Summary: clang doesn't diagnose some invalid code
           Product: clang
           Version: trunk
          Platform: PC
               URL: http://gcc.gnu.org/ml/gcc/2012-11/msg00210.html
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: lionel_debroux at yahoo.fr
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

http://gcc.gnu.org/ml/gcc/2012-11/msg00210.html and followups: GCC produces an
error with diagnostic for the invalid code snippets posted below, while clang
3.0 and ToT (tested with r168286) don't, even with e.g. -Weverything.

According to the followups, compilers are not required to produce diagnostics
for that situation, but it would nevertheless be nice for users to have them :)
The followups mention 3.3.6/1 and [dcl.typedef]/6.

===== begin snippet 1 (original testcase) =====
class A {};
class B : public A {

typedef A super;


    class X {};

class C : public B {

typedef B super;

class X : public super::X {

       typedef super::X super;
===== end snippet 1 =====

===== begin snippet 2 (reduced testcase in first followup) =====
typedef struct { typedef int type; } s1;
struct S2 { s1::type s1; };
===== end snippet 2 =====

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