diff options
author | David Majnemer <david.majnemer@gmail.com> | 2014-08-11 07:29:54 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2014-08-11 07:29:54 +0000 |
commit | 8f0ed914902f2d108ca2bd0b64b32c876bf24e5c (patch) | |
tree | ddd509dc55c077e6d546b74efd9aa59b59d38fa1 /clang/test/Sema/anonymous-struct-union.c | |
parent | 69f3528c6abc83efd48977ba9c67150b93f15580 (diff) | |
download | bcm5719-llvm-8f0ed914902f2d108ca2bd0b64b32c876bf24e5c.tar.gz bcm5719-llvm-8f0ed914902f2d108ca2bd0b64b32c876bf24e5c.zip |
Sema: Handle declspecs without declarators in records properly in C mode
We had two bugs:
- We wouldn't properly warn when a struct/union/enum was mentioned
inside of a record definition if no declarator was provided. We
should have mentioned that this declaration declares nothing.
- We didn't properly support Microsoft's extension where certain
declspecs without declarators would act as anonymous structs/unions.
* We completely ignored the case where such a declspec could be a
union.
* We didn't properly handle the case where a record was defined inside
another record:
struct X {
int a;
struct Y {
int b;
};
};
llvm-svn: 215347
Diffstat (limited to 'clang/test/Sema/anonymous-struct-union.c')
-rw-r--r-- | clang/test/Sema/anonymous-struct-union.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/anonymous-struct-union.c b/clang/test/Sema/anonymous-struct-union.c index 35d31754162..26dbeb87f5f 100644 --- a/clang/test/Sema/anonymous-struct-union.c +++ b/clang/test/Sema/anonymous-struct-union.c @@ -37,7 +37,7 @@ void test_unqual_references(struct X x, const struct X xc) { struct Redecl { int x; // expected-note{{previous declaration is here}} - struct y { }; + struct y { }; // expected-warning{{declaration does not declare anything}} union { int x; // expected-error{{member of anonymous union redeclares 'x'}} |