libstdc++-v3/testsuite/30_threads/jthread/100612.cc
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | // { dg-additional-options "-pthread" { target pthread } } |
| 3 | // { dg-require-gthreads "" } |
| 4 | |
| 5 | #include <thread> |
| 6 | |
| 7 | void |
| 8 | test_pfm() |
| 9 | { |
| 10 | // PR libstdc++/100612 |
| 11 | struct X |
| 12 | { |
| 13 | void run(std::stop_token) { } |
| 14 | void run_arg(int) { } |
| 15 | void run_args(std::stop_token, int, int) { } |
| 16 | }; |
| 17 | |
| 18 | X x; |
| 19 | |
| 20 | std::jthread{&X::run, &x}; |
| 21 | std::jthread{&X::run_arg, &x, 1}; |
| 22 | std::jthread{&X::run_args, &x, 1, 1}; |
| 23 | } |