aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-expr-4.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-22 17:13:37 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-22 17:13:37 +0000
commit5b5ad8453c8e79f642c3ddfeeadf162ae67309c0 (patch)
tree3c6a7ffc083fd4f0065a60957c1e25a17f1d5e81 /test/SemaTemplate/instantiate-expr-4.cpp
parenta188ff2d8a18140541fcd5884deda4552dac71a7 (diff)
When transforming a C++ "new" expression that was not explicitly given
a size, check whether the transformed type is itself an array type. If so, take the major array bound as the size to allocate. Fixes PR5833. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91907 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-expr-4.cpp')
-rw-r--r--test/SemaTemplate/instantiate-expr-4.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-expr-4.cpp b/test/SemaTemplate/instantiate-expr-4.cpp
index e0042de50e..99bbbf7a16 100644
--- a/test/SemaTemplate/instantiate-expr-4.cpp
+++ b/test/SemaTemplate/instantiate-expr-4.cpp
@@ -84,6 +84,20 @@ template struct New2<X, int, float>;
template struct New2<X, int, int*>; // expected-note{{instantiation}}
// FIXME: template struct New2<int, int, float>;
+// PR5833
+struct New3 {
+ New3();
+
+ void *operator new[](__SIZE_TYPE__) __attribute__((unavailable)); // expected-note{{explicitly made unavailable}}
+};
+
+template<class C>
+void* object_creator() {
+ return new C(); // expected-error{{call to unavailable function 'operator new[]'}}
+}
+
+template void *object_creator<New3[4]>(); // expected-note{{instantiation}}
+
template<typename T>
struct Delete0 {
void f(T t) {