blob: 17f14b9a46bfec4fb104af7b082c0d39cfde759b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
// { dg-do compile { target c++17 } }
// { dg-options "-fconcepts" }
template<typename T>
concept bool C() { return __is_class(T); }
struct S { } s;
template<typename T>
requires C<T>()
void f(T x) { }
// Calls are valid when arguments are dependent,
template<typename T>
void g(T x) { f(x); }
// Calls are checked when arguments are non-dependent.
template<typename T>
void h(T x) {
f(s);
}
int main() {
f(s);
g(s);
}
|