//===----------------------------------------------------------------------===// // // 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, c++11, c++14, c++17 // , , // ADL should be performed. Ordinary unqualified lookup should not be performed. namespace ns { struct StructWithGlobalFunctions {}; } // namespace ns struct ConvertibleToCmpType; ConvertibleToCmpType strong_order(const ns::StructWithGlobalFunctions&, const ns::StructWithGlobalFunctions&); ConvertibleToCmpType weak_order(const ns::StructWithGlobalFunctions&, const ns::StructWithGlobalFunctions&); ConvertibleToCmpType partial_order(const ns::StructWithGlobalFunctions&, const ns::StructWithGlobalFunctions&); int&& iter_move(const ns::StructWithGlobalFunctions&); void iter_swap(const ns::StructWithGlobalFunctions&, const ns::StructWithGlobalFunctions&); int* begin(const ns::StructWithGlobalFunctions&); int* end(const ns::StructWithGlobalFunctions&); int* rbegin(const ns::StructWithGlobalFunctions&); int* rend(const ns::StructWithGlobalFunctions&); unsigned int size(const ns::StructWithGlobalFunctions&); #include #include #include struct ConvertibleToCmpType { operator std::strong_ordering() const; operator std::weak_ordering() const; operator std::partial_ordering() const; }; struct StructWithHiddenFriends { friend ConvertibleToCmpType strong_order(const StructWithHiddenFriends&, const StructWithHiddenFriends&); friend ConvertibleToCmpType weak_order(const StructWithHiddenFriends&, const StructWithHiddenFriends&); friend ConvertibleToCmpType partial_order(const StructWithHiddenFriends&, const StructWithHiddenFriends&); friend int&& iter_move(const StructWithHiddenFriends&); friend void iter_swap(const StructWithHiddenFriends&, const StructWithHiddenFriends&); friend int* begin(const StructWithHiddenFriends&); friend int* end(const StructWithHiddenFriends&); friend int* rbegin(const StructWithHiddenFriends&); friend int* rend(const StructWithHiddenFriends&); friend unsigned int size(const StructWithHiddenFriends&); }; // [cmp.alg] ADL should be performed. static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); // [cmp.alg] Ordinary unqualified lookup should not be performed. static_assert( !std::is_invocable_v); static_assert( !std::is_invocable_v); static_assert( !std::is_invocable_v); // [iterator.cust] ADL should be performed. static_assert(std::is_invocable_v); static_assert( std::is_invocable_v); // [iterator.cust] Ordinary unqualified lookup should not be performed. static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); // [range.access] ADL should be performed. static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); static_assert(std::is_invocable_v); // [range.access] Ordinary unqualified lookup should not be performed. static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v);