| //===----------------------------------------------------------------------===// |
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| // See https://llvm.org/LICENSE.txt for license information. |
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| //===----------------------------------------------------------------------===// |
| // UNSUPPORTED: c++98, c++03 |
| // template <class OuterAlloc, class... InnerAllocs> |
| // class scoped_allocator_adaptor |
| // template <class T> void destroy(T* p); |
| #include <scoped_allocator> |
| B() {constructed = true;} |
| ~B() {constructed = false;} |
| bool B::constructed = false; |
| typedef std::scoped_allocator_adaptor<A1<B>> A; |
| typedef std::scoped_allocator_adaptor<A3<B>, A1<B>> A; |
| assert(!A3<S>::constructed); |
| assert(!A3<S>::destroy_called); |
| assert(A3<S>::constructed); |
| assert(!A3<S>::destroy_called); |
| assert(A3<S>::constructed); |
| assert(A3<S>::destroy_called); |