diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-02-07 05:00:47 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-02-07 05:00:47 +0000 |
commit | 11e70d7fe2eb11874c3619ad26dc2b525b81074f (patch) | |
tree | 556e6a6fde17d55ffa91e109cb841a4fff621bb0 /test/Sema/anonymous-struct-union.c | |
parent | 04ca25276245fbcf0a353e965de476080fa01b99 (diff) |
Fix a bug in semantic analysis involving anonymous structs and flexible arrays.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149966 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/anonymous-struct-union.c')
-rw-r--r-- | test/Sema/anonymous-struct-union.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Sema/anonymous-struct-union.c b/test/Sema/anonymous-struct-union.c index d88abc3c3b..e0822901b0 100644 --- a/test/Sema/anonymous-struct-union.c +++ b/test/Sema/anonymous-struct-union.c @@ -102,3 +102,9 @@ typedef struct { int x; } a_struct; int tmp = (a_struct) { .x = 0 }; // expected-error {{initializing 'int' with an expression of incompatible type 'a_struct'}} + +// This example comes out of the C11 standard; make sure we don't accidentally reject it. +struct s { + struct { int i; }; + int a[]; +}; |