https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/144117
This fixes/removes a bunch of random tests. They all failed in relatively simple to fix ways. Specificially (all inside `libcxx/test/libcxx-03`): - `utilities/template.bitset/includes.pass.cpp`: the header guards have different names now (guard names fixed) - `utilities/meta/is_referenceable.compile.pass.cpp`: The name changed from `__libcpp_is_referenceable` (reverted name) - `utilities/function.objects/refwrap/desugars_to.compile.pass.cpp`: Optimization has been added after the header split (test removed) - `type_traits/is_replaceable.compile.pass.cpp`: `__is_replacable_v` has been added after the header split (test removed) - `type_traits/is_constant_evaluated.pass.cpp`: Ran C++11 code accidentally (C++11 test parts removed) - `type_traits/desugars_to.compile.pass.cpp`: Optimization has been added after the header split (test removed) - `numerics/bit.ops.pass.cpp`: Tried to include header which doesn't exist (removed include and related code which wasn't executed in C++03) - `experimental/fexperimental-library.compile.pass.cpp`: This test is irrelevant for C++03, since there are no C++03 experimental features (test removed) - `containers/container_traits.compile.pass.cpp`: `container_traits` have been introduced after the header split (test removed) >From 94255420a3a9e470973d3f3d4f7bed76bef39d23 Mon Sep 17 00:00:00 2001 From: Nikolas Klauser <nikolasklau...@berlin.de> Date: Fri, 13 Jun 2025 18:51:26 +0200 Subject: [PATCH] [libc++][C++03] Fix a bunch of random tests --- .../container_traits.compile.pass.cpp | 165 --------- .../fexperimental-library.compile.pass.cpp | 31 -- .../bounded_iter/comparison.pass.cpp | 4 +- .../test/libcxx-03/numerics/bit.ops.pass.cpp | 12 +- .../type_traits/desugars_to.compile.pass.cpp | 42 --- .../is_constant_evaluated.pass.cpp | 8 +- .../is_replaceable.compile.pass.cpp | 313 ------------------ .../refwrap/desugars_to.compile.pass.cpp | 36 -- .../meta/is_referenceable.compile.pass.cpp | 230 +++++++------ .../template.bitset/includes.pass.cpp | 8 +- 10 files changed, 121 insertions(+), 728 deletions(-) delete mode 100644 libcxx/test/libcxx-03/containers/container_traits.compile.pass.cpp delete mode 100644 libcxx/test/libcxx-03/experimental/fexperimental-library.compile.pass.cpp delete mode 100644 libcxx/test/libcxx-03/type_traits/desugars_to.compile.pass.cpp delete mode 100644 libcxx/test/libcxx-03/type_traits/is_replaceable.compile.pass.cpp delete mode 100644 libcxx/test/libcxx-03/utilities/function.objects/refwrap/desugars_to.compile.pass.cpp diff --git a/libcxx/test/libcxx-03/containers/container_traits.compile.pass.cpp b/libcxx/test/libcxx-03/containers/container_traits.compile.pass.cpp deleted file mode 100644 index 22be217487951..0000000000000 --- a/libcxx/test/libcxx-03/containers/container_traits.compile.pass.cpp +++ /dev/null @@ -1,165 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// -// -// <__type_traits/container_traits.h> -// - -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - -#include <__type_traits/container_traits.h> - -#include <deque> -#include <forward_list> -#include <list> -#include <vector> -#include <map> -#include <set> -#include <unordered_map> -#include <unordered_set> - -#include "test_allocator.h" -#include "test_macros.h" -#include "MoveOnly.h" - -struct ThrowOnMove { - ThrowOnMove(); - ThrowOnMove(const ThrowOnMove&) TEST_NOEXCEPT_COND(false); - ThrowOnMove(ThrowOnMove&&) TEST_NOEXCEPT_COND(false); - ThrowOnMove& operator=(ThrowOnMove&&) TEST_NOEXCEPT_COND(false); - ThrowOnMove& operator=(const ThrowOnMove&) TEST_NOEXCEPT_COND(false); - - bool operator<(ThrowOnMove const&) const; - bool operator==(ThrowOnMove const&) const; -}; - -struct NonCopyThrowOnMove { - NonCopyThrowOnMove(); - NonCopyThrowOnMove(NonCopyThrowOnMove&&) TEST_NOEXCEPT_COND(false); - NonCopyThrowOnMove(const NonCopyThrowOnMove&) = delete; - NonCopyThrowOnMove& operator=(NonCopyThrowOnMove&&) TEST_NOEXCEPT_COND(false); - NonCopyThrowOnMove& operator=(const NonCopyThrowOnMove&) = delete; - - bool operator<(NonCopyThrowOnMove const&) const; - bool operator==(NonCopyThrowOnMove const&) const; -}; - -struct ThrowingHash { - template <class T> - std::size_t operator()(const T&) const TEST_NOEXCEPT_COND(false); -}; - -struct NoThrowHash { - template <class T> - std::size_t operator()(const T&) const TEST_NOEXCEPT; -}; - -template <bool Expected, class Container> -void check() { - static_assert( - std::__container_traits<Container>::__emplacement_has_strong_exception_safety_guarantee == Expected, ""); -} - -void test() { - check<true, std::list<int> >(); - check<true, std::list<int, test_allocator<int> > >(); - check<true, std::list<MoveOnly> >(); - check<true, std::list<ThrowOnMove> >(); - check<true, std::list<NonCopyThrowOnMove> >(); - - check<true, std::forward_list<int> >(); - check<true, std::forward_list<int, test_allocator<int> > >(); - check<true, std::forward_list<MoveOnly> >(); - check<true, std::forward_list<ThrowOnMove> >(); - check<true, std::forward_list<NonCopyThrowOnMove> >(); - - check<true, std::deque<int> >(); - check<true, std::deque<int, test_allocator<int> > >(); - check<true, std::deque<MoveOnly> >(); - check<true, std::deque<ThrowOnMove> >(); - check<false, std::deque<NonCopyThrowOnMove> >(); - - check<true, std::vector<int> >(); - check<true, std::vector<int, test_allocator<int> > >(); - check<true, std::vector<MoveOnly> >(); - check<true, std::vector<ThrowOnMove> >(); - check<false, std::vector<NonCopyThrowOnMove> >(); - - check<true, std::set<int> >(); - check<true, std::set<int, std::less<int>, test_allocator<int> > >(); - check<true, std::set<MoveOnly> >(); - check<true, std::set<ThrowOnMove> >(); - check<true, std::set<NonCopyThrowOnMove> >(); - - check<true, std::multiset<int> >(); - check<true, std::multiset<int, std::less<int>, test_allocator<int> > >(); - check<true, std::multiset<MoveOnly> >(); - check<true, std::multiset<ThrowOnMove> >(); - check<true, std::multiset<NonCopyThrowOnMove> >(); - - check<true, std::map<int, int> >(); - check<true, std::map<int, int, std::less<int>, test_allocator<int> > >(); - check<true, std::map<MoveOnly, MoveOnly> >(); - check<true, std::map<ThrowOnMove, ThrowOnMove> >(); - check<true, std::map<NonCopyThrowOnMove, NonCopyThrowOnMove> >(); - - check<true, std::multimap<int, int> >(); - check<true, std::multimap<int, int, std::less<int>, test_allocator<int> > >(); - check<true, std::multimap<MoveOnly, MoveOnly> >(); - check<true, std::multimap<ThrowOnMove, ThrowOnMove> >(); - check<true, std::multimap<NonCopyThrowOnMove, NonCopyThrowOnMove> >(); - -#if TEST_STD_VER < 11 - check<false, std::unordered_set<int> >(); - check<false, std::unordered_set<int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_set<MoveOnly> >(); - check<false, std::unordered_set<MoveOnly, NoThrowHash> >(); - check<false, std::unordered_set<MoveOnly, ThrowingHash> >(); - - check<false, std::unordered_multiset<int> >(); - check<false, std::unordered_multiset<int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_multiset<MoveOnly> >(); - check<false, std::unordered_multiset<MoveOnly, NoThrowHash> >(); - check<false, std::unordered_multiset<MoveOnly, ThrowingHash> >(); - - check<false, std::unordered_map<int, int> >(); - check<false, std::unordered_map<int, int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_map<MoveOnly, MoveOnly> >(); - check<false, std::unordered_map<MoveOnly, MoveOnly, NoThrowHash> >(); - check<false, std::unordered_map<MoveOnly, MoveOnly, ThrowingHash> >(); - - check<false, std::unordered_multimap<int, int> >(); - check<false, std::unordered_multimap<int, int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_multimap<MoveOnly, MoveOnly> >(); - check<false, std::unordered_multimap<MoveOnly, MoveOnly, NoThrowHash> >(); - check<false, std::unordered_multimap<MoveOnly, MoveOnly, ThrowingHash> >(); -#else - check<true, std::unordered_set<int> >(); - check<true, std::unordered_set<int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_set<MoveOnly> >(); - check<true, std::unordered_set<MoveOnly, NoThrowHash> >(); - check<false, std::unordered_set<MoveOnly, ThrowingHash> >(); - - check<true, std::unordered_multiset<int> >(); - check<true, std::unordered_multiset<int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_multiset<MoveOnly> >(); - check<true, std::unordered_multiset<MoveOnly, NoThrowHash> >(); - check<false, std::unordered_multiset<MoveOnly, ThrowingHash> >(); - - check<true, std::unordered_map<int, int> >(); - check<true, std::unordered_map<int, int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_map<MoveOnly, MoveOnly> >(); - check<true, std::unordered_map<MoveOnly, MoveOnly, NoThrowHash> >(); - check<false, std::unordered_map<MoveOnly, MoveOnly, ThrowingHash> >(); - - check<true, std::unordered_multimap<int, int> >(); - check<true, std::unordered_multimap<int, int, std::hash<int>, std::less<int>, test_allocator<int> > >(); - check<false, std::unordered_multimap<MoveOnly, MoveOnly> >(); - check<true, std::unordered_multimap<MoveOnly, MoveOnly, NoThrowHash> >(); - check<false, std::unordered_multimap<MoveOnly, MoveOnly, ThrowingHash> >(); -#endif -} diff --git a/libcxx/test/libcxx-03/experimental/fexperimental-library.compile.pass.cpp b/libcxx/test/libcxx-03/experimental/fexperimental-library.compile.pass.cpp deleted file mode 100644 index 3cf497da233fb..0000000000000 --- a/libcxx/test/libcxx-03/experimental/fexperimental-library.compile.pass.cpp +++ /dev/null @@ -1,31 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// This test ensures that passing `-fexperimental-library` results in experimental -// library features being enabled. - -// GCC does not support the -fexperimental-library flag -// UNSUPPORTED: gcc - -// ADDITIONAL_COMPILE_FLAGS: -fexperimental-library - -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - -#include <version> - -#if !_LIBCPP_HAS_EXPERIMENTAL_PSTL -# error "-fexperimental-library should enable the PSTL" -#endif - -#if !_LIBCPP_HAS_EXPERIMENTAL_TZDB -# error "-fexperimental-library should enable the chrono TZDB" -#endif - -#if !_LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM -# error "-fexperimental-library should enable the syncstream header" -#endif diff --git a/libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp b/libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp index a12b77afa0db0..490bfed54a159 100644 --- a/libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp +++ b/libcxx/test/libcxx-03/iterators/bounded_iter/comparison.pass.cpp @@ -11,10 +11,8 @@ // // Comparison operators -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - #include <concepts> -#include <__iterator/bounded_iter.h> +#include <__cxx03/__iterator/bounded_iter.h> #include "test_iterators.h" #include "test_macros.h" diff --git a/libcxx/test/libcxx-03/numerics/bit.ops.pass.cpp b/libcxx/test/libcxx-03/numerics/bit.ops.pass.cpp index 1bf9d3890f45f..0b82f352ffe3d 100644 --- a/libcxx/test/libcxx-03/numerics/bit.ops.pass.cpp +++ b/libcxx/test/libcxx-03/numerics/bit.ops.pass.cpp @@ -9,11 +9,8 @@ // Test the __XXXX routines in the <bit> header. // These are not supposed to be exhaustive tests, just sanity checks. -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - -#include <__bit/bit_log2.h> -#include <__bit/countl.h> -#include <__bit/rotate.h> +#include <__cxx03/__bit/countl.h> +#include <__cxx03/__bit/rotate.h> #include <cassert> #include "test_macros.h" @@ -27,11 +24,6 @@ TEST_CONSTEXPR_CXX14 bool test() { assert(std::__rotr(v, 3) == 0x02468acfU); assert(std::__countl_zero(v) == 3); -#if TEST_STD_VER > 17 - ASSERT_SAME_TYPE(unsigned, decltype(std::__bit_log2(v))); - assert(std::__bit_log2(v) == 28); -#endif - return true; } diff --git a/libcxx/test/libcxx-03/type_traits/desugars_to.compile.pass.cpp b/libcxx/test/libcxx-03/type_traits/desugars_to.compile.pass.cpp deleted file mode 100644 index 4ed6d15ee9e95..0000000000000 --- a/libcxx/test/libcxx-03/type_traits/desugars_to.compile.pass.cpp +++ /dev/null @@ -1,42 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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: FROZEN-CXX03-HEADERS-FIXME - -// This test requires variable templates -// UNSUPPORTED: gcc && c++11 - -#include <__type_traits/desugars_to.h> - -struct Tag {}; -struct Operation {}; - -namespace std { -template <> -bool const __desugars_to_v<Tag, Operation> = true; -} - -void tests() { - // Make sure that __desugars_to is false by default - { - struct Foo {}; - static_assert(!std::__desugars_to_v<Tag, Foo>, ""); - } - - // Make sure that __desugars_to bypasses const and ref qualifiers on the operation - { - static_assert(std::__desugars_to_v<Tag, Operation>, ""); // no quals - static_assert(std::__desugars_to_v<Tag, Operation const>, ""); - - static_assert(std::__desugars_to_v<Tag, Operation&>, ""); - static_assert(std::__desugars_to_v<Tag, Operation const&>, ""); - - static_assert(std::__desugars_to_v<Tag, Operation&&>, ""); - static_assert(std::__desugars_to_v<Tag, Operation const&&>, ""); - } -} diff --git a/libcxx/test/libcxx-03/type_traits/is_constant_evaluated.pass.cpp b/libcxx/test/libcxx-03/type_traits/is_constant_evaluated.pass.cpp index a538c52a534e7..5e1b34259f2f8 100644 --- a/libcxx/test/libcxx-03/type_traits/is_constant_evaluated.pass.cpp +++ b/libcxx/test/libcxx-03/type_traits/is_constant_evaluated.pass.cpp @@ -14,9 +14,7 @@ // returns false when there's no constant evaluation support from the compiler. // as well as when called not in a constexpr context -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - -#include <__type_traits/is_constant_evaluated.h> +#include <__cxx03/__type_traits/is_constant_evaluated.h> #include <cassert> #include "test_macros.h" @@ -25,10 +23,6 @@ int main (int, char**) { ASSERT_SAME_TYPE(decltype(std::__libcpp_is_constant_evaluated()), bool); ASSERT_NOEXCEPT(std::__libcpp_is_constant_evaluated()); -#if !defined(_LIBCPP_CXX03_LANG) - static_assert(std::__libcpp_is_constant_evaluated(), ""); -#endif - bool p = std::__libcpp_is_constant_evaluated(); assert(!p); diff --git a/libcxx/test/libcxx-03/type_traits/is_replaceable.compile.pass.cpp b/libcxx/test/libcxx-03/type_traits/is_replaceable.compile.pass.cpp deleted file mode 100644 index 7735538cccae4..0000000000000 --- a/libcxx/test/libcxx-03/type_traits/is_replaceable.compile.pass.cpp +++ /dev/null @@ -1,313 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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 -// -//===----------------------------------------------------------------------===// - -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - -#include <__type_traits/is_replaceable.h> -#include <array> -#include <deque> -#include <exception> -#include <expected> -#include <memory> -#include <optional> -#include <string> -#include <tuple> -#include <type_traits> -#include <variant> -#include <vector> - -#include "constexpr_char_traits.h" -#include "test_allocator.h" -#include "test_macros.h" - -#ifndef TEST_HAS_NO_LOCALIZATION -# include <locale> -#endif - -template <class T> -struct NonPropagatingStatefulMoveAssignAlloc : std::allocator<T> { - using propagate_on_container_move_assignment = std::false_type; - using is_always_equal = std::false_type; - template <class U> - struct rebind { - using other = NonPropagatingStatefulMoveAssignAlloc<U>; - }; -}; - -template <class T> -struct NonPropagatingStatefulCopyAssignAlloc : std::allocator<T> { - using propagate_on_container_copy_assignment = std::false_type; - using is_always_equal = std::false_type; - template <class U> - struct rebind { - using other = NonPropagatingStatefulCopyAssignAlloc<U>; - }; -}; - -template <class T> -struct NonPropagatingStatelessMoveAssignAlloc : std::allocator<T> { - using propagate_on_container_move_assignment = std::false_type; - using is_always_equal = std::true_type; - template <class U> - struct rebind { - using other = NonPropagatingStatelessMoveAssignAlloc<U>; - }; -}; - -template <class T> -struct NonPropagatingStatelessCopyAssignAlloc : std::allocator<T> { - using propagate_on_container_copy_assignment = std::false_type; - using is_always_equal = std::true_type; - template <class U> - struct rebind { - using other = NonPropagatingStatelessCopyAssignAlloc<U>; - }; -}; - -template <class T> -struct NonReplaceableStatelessAlloc : std::allocator<T> { - // Ensure that we don't consider an allocator that is a member of a container to be - // replaceable if it's not replaceable, even if it always compares equal and always propagates. - using propagate_on_container_move_assignment = std::true_type; - using propagate_on_container_copy_assignment = std::true_type; - using is_always_equal = std::true_type; - NonReplaceableStatelessAlloc() = default; - NonReplaceableStatelessAlloc(NonReplaceableStatelessAlloc const&) {} - NonReplaceableStatelessAlloc(NonReplaceableStatelessAlloc&&) = default; - template <class U> - struct rebind { - using other = NonReplaceableStatelessAlloc<U>; - }; -}; -static_assert(!std::__is_replaceable<NonReplaceableStatelessAlloc<int> >::value, ""); - -static_assert(!std::__is_replaceable<test_allocator<char> >::value, ""); // we use that property below - -struct Empty {}; -static_assert(std::__is_replaceable<char>::value, ""); -static_assert(std::__is_replaceable<int>::value, ""); -static_assert(std::__is_replaceable<double>::value, ""); -static_assert(std::__is_replaceable<Empty>::value, ""); - -struct TriviallyCopyable { - char c; - int i; - Empty s; -}; -static_assert(std::__is_replaceable<TriviallyCopyable>::value, ""); - -struct NotTriviallyCopyable { - NotTriviallyCopyable(const NotTriviallyCopyable&); - ~NotTriviallyCopyable(); -}; -static_assert(!std::__is_replaceable<NotTriviallyCopyable>::value, ""); - -struct MoveOnlyTriviallyCopyable { - MoveOnlyTriviallyCopyable(const MoveOnlyTriviallyCopyable&) = delete; - MoveOnlyTriviallyCopyable& operator=(const MoveOnlyTriviallyCopyable&) = delete; - MoveOnlyTriviallyCopyable(MoveOnlyTriviallyCopyable&&) = default; - MoveOnlyTriviallyCopyable& operator=(MoveOnlyTriviallyCopyable&&) = default; -}; -static_assert(std::__is_replaceable<MoveOnlyTriviallyCopyable>::value, ""); - -struct CustomCopyAssignment { - CustomCopyAssignment(const CustomCopyAssignment&) = default; - CustomCopyAssignment(CustomCopyAssignment&&) = default; - CustomCopyAssignment& operator=(const CustomCopyAssignment&); - CustomCopyAssignment& operator=(CustomCopyAssignment&&) = default; -}; -static_assert(!std::__is_replaceable<CustomCopyAssignment>::value, ""); - -struct CustomMoveAssignment { - CustomMoveAssignment(const CustomMoveAssignment&) = default; - CustomMoveAssignment(CustomMoveAssignment&&) = default; - CustomMoveAssignment& operator=(const CustomMoveAssignment&) = default; - CustomMoveAssignment& operator=(CustomMoveAssignment&&); -}; -static_assert(!std::__is_replaceable<CustomMoveAssignment>::value, ""); - -// library-internal types -// ---------------------- - -// __split_buffer -static_assert(std::__is_replaceable<std::__split_buffer<int> >::value, ""); -static_assert(std::__is_replaceable<std::__split_buffer<NotTriviallyCopyable> >::value, ""); -static_assert(!std::__is_replaceable<std::__split_buffer<int, NonPropagatingStatefulCopyAssignAlloc<int> > >::value, - ""); -static_assert(!std::__is_replaceable<std::__split_buffer<int, NonPropagatingStatefulMoveAssignAlloc<int> > >::value, - ""); -static_assert(std::__is_replaceable<std::__split_buffer<int, NonPropagatingStatelessCopyAssignAlloc<int> > >::value, - ""); -static_assert(std::__is_replaceable<std::__split_buffer<int, NonPropagatingStatelessMoveAssignAlloc<int> > >::value, - ""); - -// standard library types -// ---------------------- - -// array -static_assert(std::__is_replaceable<std::array<int, 0> >::value, ""); -static_assert(std::__is_replaceable<std::array<NotTriviallyCopyable, 0> >::value, ""); -static_assert(std::__is_replaceable<std::array<std::unique_ptr<int>, 0> >::value, ""); - -static_assert(std::__is_replaceable<std::array<int, 1> >::value, ""); -static_assert(!std::__is_replaceable<std::array<NotTriviallyCopyable, 1> >::value, ""); -static_assert(std::__is_replaceable<std::array<std::unique_ptr<int>, 1> >::value, ""); - -// basic_string -struct MyChar { - char c; -}; -template <class T> -struct NotReplaceableCharTraits : constexpr_char_traits<T> { - NotReplaceableCharTraits(const NotReplaceableCharTraits&); - NotReplaceableCharTraits& operator=(const NotReplaceableCharTraits&); - ~NotReplaceableCharTraits(); -}; - -static_assert(std::__is_replaceable<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, - ""); -static_assert( - std::__is_replaceable<std::basic_string<char, NotReplaceableCharTraits<char>, std::allocator<char> > >::value, ""); -static_assert( - std::__is_replaceable<std::basic_string<MyChar, constexpr_char_traits<MyChar>, std::allocator<MyChar> > >::value, - ""); -static_assert(!std::__is_replaceable<std::basic_string<char, std::char_traits<char>, test_allocator<char> > >::value, - ""); -static_assert(!std::__is_replaceable< - std::basic_string<char, std::char_traits<char>, NonReplaceableStatelessAlloc<char> > >::value, - ""); -static_assert(std::__is_replaceable< - std::basic_string<MyChar, NotReplaceableCharTraits<MyChar>, std::allocator<MyChar> > >::value, - ""); -static_assert( - !std::__is_replaceable< - std::basic_string<char, std::char_traits<char>, NonPropagatingStatefulCopyAssignAlloc<char> > >::value, - ""); -static_assert( - !std::__is_replaceable< - std::basic_string<char, std::char_traits<char>, NonPropagatingStatefulMoveAssignAlloc<char> > >::value, - ""); -static_assert( - std::__is_replaceable< - std::basic_string<char, std::char_traits<char>, NonPropagatingStatelessCopyAssignAlloc<char> > >::value, - ""); -static_assert( - std::__is_replaceable< - std::basic_string<char, std::char_traits<char>, NonPropagatingStatelessMoveAssignAlloc<char> > >::value, - ""); - -// deque -static_assert(std::__is_replaceable<std::deque<int> >::value, ""); -static_assert(std::__is_replaceable<std::deque<NotTriviallyCopyable> >::value, ""); -static_assert(!std::__is_replaceable<std::deque<int, test_allocator<int> > >::value, ""); -static_assert(!std::__is_replaceable<std::deque<int, NonReplaceableStatelessAlloc<int> > >::value, ""); -static_assert(!std::__is_replaceable<std::deque<int, NonPropagatingStatefulCopyAssignAlloc<int> > >::value, ""); -static_assert(!std::__is_replaceable<std::deque<int, NonPropagatingStatefulMoveAssignAlloc<int> > >::value, ""); -static_assert(std::__is_replaceable<std::deque<int, NonPropagatingStatelessCopyAssignAlloc<int> > >::value, ""); -static_assert(std::__is_replaceable<std::deque<int, NonPropagatingStatelessMoveAssignAlloc<int> > >::value, ""); - -// exception_ptr -#ifndef _LIBCPP_ABI_MICROSOFT -static_assert(std::__is_replaceable<std::exception_ptr>::value, ""); -#endif - -// expected -#if TEST_STD_VER >= 23 -static_assert(std::__is_replaceable<std::expected<int, int> >::value); -static_assert(!std::__is_replaceable<std::expected<CustomCopyAssignment, int>>::value); -static_assert(!std::__is_replaceable<std::expected<int, CustomCopyAssignment>>::value); -static_assert(!std::__is_replaceable<std::expected<CustomCopyAssignment, CustomCopyAssignment>>::value); -#endif - -// locale -#ifndef TEST_HAS_NO_LOCALIZATION -static_assert(std::__is_replaceable<std::locale>::value, ""); -#endif - -// optional -#if TEST_STD_VER >= 17 -static_assert(std::__is_replaceable<std::optional<int>>::value, ""); -static_assert(!std::__is_replaceable<std::optional<CustomCopyAssignment>>::value, ""); -#endif - -// pair -static_assert(std::__is_replaceable<std::pair<int, int> >::value, ""); -static_assert(!std::__is_replaceable<std::pair<CustomCopyAssignment, int> >::value, ""); -static_assert(!std::__is_replaceable<std::pair<int, CustomCopyAssignment> >::value, ""); -static_assert(!std::__is_replaceable<std::pair<CustomCopyAssignment, CustomCopyAssignment> >::value, ""); - -// shared_ptr -static_assert(std::__is_replaceable<std::shared_ptr<int> >::value, ""); - -// tuple -#if TEST_STD_VER >= 11 -static_assert(std::__is_replaceable<std::tuple<> >::value, ""); - -static_assert(std::__is_replaceable<std::tuple<int> >::value, ""); -static_assert(!std::__is_replaceable<std::tuple<CustomCopyAssignment> >::value, ""); - -static_assert(std::__is_replaceable<std::tuple<int, int> >::value, ""); -static_assert(!std::__is_replaceable<std::tuple<CustomCopyAssignment, int> >::value, ""); -static_assert(!std::__is_replaceable<std::tuple<int, CustomCopyAssignment> >::value, ""); -static_assert(!std::__is_replaceable<std::tuple<CustomCopyAssignment, CustomCopyAssignment> >::value, ""); -#endif // TEST_STD_VER >= 11 - -// unique_ptr -struct NonReplaceableDeleter { - NonReplaceableDeleter(const NonReplaceableDeleter&); - NonReplaceableDeleter& operator=(const NonReplaceableDeleter&); - ~NonReplaceableDeleter(); - - template <class T> - void operator()(T*); -}; - -struct NonReplaceablePointer { - struct pointer { - pointer(const pointer&); - pointer& operator=(const pointer&); - ~pointer(); - }; - - template <class T> - void operator()(T*); -}; - -static_assert(std::__is_replaceable<std::unique_ptr<int> >::value, ""); -static_assert(std::__is_replaceable<std::unique_ptr<CustomCopyAssignment> >::value, ""); -static_assert(std::__is_replaceable<std::unique_ptr<int[]> >::value, ""); -static_assert(!std::__is_replaceable<std::unique_ptr<int, NonReplaceableDeleter> >::value, ""); -static_assert(!std::__is_replaceable<std::unique_ptr<int[], NonReplaceableDeleter> >::value, ""); -static_assert(!std::__is_replaceable<std::unique_ptr<int, NonReplaceablePointer> >::value, ""); -static_assert(!std::__is_replaceable<std::unique_ptr<int[], NonReplaceablePointer> >::value, ""); - -// variant -#if TEST_STD_VER >= 17 -static_assert(std::__is_replaceable<std::variant<int> >::value, ""); -static_assert(!std::__is_replaceable<std::variant<CustomCopyAssignment> >::value, ""); - -static_assert(std::__is_replaceable<std::variant<int, int> >::value, ""); -static_assert(!std::__is_replaceable<std::variant<CustomCopyAssignment, int> >::value, ""); -static_assert(!std::__is_replaceable<std::variant<int, CustomCopyAssignment> >::value, ""); -static_assert(!std::__is_replaceable<std::variant<CustomCopyAssignment, CustomCopyAssignment> >::value, ""); -#endif // TEST_STD_VER >= 17 - -// vector -static_assert(std::__is_replaceable<std::vector<int> >::value, ""); -static_assert(std::__is_replaceable<std::vector<CustomCopyAssignment> >::value, ""); -static_assert(!std::__is_replaceable<std::vector<int, test_allocator<int> > >::value, ""); -static_assert(!std::__is_replaceable<std::vector<int, NonReplaceableStatelessAlloc<int> > >::value, ""); -static_assert(!std::__is_replaceable<std::vector<int, NonPropagatingStatefulCopyAssignAlloc<int> > >::value, ""); -static_assert(!std::__is_replaceable<std::vector<int, NonPropagatingStatefulMoveAssignAlloc<int> > >::value, ""); -static_assert(std::__is_replaceable<std::vector<int, NonPropagatingStatelessCopyAssignAlloc<int> > >::value, ""); -static_assert(std::__is_replaceable<std::vector<int, NonPropagatingStatelessMoveAssignAlloc<int> > >::value, ""); - -// weak_ptr -static_assert(std::__is_replaceable<std::weak_ptr<CustomCopyAssignment> >::value, ""); - -// TODO: Mark all the replaceable STL types as such diff --git a/libcxx/test/libcxx-03/utilities/function.objects/refwrap/desugars_to.compile.pass.cpp b/libcxx/test/libcxx-03/utilities/function.objects/refwrap/desugars_to.compile.pass.cpp deleted file mode 100644 index 1ce88feeadf28..0000000000000 --- a/libcxx/test/libcxx-03/utilities/function.objects/refwrap/desugars_to.compile.pass.cpp +++ /dev/null @@ -1,36 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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: FROZEN-CXX03-HEADERS-FIXME - -// This test requires variable templates -// UNSUPPORTED: gcc && c++11 - -// <functional> - -// reference_wrapper - -// Ensure that std::reference_wrapper does not inhibit optimizations based on the -// std::__desugars_to internal helper. - -#include <functional> -#include <__type_traits/desugars_to.h> - -struct Operation {}; -struct Tag {}; - -namespace std { -template <> -bool const __desugars_to_v<Tag, Operation> = true; -} - -static_assert(std::__desugars_to_v<Tag, Operation>, "something is wrong with the test"); - -// make sure we pass through reference_wrapper -static_assert(std::__desugars_to_v<Tag, std::reference_wrapper<Operation> >, ""); -static_assert(std::__desugars_to_v<Tag, std::reference_wrapper<Operation const> >, ""); diff --git a/libcxx/test/libcxx-03/utilities/meta/is_referenceable.compile.pass.cpp b/libcxx/test/libcxx-03/utilities/meta/is_referenceable.compile.pass.cpp index 0991de69b5baf..093bbae289723 100644 --- a/libcxx/test/libcxx-03/utilities/meta/is_referenceable.compile.pass.cpp +++ b/libcxx/test/libcxx-03/utilities/meta/is_referenceable.compile.pass.cpp @@ -14,8 +14,6 @@ // or a ref-qualifier, or a reference type. // -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - #include <type_traits> #include <cassert> @@ -23,170 +21,170 @@ struct Foo {}; -static_assert((!std::__is_referenceable_v<void>), ""); -static_assert((std::__is_referenceable_v<int>), ""); -static_assert((std::__is_referenceable_v<int[3]>), ""); -static_assert((std::__is_referenceable_v<int[]>), ""); -static_assert((std::__is_referenceable_v<int&>), ""); -static_assert((std::__is_referenceable_v<const int&>), ""); -static_assert((std::__is_referenceable_v<int*>), ""); -static_assert((std::__is_referenceable_v<const int*>), ""); -static_assert((std::__is_referenceable_v<Foo>), ""); -static_assert((std::__is_referenceable_v<const Foo>), ""); -static_assert((std::__is_referenceable_v<Foo&>), ""); -static_assert((std::__is_referenceable_v<const Foo&>), ""); +static_assert((!std::__libcpp_is_referenceable<void>::value), ""); +static_assert((std::__libcpp_is_referenceable<int>::value), ""); +static_assert((std::__libcpp_is_referenceable<int[3]>::value), ""); +static_assert((std::__libcpp_is_referenceable<int[]>::value), ""); +static_assert((std::__libcpp_is_referenceable<int&>::value), ""); +static_assert((std::__libcpp_is_referenceable<const int&>::value), ""); +static_assert((std::__libcpp_is_referenceable<int*>::value), ""); +static_assert((std::__libcpp_is_referenceable<const int*>::value), ""); +static_assert((std::__libcpp_is_referenceable<Foo>::value), ""); +static_assert((std::__libcpp_is_referenceable<const Foo>::value), ""); +static_assert((std::__libcpp_is_referenceable<Foo&>::value), ""); +static_assert((std::__libcpp_is_referenceable<const Foo&>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<Foo&&>), ""); -static_assert((std::__is_referenceable_v<const Foo&&>), ""); +static_assert((std::__libcpp_is_referenceable<Foo&&>::value), ""); +static_assert((std::__libcpp_is_referenceable<const Foo&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<int __attribute__((__vector_size__(8)))>), ""); -static_assert((std::__is_referenceable_v<const int __attribute__((__vector_size__(8)))>), ""); -static_assert((std::__is_referenceable_v<float __attribute__((__vector_size__(16)))>), ""); -static_assert((std::__is_referenceable_v<const float __attribute__((__vector_size__(16)))>), ""); +static_assert((std::__libcpp_is_referenceable<int __attribute__((__vector_size__(8)))>::value), ""); +static_assert((std::__libcpp_is_referenceable<const int __attribute__((__vector_size__(8)))>::value), ""); +static_assert((std::__libcpp_is_referenceable<float __attribute__((__vector_size__(16)))>::value), ""); +static_assert((std::__libcpp_is_referenceable<const float __attribute__((__vector_size__(16)))>::value), ""); // Functions without cv-qualifiers are referenceable -static_assert((std::__is_referenceable_v<void()>), ""); +static_assert((std::__libcpp_is_referenceable<void()>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void() const>), ""); -static_assert((!std::__is_referenceable_v<void() &>), ""); -static_assert((!std::__is_referenceable_v<void() const&>), ""); -static_assert((!std::__is_referenceable_v<void() &&>), ""); -static_assert((!std::__is_referenceable_v<void() const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void() const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void() &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void() const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void() &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void() const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void(int)>), ""); +static_assert((std::__libcpp_is_referenceable<void(int)>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void(int) const>), ""); -static_assert((!std::__is_referenceable_v<void(int) &>), ""); -static_assert((!std::__is_referenceable_v<void(int) const&>), ""); -static_assert((!std::__is_referenceable_v<void(int) &&>), ""); -static_assert((!std::__is_referenceable_v<void(int) const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void(int) const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int) &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int) const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int) &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void(int, float)>), ""); +static_assert((std::__libcpp_is_referenceable<void(int, float)>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void(int, float) const>), ""); -static_assert((!std::__is_referenceable_v<void(int, float) &>), ""); -static_assert((!std::__is_referenceable_v<void(int, float) const&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float) &&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float) const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float) const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float) &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float) const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float) &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void(int, float, Foo&)>), ""); +static_assert((std::__libcpp_is_referenceable<void(int, float, Foo&)>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void(int, float, Foo&) const>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&) &>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&) const&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&) &&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&) const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&) const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&) &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&) const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&) &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void(...)>), ""); +static_assert((std::__libcpp_is_referenceable<void(...)>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void(...) const>), ""); -static_assert((!std::__is_referenceable_v<void(...) &>), ""); -static_assert((!std::__is_referenceable_v<void(...) const&>), ""); -static_assert((!std::__is_referenceable_v<void(...) &&>), ""); -static_assert((!std::__is_referenceable_v<void(...) const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void(...) const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(...) &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(...) const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(...) &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(...) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void(int, ...)>), ""); +static_assert((std::__libcpp_is_referenceable<void(int, ...)>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void(int, ...) const>), ""); -static_assert((!std::__is_referenceable_v<void(int, ...) &>), ""); -static_assert((!std::__is_referenceable_v<void(int, ...) const&>), ""); -static_assert((!std::__is_referenceable_v<void(int, ...) &&>), ""); -static_assert((!std::__is_referenceable_v<void(int, ...) const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, ...) const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, ...) &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, ...) const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, ...) &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, ...) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void(int, float, ...)>), ""); +static_assert((std::__libcpp_is_referenceable<void(int, float, ...)>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void(int, float, ...) const>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, ...) &>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, ...) const&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, ...) &&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, ...) const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, ...) const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, ...) &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, ...) const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, ...) &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, ...) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void(int, float, Foo&, ...)>), ""); +static_assert((std::__libcpp_is_referenceable<void(int, float, Foo&, ...)>::value), ""); #if TEST_STD_VER >= 11 -static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) const>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) &>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) const&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) &&>), ""); -static_assert((!std::__is_referenceable_v<void(int, float, Foo&, ...) const&&>), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&, ...) const>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&, ...) &>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&, ...) const&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&, ...) &&>::value), ""); +static_assert((!std::__libcpp_is_referenceable<void(int, float, Foo&, ...) const&&>::value), ""); #endif // member functions with or without cv-qualifiers are referenceable -static_assert((std::__is_referenceable_v<void (Foo::*)()>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)() const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)()>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)() const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)() &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)() const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)() &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)() const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)() &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)() const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)() &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)() const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void (Foo::*)(int)>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int) const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int)>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int) const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)(int) &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int) const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int) &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int) const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int) &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int) const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int) &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float)>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float)>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float) const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float) const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float) &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float) const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float) &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&)>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&)>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&) const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&) const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&) &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&) const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&) &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void (Foo::*)(...)>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(...) const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(...)>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(...) const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)(...) &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(...) const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(...) &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(...) const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(...) &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(...) const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(...) &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(...) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...)>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, ...)>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, ...) const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, ...) const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, ...) &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, ...) const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, ...) &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, ...) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...)>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, ...)>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, ...) const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, ...) const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, ...) &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, ...) const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, ...) &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, ...) const&&>::value), ""); #endif -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...)>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) const>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&, ...)>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&, ...) const>::value), ""); #if TEST_STD_VER >= 11 -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) &>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) const&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) &&>), ""); -static_assert((std::__is_referenceable_v<void (Foo::*)(int, float, Foo&, ...) const&&>), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&, ...) &>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&, ...) const&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&, ...) &&>::value), ""); +static_assert((std::__libcpp_is_referenceable<void (Foo::*)(int, float, Foo&, ...) const&&>::value), ""); #endif diff --git a/libcxx/test/libcxx-03/utilities/template.bitset/includes.pass.cpp b/libcxx/test/libcxx-03/utilities/template.bitset/includes.pass.cpp index ae8464ac946a9..f6e6960c9f764 100644 --- a/libcxx/test/libcxx-03/utilities/template.bitset/includes.pass.cpp +++ b/libcxx/test/libcxx-03/utilities/template.bitset/includes.pass.cpp @@ -8,21 +8,19 @@ // test that <bitset> includes <string>, <stdexcept> and <iosfwd> -// XFAIL: FROZEN-CXX03-HEADERS-FIXME - #include <bitset> #include "test_macros.h" -#ifndef _LIBCPP_STRING +#ifndef _LIBCPP___CXX03_STRING #error <string> has not been included #endif -#ifndef _LIBCPP_STDEXCEPT +#ifndef _LIBCPP___CXX03_STDEXCEPT #error <stdexcept> has not been included #endif -#ifndef _LIBCPP_IOSFWD +#ifndef _LIBCPP___CXX03_IOSFWD #error <iosfwd> has not been included #endif _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits