summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc
blob: 897b0e97917de15aba0fe025cefc2aef2fd5e8fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (C) 2018-2022 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3.  If not see
// <http://www.gnu.org/licenses/>.

// { dg-do compile { target c++14 } }
// { dg-require-effective-target cxx11_abi }

#include <experimental/string>

namespace xpmr = std::experimental::pmr;

struct T : std::char_traits<char> { };

static_assert(std::is_same<xpmr::basic_string<char>,
    std::basic_string<char, std::char_traits<char>,
		      xpmr::polymorphic_allocator<char>>>::value,
    "pmr::basic_string");
static_assert(std::is_same<xpmr::basic_string<char, T>,
    std::basic_string<char, T, xpmr::polymorphic_allocator<char>>>::value,
    "pmr::basic_string");

static_assert(std::is_same<xpmr::string,
    std::basic_string<char, std::char_traits<char>,
		      xpmr::polymorphic_allocator<char>>>::value,
    "pmr::string");
#ifdef _GLIBCXX_USE_CHAR8_T
static_assert(std::is_same<xpmr::u8string,
    std::basic_string<char8_t, std::char_traits<char8_t>,
		      xpmr::polymorphic_allocator<char8_t>>>::value,
    "pmr::u8string");
#endif
static_assert(std::is_same<xpmr::u16string,
    std::basic_string<char16_t, std::char_traits<char16_t>,
		      xpmr::polymorphic_allocator<char16_t>>>::value,
    "pmr::u16string");
static_assert(std::is_same<xpmr::u32string,
    std::basic_string<char32_t, std::char_traits<char32_t>,
		      xpmr::polymorphic_allocator<char32_t>>>::value,
    "pmr::u32string");

static_assert(std::is_same<xpmr::basic_string<wchar_t>,
    std::basic_string<wchar_t, std::char_traits<wchar_t>,
		      xpmr::polymorphic_allocator<wchar_t>>>::value,
    "pmr::basic_string<wchar_t>");
static_assert(std::is_same<xpmr::basic_string<wchar_t, T>,
    std::basic_string<wchar_t, T, xpmr::polymorphic_allocator<wchar_t>>>::value,
    "pmr::basic_string<wchar_t>");

static_assert(std::is_same<xpmr::wstring,
    std::basic_string<wchar_t, std::char_traits<wchar_t>,
		      xpmr::polymorphic_allocator<wchar_t>>>::value,
    "pmr::wstring");