]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix test for hash<coroutine_handle<P>>::operator() [PR109165]
authorJonathan Wakely <jwakely@redhat.com>
Fri, 17 Mar 2023 11:39:55 +0000 (11:39 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Sat, 18 Mar 2023 09:43:20 +0000 (09:43 +0000)
libstdc++-v3/ChangeLog:

PR libstdc++/109165
* testsuite/18_support/coroutines/hash.cc: Use const object
in second call.

libstdc++-v3/testsuite/18_support/coroutines/hash.cc

index 68e5e640477b20cad1098f035d90c9724049a655..81b68f8246a3e33efc138debf818cb49cea0e9a8 100644 (file)
@@ -7,11 +7,12 @@
 void
 test01()
 {
+  auto coro = std::noop_coroutine();
   std::hash<std::noop_coroutine_handle> h;
-  std::size_t v = h(std::noop_coroutine());
+  std::size_t v = h(coro);
 
   const auto& ch = h;
-  std::size_t v2 = h(std::noop_coroutine()); // PR libstdc++/109165
+  std::size_t v2 = ch(coro); // PR libstdc++/109165
 
   VERIFY( v2 == v );
 }