Skip to content
  • Chris Lattner's avatar
    Diagnose invalid uses of tagged types with a missing tag. For example, in: · ffaa0e69
    Chris Lattner authored
    struct xyz { int y; };
    enum abc { ZZZ };
    
    static xyz b;
    abc c;
    
    we used to produce:
    
    t2.c:4:8: error: unknown type name 'xyz'
    static xyz b;
           ^
    t2.c:5:1: error: unknown type name 'abc'
    abc c;
    ^
    
    we now produce:
    
    t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag
    static xyz b;
           ^
           struct
    t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag
    abc c;
    ^
    enum
    
    GCC produces the normal:
    t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’
    t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’
    
    rdar://6783347
    
    llvm-svn: 68914
    ffaa0e69
Loading