allocator.ctor.pass.cpp (1135B)
1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <memory> 11 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 12 // 13 // template <class T> 14 // class allocator 15 // { 16 // public: // All of these are constexpr after C++17 17 // constexpr allocator() noexcept; 18 // constexpr allocator(const allocator&) noexcept; 19 // template<class U> constexpr allocator(const allocator<U>&) noexcept; 20 // ... 21 // }; 22 23 #include <memory> 24 #include <cstddef> 25 26 #include "test_macros.h" 27 28 29 int main() 30 { 31 { 32 typedef std::allocator<char> AC; 33 typedef std::allocator<long> AL; 34 35 constexpr AC a1; 36 constexpr AC a2{a1}; 37 constexpr AL a3{a2}; 38 (void) a3; 39 } 40 { 41 typedef std::allocator<const char> AC; 42 typedef std::allocator<const long> AL; 43 44 constexpr AC a1; 45 constexpr AC a2{a1}; 46 constexpr AL a3{a2}; 47 (void) a3; 48 } 49 50 }