]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc
1 // Copyright (C) 2018-2019 Free Software Foundation, Inc.
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)
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.
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/>.
18 // { dg-do compile { target c++14 } }
19 // { dg-require-effective-target cxx11-abi }
21 #include <experimental/string>
23 namespace xpmr
= std::experimental::pmr
;
25 struct T
: std::char_traits
<char> { };
27 static_assert(std::is_same
<xpmr::basic_string
<char>,
28 std::basic_string
<char, std::char_traits
<char>,
29 xpmr::polymorphic_allocator
<char>>>::value
,
31 static_assert(std::is_same
<xpmr::basic_string
<char, T
>,
32 std::basic_string
<char, T
, xpmr::polymorphic_allocator
<char>>>::value
,
35 static_assert(std::is_same
<xpmr::string
,
36 std::basic_string
<char, std::char_traits
<char>,
37 xpmr::polymorphic_allocator
<char>>>::value
,
39 static_assert(std::is_same
<xpmr::u16string
,
40 std::basic_string
<char16_t
, std::char_traits
<char16_t
>,
41 xpmr::polymorphic_allocator
<char16_t
>>>::value
,
43 static_assert(std::is_same
<xpmr::u32string
,
44 std::basic_string
<char32_t
, std::char_traits
<char32_t
>,
45 xpmr::polymorphic_allocator
<char32_t
>>>::value
,
48 #ifdef _GLIBCXX_USE_WCHAR_T
49 static_assert(std::is_same
<xpmr::basic_string
<wchar_t>,
50 std::basic_string
<wchar_t, std::char_traits
<wchar_t>,
51 xpmr::polymorphic_allocator
<wchar_t>>>::value
,
52 "pmr::basic_string<wchar_t>");
53 static_assert(std::is_same
<xpmr::basic_string
<wchar_t, T
>,
54 std::basic_string
<wchar_t, T
, xpmr::polymorphic_allocator
<wchar_t>>>::value
,
55 "pmr::basic_string<wchar_t>");
57 static_assert(std::is_same
<xpmr::wstring
,
58 std::basic_string
<wchar_t, std::char_traits
<wchar_t>,
59 xpmr::polymorphic_allocator
<wchar_t>>>::value
,