1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // UNSUPPORTED: c++03, c++11, c++14, c++17 10 11 // template<class R> 12 // explicit join_view(R&&) -> join_view<views::all_t<R>>; 13 14 // Tests that the deduction guide is explicit. 15 16 #include <ranges> 17 18 #include "test_iterators.h" 19 20 template<class T> 21 struct Range { begin(Range &)22 friend T* begin(Range&) { return nullptr; } begin(Range const &)23 friend T* begin(Range const&) { return nullptr; } end(Range &)24 friend sentinel_wrapper<T*> end(Range&) { return sentinel_wrapper<T*>(nullptr); } end(Range const &)25 friend sentinel_wrapper<T*> end(Range const&) { return sentinel_wrapper<T*>(nullptr); } 26 }; 27 testExplicitCTAD()28void testExplicitCTAD() { 29 Range<Range<int>> r; 30 std::ranges::join_view v = r; // expected-error-re {{no viable constructor or deduction guide for deduction of template arguments of '{{(std::ranges::)?}}join_view'}} 31 } 32