diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2008-05-20 05:22:08 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2008-05-20 05:22:08 +0000 |
| commit | 37a186d76568fa1b5a6fc6a79f653f2067cc9ca9 (patch) | |
| tree | 9201c59107a3f2a488d0a20660528ec186c37adb /clang/test/Sema/compound-literal.c | |
| parent | 78aa98f7b80647a196a18691ca18d36072fd827e (diff) | |
| download | bcm5719-llvm-37a186d76568fa1b5a6fc6a79f653f2067cc9ca9.tar.gz bcm5719-llvm-37a186d76568fa1b5a6fc6a79f653f2067cc9ca9.zip | |
Add some more checking for compound literals.
llvm-svn: 51300
Diffstat (limited to 'clang/test/Sema/compound-literal.c')
| -rw-r--r-- | clang/test/Sema/compound-literal.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/Sema/compound-literal.c b/clang/test/Sema/compound-literal.c index 83657245f50..3a4192260bf 100644 --- a/clang/test/Sema/compound-literal.c +++ b/clang/test/Sema/compound-literal.c @@ -21,4 +21,8 @@ int main(int argc, char **argv) { fooFunc(&(struct foo){ 1, 2 }); } - +struct Incomplete; +struct Incomplete* I1 = &(struct Incomplete){1, 2, 3}; // -expected-error {{variable has incomplete type}} +void IncompleteFunc(unsigned x) { + struct Incomplete* I2 = (struct foo[x]){1, 2, 3}; // -expected-error {{variable-sized object may not be initialized}} +} |

