]> granicus.if.org Git - clang/commitdiff
Add another test for PR36157.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 24 Feb 2018 00:00:58 +0000 (00:00 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Sat, 24 Feb 2018 00:00:58 +0000 (00:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@325998 91177308-0d34-0410-b5e6-96231b3b80d8

test/Sema/vla.c

index b9576bf8cfd61f8b2eececd013ac9653864a131f..c962749d067aa531b809eda26068f0c7d4313df6 100644 (file)
@@ -68,3 +68,11 @@ void pr23151(int (*p1)[*]) // expected-error {{variable length array must be bou
 int TransformBug(int a) {
  return sizeof(*(int(*)[({ goto v; v: a;})]) 0); // expected-warning {{use of GNU statement expression extension}}
 }
+
+// PR36157
+struct {
+  int a[ // expected-error {{variable length array in struct}}
+    implicitly_declared() // expected-warning {{implicit declaration}}
+  ];
+};
+int (*use_implicitly_declared)() = implicitly_declared; // ok, was implicitly declared at file scope