struct q { int a, a; };
with:
t.c:3:19: error: duplicate member 'a'
struct q { int a, a; };
^
t.c:3:16: error: previous definition is here
struct q { int a, a; };
^
llvm-svn: 39303
This emits these diagnostics:
t.c:4:14: error: redefinition of 'a'
enum foo22 { a, b };
^
t.c:3:5: error: previous definition is here
int a;
^
t.c:8:17: error: redefinition of enumerator 'b'
enum foo23 { c, b };
^
t.c:4:17: error: previous definition is here
enum foo22 { a, b };
^
4 diagnostics generated.
for:
int a;
enum foo22 { a, b };
enum foo23 { c, b };
llvm-svn: 39302
t.c:10:15: warning: 'bonk' may not be nested in a struct due to flexible array member
struct bink bonk;
^
t.c:13:14: error: 'struct bink' may not be used as an array element due to flexible array member
struct bink A[123];
^
for:
struct bink {
struct bink *a;
int X[]; // ok.
};
struct foo {
int A;
struct bink bonk;
};
struct bink A[123];
llvm-svn: 39296
struct bork {
int X[];
};
struct bink {
struct bink a;
int X[]; // ok.
};
to:
t.c:3:7: error: flexible array 'X' not allowed in otherwise empty struct
int X[];
^
t.c:7:15: error: field 'a' has incomplete type
struct bink a;
^
llvm-svn: 39295
like:
struct S { struct S {} X; };
with:
t.c:2:19: error: nested redefinition of 'struct'
struct S { struct S {} X; };
^
t.c:2:1: error: previous definition is here
struct S { struct S {} X; };
^
llvm-svn: 39292
struct blah * P;
union blah *P2;
we now emit:
t.c:2:1: error: redefinition of 'blah' with tag that does not match previous use
union blah *P2;
^
t.c:1:8: error: previous use is here
struct blah * P;
^
llvm-svn: 39275
Detect and emit errors when names are redefined in the same scope, e.g.
test/Parser/argument_redef.c, which now emits:
argument_redef.c:4:22: error: redefinition of 'A'
int foo(int A) { int A; }
^
argument_redef.c:4:13: error: previous definition is here
int foo(int A) { int A; }
^
llvm-svn: 39257
the info. Also, call Actions.ParseParamDeclaratorType instead of
Actions.ParseDeclarator for parameter type lists: we don't want declaration
objects created when parsing a function declarator, we just want type info.
llvm-svn: 39230
parameters: build an array of ParamInfo structures and pass it to the
declarator for safe keeping (it owns the list).
Next step: actually populate the arg array with useful stuff.
llvm-svn: 39229
fundamentally requires having an AST around, so move all sema to the
AST library. This is the first step, later steps will be needed to
clean up libast.
llvm-svn: 39150