//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // UNSUPPORTED: c++03 // Aligned allocation is required by std::experimental::pmr, but it was not provided // before macosx10.13 and as a result we get linker errors when deploying to older than // macosx10.13. // XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12}} // // namespace std { namespace experimental { namespace pmr { // template // using basic_string = // ::std::basic_string> // // typedef ... string // typedef ... u16string // typedef ... u32string // typedef ... wstring // // }}} // namespace std::experimental::pmr #include #include #include #include #include "constexpr_char_traits.h" #include "test_macros.h" namespace pmr = std::experimental::pmr; template void test_string_typedef() { using StdStr = std::basic_string, pmr::polymorphic_allocator>; using PmrStr = pmr::basic_string; static_assert(std::is_same::value, ""); static_assert(std::is_same::value, ""); } template void test_basic_string_alias() { using StdStr = std::basic_string>; using PmrStr = pmr::basic_string; static_assert(std::is_same::value, ""); } int main(int, char**) { { test_string_typedef(); #ifndef TEST_HAS_NO_WIDE_CHARACTERS test_string_typedef(); #endif test_string_typedef(); test_string_typedef(); } { test_basic_string_alias>(); #ifndef TEST_HAS_NO_WIDE_CHARACTERS test_basic_string_alias>(); #endif test_basic_string_alias>(); test_basic_string_alias>(); } { // Check that std::basic_string has been included and is complete. pmr::string s; assert(s.get_allocator().resource() == pmr::get_default_resource()); } return 0; }