[Bug libstdc++/114394] std::bind uses std::result_of which is deprecated

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Dec 7 10:09:37 GMT 2024


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114394

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:359917755997a96f00c5bafa3a678f5545f1d03d

commit r13-9234-g359917755997a96f00c5bafa3a678f5545f1d03d
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Mar 19 14:02:06 2024 +0000

    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.

    (cherry picked from commit 31ef58b18da930b09ea0dfc1d6533c5ef97d8446)


More information about the Gcc-bugs mailing list