[Bug c++/126406] [16/17 Regression] __is_nothrow_invocable crashes gcc

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126406

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Patrick Palka
<[email protected]>:

https://gcc.gnu.org/g:8491b800473971ba1c03e74866273cb8dcaa5edc

commit r16-9470-g8491b800473971ba1c03e74866273cb8dcaa5edc
Author: Patrick Palka <[email protected]>
Date:   Thu Jul 30 21:18:38 2026 -0400

    c++: resolvedness of resolve_nondeduced_context result [PR126406]

    In r16-5967-gbae0ed69e1862a we removed the mark_used call from
    resolve_nondeduced_context under the rationale that it should be
    the caller's responsiblity to mark_used.

    Removing the call however now means that resolve_nondeduced_context
    could return a specialization whose type is not yet fully resolved
    (i.e. has an uninstantiated noexcept or undeduced return type), and
    callers that immediately inspect TREE_TYPE of the result (such as
    standard_conversion and build_conditional_expr) now misbehave.

    In light of such callers, this patch reverts r16-5967; it's not
    necessary to fix PR119343 because after r16-6276 convert_to_void
    now properly propagates an error_mark_node result from
    resolve_nondeduced_context.

            PR c++/126406
            PR c++/119343

    gcc/cp/ChangeLog:

            * pt.cc (resolve_nondeduced_context): Revert r16-5967 change.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp0x/cond2a.C: New test.
            * g++.dg/cpp1y/auto-fn67.C: New test.
            * g++.dg/cpp1z/noexcept-type29.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>
    (cherry picked from commit e873aac49eb2b58ae18e05f4150826278bdbb3cb)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.