Debian Codegraph @

gcc/testsuite/g++.dg/cpp1z/pr92536.C

raw
1 // { dg-do compile { target c++17 } }
2
3 namespace std
4 {
5 struct stop_token { };
6
7 template<typename Callback>
8 struct stop_callback
9 {
10 template<typename C>
11 stop_callback(stop_token, C&&) { }
12 };
13
14 template<typename _Callback>
15 stop_callback(stop_token, _Callback) -> stop_callback<_Callback>;
16 }
17
18 int main()
19 {
20 std::stop_token tok;
21 std::function<void()> f([](){}); // { dg-error "not a member|not declared" }
22 std::stop_callback cb(tok, f);
23 }