allocator.ctor.pass.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. // <memory>
  10. // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
  11. //
  12. // template <class T>
  13. // class allocator
  14. // {
  15. // public: // All of these are constexpr after C++17
  16. // constexpr allocator() noexcept;
  17. // constexpr allocator(const allocator&) noexcept;
  18. // template<class U> constexpr allocator(const allocator<U>&) noexcept;
  19. // ...
  20. // };
  21. #include <memory>
  22. #include <cstddef>
  23. #include "test_macros.h"
  24. int main()
  25. {
  26. {
  27. typedef std::allocator<char> AC;
  28. typedef std::allocator<long> AL;
  29. constexpr AC a1;
  30. constexpr AC a2{a1};
  31. constexpr AL a3{a2};
  32. (void) a3;
  33. }
  34. {
  35. typedef std::allocator<const char> AC;
  36. typedef std::allocator<const long> AL;
  37. constexpr AC a1;
  38. constexpr AC a2{a1};
  39. constexpr AL a3{a2};
  40. (void) a3;
  41. }
  42. }