diff options
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}} +} |