//===----------------------------------------------------------------------===// // // 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 call with nested iterators of views should not look up base's view's // namespace #include #include #include "test_macros.h" #ifndef TEST_HAS_NO_LOCALIZATION #include #endif namespace adl { struct BaseView : std::ranges::view_base { int* begin() const; int* end() const; }; struct TupleView : std::ranges::view_base { std::tuple* begin() const; std::tuple* end() const; }; struct NestedView : std::ranges::view_base { BaseView* begin() const; BaseView* end() const; }; struct Pred { bool operator()(const auto&...) const; }; struct Sentinel { bool operator==(const auto&) const; }; struct Value { friend std::istream& operator>>(std::istream&, Value); }; void adl_func(const auto&); } // namespace adl template concept CanFindADLFunc = requires(std::ranges::iterator_t it) { adl_func(it); }; static_assert(!CanFindADLFunc>); static_assert(!CanFindADLFunc>); static_assert(!CanFindADLFunc>); #ifndef TEST_HAS_NO_LOCALIZATION static_assert(!CanFindADLFunc>); #endif static_assert(!CanFindADLFunc>); static_assert(!CanFindADLFunc>); using InnerRange = typename std::ranges::iterator_t>::value_type; static_assert(!CanFindADLFunc); static_assert(!CanFindADLFunc>); static_assert(!CanFindADLFunc>); #if TEST_STD_VER >= 23 static_assert(!CanFindADLFunc>); #endif