summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/new-delete-cxx0x.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2012-02-16 12:59:47 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2012-02-16 12:59:47 +0000
commitb8fc4775d18ff9f7a6dbd6da095a705e91e0a12d (patch)
treea4b0010b48d0e32623976cd63d3f723adefcfdb3 /clang/test/SemaCXX/new-delete-cxx0x.cpp
parent6047f07e815c631a1cbca7531f4dfc5331592da7 (diff)
downloadbcm5719-llvm-b8fc4775d18ff9f7a6dbd6da095a705e91e0a12d.tar.gz
bcm5719-llvm-b8fc4775d18ff9f7a6dbd6da095a705e91e0a12d.zip
Proper checking of list-initializers for array new expressions.
This finishes generalized initializer support in Sema. llvm-svn: 150688
Diffstat (limited to 'clang/test/SemaCXX/new-delete-cxx0x.cpp')
-rw-r--r--clang/test/SemaCXX/new-delete-cxx0x.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/new-delete-cxx0x.cpp b/clang/test/SemaCXX/new-delete-cxx0x.cpp
index 87780ad6b8d..c404faba2a2 100644
--- a/clang/test/SemaCXX/new-delete-cxx0x.cpp
+++ b/clang/test/SemaCXX/new-delete-cxx0x.cpp
@@ -7,3 +7,20 @@ void ugly_news(int *ip) {
(void)new int[-1]; // expected-warning {{array size is negative}}
(void)new int[2000000000]; // expected-warning {{array is too large}}
}
+
+
+struct S {
+ S(int);
+ S();
+ ~S();
+};
+
+struct T { // expected-note 2 {{not viable}}
+ T(int); // expected-note {{not viable}}
+};
+
+void fn() {
+ (void) new int[2] {1, 2};
+ (void) new S[2] {1, 2};
+ (void) new T[2] {1, 2}; // expected-error {{no matching constructor}}
+}
OpenPOWER on IntegriCloud