aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-init.c
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-25 13:49:22 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-25 13:49:22 +0000
commit402256fc665ba179873ffcb4d630e28cbea42f27 (patch)
tree527e4052e27961feea95f3ddff73d63fb2836c5b /test/Sema/array-init.c
parent638e14413a4557c399fa2b7da2be5e4e9c1330a2 (diff)
Diagnose implicit init list for empty aggregate, like struct {}. Fixes
PR2151 (by not creating the empty implicit init list). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51556 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/array-init.c')
-rw-r--r--test/Sema/array-init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index a7f27b68f8..69255569dd 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -212,3 +212,7 @@ int u2 = {{3}}; //expected-error{{too many braces around scalar initializer}}
void varArray() {
int c[][x] = { 0 }; //expected-error{{variable-sized object may not be initialized}}
}
+
+// PR2151
+int emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct extension}} expected-error{{initializer for aggregate with no elements}}
+