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