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-no-concepts 11 12 // ranges::advance 13 // Make sure we're SFINAE-friendly when the template argument constraints are not met. 14 15 #include <iterator> 16 17 #include <memory> 18 19 #include "test_iterators.h" 20 21 void proper_constraints() { 22 auto p = std::unique_ptr<int>(); 23 std::ranges::advance(p, 5); // expected-error {{no matching function for call}} 24 std::ranges::advance(p, p); // expected-error {{no matching function for call}} 25 std::ranges::advance(p, 5, p); // expected-error {{no matching function for call}} 26 } 27