136d0fdf9SChristopher Di Bella //===----------------------------------------------------------------------===//
236d0fdf9SChristopher Di Bella //
336d0fdf9SChristopher Di Bella // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
436d0fdf9SChristopher Di Bella // See https://llvm.org/LICENSE.txt for license information.
536d0fdf9SChristopher Di Bella // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
636d0fdf9SChristopher Di Bella //
736d0fdf9SChristopher Di Bella //===----------------------------------------------------------------------===//
836d0fdf9SChristopher Di Bella 
936d0fdf9SChristopher Di Bella // UNSUPPORTED: c++03, c++11, c++14, c++17
10*53406fb6SArthur O'Dwyer // UNSUPPORTED: libcpp-has-no-incomplete-ranges
1136d0fdf9SChristopher Di Bella 
12ab9a571aSArthur O'Dwyer // ranges::advance
13ab9a571aSArthur O'Dwyer // Make sure we're SFINAE-friendly when the template argument constraints are not met.
1436d0fdf9SChristopher Di Bella 
1536d0fdf9SChristopher Di Bella #include <iterator>
1636d0fdf9SChristopher Di Bella 
1736d0fdf9SChristopher Di Bella #include <memory>
1836d0fdf9SChristopher Di Bella 
1936d0fdf9SChristopher Di Bella #include "test_iterators.h"
2036d0fdf9SChristopher Di Bella 
proper_constraints()2136d0fdf9SChristopher Di Bella void proper_constraints() {
2236d0fdf9SChristopher Di Bella   auto p = std::unique_ptr<int>();
2336d0fdf9SChristopher Di Bella   std::ranges::advance(p, 5); // expected-error {{no matching function for call}}
2436d0fdf9SChristopher Di Bella   std::ranges::advance(p, p); // expected-error {{no matching function for call}}
2536d0fdf9SChristopher Di Bella   std::ranges::advance(p, 5, p); // expected-error {{no matching function for call}}
2636d0fdf9SChristopher Di Bella }
27