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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Nathaniel Shead
<[email protected]>:

https://gcc.gnu.org/g:16d6b7697bee48bfcc88b0fd235f0fa8be1e5bcf

commit r15-11049-g16d6b7697bee48bfcc88b0fd235f0fa8be1e5bcf
Author: Nathaniel Shead <[email protected]>
Date:   Sat Apr 4 23:55:16 2026 +1100

    c++/modules: Handle importing an undeduced auto over a deduced auto
[PR124735]

    Like with implicit constexpr, we need to handle cases where we import an
    function declaration with undeduced auto, but we already have a
    definition available with deduced auto.  In this case we can just keep
    the existing declaration's type.

            PR c++/124735

    gcc/cp/ChangeLog:

            * module.cc (trees_in::is_matching_decl): Handle importing
            undeduced auto when existing is already deduced.

    gcc/testsuite/ChangeLog:

            * g++.dg/modules/auto-8_a.H: New test.
            * g++.dg/modules/auto-8_b.C: New test.

    Signed-off-by: Nathaniel Shead <[email protected]>
    Reviewed-by: Jason Merrill <[email protected]>
    (cherry picked from commit ab169d27ea39bf828378d2bf08ebd27712842caf)

Reply via email to