Reject the allocation of variably-modified types in C++ 'new'
expressions. Fixes PR8209 in the narrowest way possible. I'm still
considering whether I want to implement the extension that permits the
use of VLA types in a 'new' expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115790 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/c99-variable-length-array.cpp b/test/SemaCXX/c99-variable-length-array.cpp
index 7dc912a..98df1db 100644
--- a/test/SemaCXX/c99-variable-length-array.cpp
+++ b/test/SemaCXX/c99-variable-length-array.cpp
@@ -114,3 +114,10 @@
   };
   B<A> a;
 }
+
+namespace PR8209 {
+  void f(int n) {
+    typedef int vla_type[n]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+    (void)new vla_type; // expected-error{{variably}}
+  }
+}