PR18581: Attempt to complete the type in a VLA declaration before checking
whether it's POD.
llvm-svn: 201018
diff --git a/clang/test/SemaCXX/vla.cpp b/clang/test/SemaCXX/vla.cpp
index d63b633..dae6450 100644
--- a/clang/test/SemaCXX/vla.cpp
+++ b/clang/test/SemaCXX/vla.cpp
@@ -3,3 +3,17 @@
// PR11925
int n;
int (&f())[n]; // expected-error {{function declaration cannot have variably modified type}}
+
+namespace PR18581 {
+ template<typename T> struct pod {};
+ template<typename T> struct error {
+ typename T::error e; // expected-error {{cannot be used prior to '::'}}
+ };
+ struct incomplete; // expected-note {{forward declaration}}
+
+ void f(int n) {
+ pod<int> a[n];
+ error<int> b[n]; // expected-note {{instantiation}}
+ incomplete c[n]; // expected-error {{incomplete}}
+ }
+}