aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-init.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-01-28 02:00:41 +0000
committerSteve Naroff <snaroff@apple.com>2008-01-28 02:00:41 +0000
commit578edc6614236b224f63ac707acecaeb2a74d6b4 (patch)
tree817106c243ea31f51813e96978b831ac65e0d490 /test/Sema/array-init.c
parente988bc25106a41f1e3cd432a7c265b99b01b9d6a (diff)
Fix a bug with struct initializers (in Sema::CheckInitializerListTypes()).
Test case included from bz1948 (thanks Neil!). Also fixed an 80 column violation... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46430 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/array-init.c')
-rw-r--r--test/Sema/array-init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Sema/array-init.c b/test/Sema/array-init.c
index 4b94ed18cd..cfbc2b926a 100644
--- a/test/Sema/array-init.c
+++ b/test/Sema/array-init.c
@@ -190,6 +190,11 @@ struct s2 {struct s1 c;} t2 = { t1 };
struct s1 t3[] = {t1, t1, "abc", 0}; //expected-warning{{incompatible pointer to integer conversion initializing 'char *', expected 'char'}}
int t4[sizeof t3 == 6 ? 1 : -1];
}
+struct foo { int z; } w;
+int bar (void) {
+ struct foo z = { w }; //expected-error{{incompatible type initializing 'struct foo', expected 'int'}}
+ return z.z;
+}
struct s3 {void (*a)(void);} t5 = {autoStructTest};
// GCC extension; flexible array init. Once this is implemented, the warning should be removed.
// Note that clang objc implementation depends on this extension.