]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Replace std::result_of with __invoke_result_t [PR114394]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 19 Mar 2024 14:02:06 +0000 (14:02 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 22 Mar 2024 22:37:57 +0000 (22:37 +0000)
commit31ef58b18da930b09ea0dfc1d6533c5ef97d8446
tree3b94ce9194338577698157a6ad4e8ca8bbb07bb3
parentc083a453dbe51853e26e02edd8b9346fb8618292
libstdc++: Replace std::result_of with __invoke_result_t [PR114394]

Replace std::result_of with std::invoke_result, as specified in the
standard since C++17, to avoid deprecated warnings for std::result_of.

We don't have __invoke_result_t in C++11 mode, so add it as an alias
template for __invoke_result<>::type (which is what std::result_of uses
as its base class, so there's no change in functionality).

This fixes warnings given by Clang 18.

libstdc++-v3/ChangeLog:

PR libstdc++/114394
* include/std/functional (bind): Use __invoke_result_t instead
of result_of::type.
* include/std/type_traits (__invoke_result_t): New alias
template.
* testsuite/20_util/bind/ref_neg.cc: Adjust prune pattern.
libstdc++-v3/include/std/functional
libstdc++-v3/include/std/type_traits
libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
This page took 0.060803 seconds and 6 git commands to generate.