summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/struct-decl.c
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-06-14 06:38:10 +0000
committerChris Lattner <sabre@nondot.org>2011-06-14 06:38:10 +0000
commitf35de48c905803359f1a5454d6024806db8ca989 (patch)
treeb60912ce4a2f88448f1c27859ea3757c97e84d4f /clang/test/Sema/struct-decl.c
parentb5f19d9f6f842473627561a03ca76aa4be765ccc (diff)
downloadbcm5719-llvm-f35de48c905803359f1a5454d6024806db8ca989.tar.gz
bcm5719-llvm-f35de48c905803359f1a5454d6024806db8ca989.zip
when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded to a constant
as constant size arrays. This has slightly different semantics in some insane cases, but allows us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code llvm-svn: 132983
Diffstat (limited to 'clang/test/Sema/struct-decl.c')
-rw-r--r--clang/test/Sema/struct-decl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/struct-decl.c b/clang/test/Sema/struct-decl.c
index e1c7073e01b..6070e875f5a 100644
--- a/clang/test/Sema/struct-decl.c
+++ b/clang/test/Sema/struct-decl.c
@@ -6,7 +6,7 @@ struct bar {
struct foo {
char name[(int)&((struct bar *)0)->n];
- char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{array size is negative}}
+ char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{'name2' declared as an array with a negative size}}
};
// PR3430
OpenPOWER on IntegriCloud