summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/new-delete.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2010-05-16 16:24:20 +0000
committerAnders Carlsson <andersca@mac.com>2010-05-16 16:24:20 +0000
commite6ae81b0a201fc1613d3c57b06c2450d0f26ccba (patch)
treeba0d0e983eb8b212a80a2c08c5e3761a22258888 /clang/test/SemaCXX/new-delete.cpp
parentcda95f47e5b17f17d16ef591a6b21d168604faf6 (diff)
downloadbcm5719-llvm-e6ae81b0a201fc1613d3c57b06c2450d0f26ccba.tar.gz
bcm5719-llvm-e6ae81b0a201fc1613d3c57b06c2450d0f26ccba.zip
Correctly diagnose array 'new' with initialization arguments when the new type is a typedef to an array type.
llvm-svn: 103909
Diffstat (limited to 'clang/test/SemaCXX/new-delete.cpp')
-rw-r--r--clang/test/SemaCXX/new-delete.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/new-delete.cpp b/clang/test/SemaCXX/new-delete.cpp
index 7b9b9d497ff..8c9719b750e 100644
--- a/clang/test/SemaCXX/new-delete.cpp
+++ b/clang/test/SemaCXX/new-delete.cpp
@@ -245,6 +245,9 @@ namespace Test1 {
void f() {
(void)new int[10](1, 2); // expected-error {{array 'new' cannot have initialization arguments}}
+
+ typedef int T[10];
+ (void)new T(1, 2); // expected-error {{array 'new' cannot have initialization arguments}}
}
template<typename T>
OpenPOWER on IntegriCloud