Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-fn5.C

raw
1 // Verify we check associated constraints when resolving the address of a
2 // template-id.
3 // { dg-do compile { target c++20 } }
4
5 void id(auto) { }
6
7 template <typename>
8 int f() { return 0; }
9
10 template <typename T> requires requires { T::fail(); }
11 auto f() { T::fail(); }
12
13 int main() {
14 using U = decltype(&f<int>);
15 (void)&f<int>;
16 id(&f<int>);
17 }