blob: c5d175d46a34b765cf00ec4960e22da50bd164ff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// PR c++/67427
// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts" }
template <class S, class I>
concept Sentinel =
requires (I i) { i; };
template <class I, class S>
concept SizedIteratorRange =
Sentinel<S, I> && true;
template<typename S, typename I>
requires Sentinel<S, I>
void distance(I first, S last) {}
template <class I, class S>
requires SizedIteratorRange<I, S>
void distance(I first, S last) {}
int main() {
distance(42, 43); // { dg-error "ambiguous" }
}
|