libstdc++-v3/testsuite/18_support/coroutines/hash.cc
raw| 1 | // { dg-do run { target c++20 } } |
| 2 | |
| 3 | #include <coroutine> |
| 4 | #include <testsuite_hooks.h> |
| 5 | |
| 6 | void |
| 7 | test01() |
| 8 | { |
| 9 | auto coro = std::noop_coroutine(); |
| 10 | std::hash<std::noop_coroutine_handle> h; |
| 11 | std::size_t v = h(coro); |
| 12 | |
| 13 | const auto& ch = h; |
| 14 | std::size_t v2 = ch(coro); // PR libstdc++/109165 |
| 15 | |
| 16 | VERIFY( v2 == v ); |
| 17 | } |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | test01(); |
| 22 | } |