]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/21_strings/basic_string/types/pmr_typedefs.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 21_strings / basic_string / types / pmr_typedefs.cc
CommitLineData
7adcbafe 1// Copyright (C) 2018-2022 Free Software Foundation, Inc.
1fc9d0b0
JW
2//
3// This file is part of the GNU ISO C++ Library. This library is free
4// software; you can redistribute it and/or modify it under the
5// terms of the GNU General Public License as published by the
6// Free Software Foundation; either version 3, or (at your option)
7// any later version.
8
9// This library is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13
14// You should have received a copy of the GNU General Public License along
15// with this library; see the file COPYING3. If not see
16// <http://www.gnu.org/licenses/>.
17
1fc9d0b0 18// { dg-do compile { target c++17 } }
a04b73e1 19// { dg-require-effective-target cxx11_abi }
1fc9d0b0
JW
20
21#include <string>
22#include <memory_resource>
23
24struct T : std::char_traits<char> { };
25
26static_assert(std::is_same_v<std::pmr::basic_string<char>,
27 std::basic_string<char, std::char_traits<char>,
28 std::pmr::polymorphic_allocator<char>>>);
29static_assert(std::is_same_v<std::pmr::basic_string<char, T>,
30 std::basic_string<char, T, std::pmr::polymorphic_allocator<char>>>);
31
32static_assert(std::is_same_v<std::pmr::string,
33 std::basic_string<char, std::char_traits<char>,
34 std::pmr::polymorphic_allocator<char>>>);
59019b42
TH
35#ifdef _GLIBCXX_USE_CHAR8_T
36static_assert(std::is_same_v<std::pmr::u8string,
37 std::basic_string<char8_t, std::char_traits<char8_t>,
38 std::pmr::polymorphic_allocator<char8_t>>>);
39#endif
1fc9d0b0
JW
40static_assert(std::is_same_v<std::pmr::u16string,
41 std::basic_string<char16_t, std::char_traits<char16_t>,
42 std::pmr::polymorphic_allocator<char16_t>>>);
43static_assert(std::is_same_v<std::pmr::u32string,
44 std::basic_string<char32_t, std::char_traits<char32_t>,
45 std::pmr::polymorphic_allocator<char32_t>>>);
46
1fc9d0b0
JW
47static_assert(std::is_same_v<std::pmr::basic_string<wchar_t>,
48 std::basic_string<wchar_t, std::char_traits<wchar_t>,
49 std::pmr::polymorphic_allocator<wchar_t>>>);
50static_assert(std::is_same_v<std::pmr::basic_string<wchar_t, T>,
51 std::basic_string<wchar_t, T, std::pmr::polymorphic_allocator<wchar_t>>>);
52
53static_assert(std::is_same_v<std::pmr::wstring,
54 std::basic_string<wchar_t, std::char_traits<wchar_t>,
55 std::pmr::polymorphic_allocator<wchar_t>>>);