aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/c99-variable-length-array.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-06 16:00:31 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-06 16:00:31 +0000
commita0750768718bb5d05150641b5bba74847a21bc09 (patch)
treed6bdfa383075f672a38b04fd1a4add0f4e8f3214 /test/SemaCXX/c99-variable-length-array.cpp
parentd2829b76a87a70791184b3cac89900d2cda46ce4 (diff)
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
Diffstat (limited to 'test/SemaCXX/c99-variable-length-array.cpp')
-rw-r--r--test/SemaCXX/c99-variable-length-array.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaCXX/c99-variable-length-array.cpp b/test/SemaCXX/c99-variable-length-array.cpp
index 7dc912a0d5..98df1dbfe8 100644
--- a/test/SemaCXX/c99-variable-length-array.cpp
+++ b/test/SemaCXX/c99-variable-length-array.cpp
@@ -114,3 +114,10 @@ namespace rdar8021385 {
};
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}}
+ }
+}