summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/exprs.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-02-13 22:08:30 +0000
committerChris Lattner <sabre@nondot.org>2009-02-13 22:08:30 +0000
commit303284acfcb2093c3d3a10116f6f5ed5da740fd2 (patch)
tree14353caae3a05a9a4dd36914e825cce5befce761 /clang/test/Sema/exprs.c
parent2fd18ec43a057af248c3dd72c963c1bc32def928 (diff)
downloadbcm5719-llvm-303284acfcb2093c3d3a10116f6f5ed5da740fd2.tar.gz
bcm5719-llvm-303284acfcb2093c3d3a10116f6f5ed5da740fd2.zip
If x is an invalid field decl, don't construct an expression for P->x,
just silently return an error to avoid bogus diagnostics. llvm-svn: 64491
Diffstat (limited to 'clang/test/Sema/exprs.c')
-rw-r--r--clang/test/Sema/exprs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Sema/exprs.c b/clang/test/Sema/exprs.c
index db2daf1f7ca..4ddb976eb2e 100644
--- a/clang/test/Sema/exprs.c
+++ b/clang/test/Sema/exprs.c
@@ -57,3 +57,10 @@ int test9(struct f *P) {
return R;
}
+// PR3562
+void test10(int n,...) {
+ struct S {
+ double a[n]; // expected-error {{fields must have a constant size}}
+ } s;
+ double x = s.a[0]; // should not get another error here.
+}
OpenPOWER on IntegriCloud