diff options
Diffstat (limited to 'vespalib/src/tests/placement-delete/undef.cpp')
-rw-r--r-- | vespalib/src/tests/placement-delete/undef.cpp | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/vespalib/src/tests/placement-delete/undef.cpp b/vespalib/src/tests/placement-delete/undef.cpp deleted file mode 100644 index c6ba20534f8..00000000000 --- a/vespalib/src/tests/placement-delete/undef.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. - -// This is a compile-time test which should fail because undef<T> -// cannot be instantiated - -#include <stdlib.h> - -template <class T> class undef; - -struct A { - A() { throw 1; } -}; - -template<typename T> class Pool { }; - -template<typename T> -inline void *operator new(size_t size,Pool<T>& pool) -{ - return malloc(size); -} - -template<typename T> -inline void operator delete(void *p,Pool<T>& pool) -{ - undef<T> t; - free(p); -} - -int main () -{ - Pool<int> pool; - new (pool) A(); - return 0; -} |