aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-fn5.C
blob: 8f00a760d7ebe8c152c54ac975a2a8d1e1067be7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Verify we check associated constraints when resolving the address of a
// template-id.
// { dg-do compile { target c++20 } }

void id(auto) { }

template <typename>
int f() { return 0; }

template <typename T> requires requires { T::fail(); }
auto f() { T::fail(); }

int main() {
  using U = decltype(&f<int>);
  (void)&f<int>;
  id(&f<int>);
}