summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-04-13 21:28:54 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-04-13 21:28:54 +0000
commit337cd3a536b73302a3ad845a9dfcca1b36d92be7 (patch)
tree140019c3e577b9dbbc8767d6defe2e973d787127 /clang/test
parentc0a4ea0c029d4788b4cef642747f0cb8fd36b9da (diff)
downloadbcm5719-llvm-337cd3a536b73302a3ad845a9dfcca1b36d92be7.tar.gz
bcm5719-llvm-337cd3a536b73302a3ad845a9dfcca1b36d92be7.zip
PR3461: reject initializer for incomplete type. Based on patch by Tim
Northover. llvm-svn: 68991
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/incomplete-decl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Sema/incomplete-decl.c b/clang/test/Sema/incomplete-decl.c
index 8468cf47ab6..c4183ca72fa 100644
--- a/clang/test/Sema/incomplete-decl.c
+++ b/clang/test/Sema/incomplete-decl.c
@@ -23,3 +23,8 @@ void func() {
int h[];
int (*i)[] = &h+1; // expected-error {{arithmetic on pointer to incomplete type 'int (*)[]'}}
+struct bar j = {1}; // expected-error {{variable has incomplete type 'struct bar'}} \
+ expected-note {{forward declaration of 'struct bar'}}
+struct bar k;
+struct bar { int a; };
+
OpenPOWER on IntegriCloud