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 // UNSUPPORTED: libcpp-has-no-incomplete-ranges 11 12 // std::ranges::data 13 14 #include <ranges> 15 16 struct NonBorrowedRange { 17 int* begin() const; 18 int* end() const; 19 }; 20 static_assert(!std::ranges::enable_borrowed_range<NonBorrowedRange>); 21 22 // Verify that if the expression is an rvalue and `enable_borrowed_range` is false, `ranges::data` is ill-formed. 23 void test() { 24 std::ranges::data(NonBorrowedRange()); 25 // expected-error-re@-1 {{{{no matching function for call to object of type 'const (std::ranges::)?__data::__fn'}}}} 26 } 27