brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · de0c108 Raw
32 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710 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 20template<class T>21struct Range {22  friend T* begin(Range&) { return nullptr; }23  friend T* begin(Range const&) { return nullptr; }24  friend sentinel_wrapper<T*> end(Range&) { return sentinel_wrapper<T*>(nullptr); }25  friend sentinel_wrapper<T*> end(Range const&) { return sentinel_wrapper<T*>(nullptr); }26};27 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