100612.cc 468 B

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