xref: /llvm-project/libcxx/test/std/utilities/allocator.adaptor/base-is-uglified.compile.pass.cpp (revision 1f8b7e3c0b0743dbc899278f016b710f18240b9b)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03
10 
11 // <memory>
12 
13 // This test ensures that we don't use a non-uglified name 'base' in the
14 // implementation of scoped_allocator_adaptor.
15 //
16 // See https://github.com/llvm/llvm-project/issues/78754.
17 
18 #include <memory>
19 #include <scoped_allocator>
20 
21 using ScopedAlloc = std::scoped_allocator_adaptor<std::allocator<int>, std::allocator<int>>;
22 struct MyBase {
23   using base = MyBase;
24 };
25 struct MyDerived : ScopedAlloc, MyBase {};
26 
27 using T = MyDerived::base; // Should be well-formed
28