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