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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <[email protected]>:

https://gcc.gnu.org/g:41006b6da54d2fd1b8e5fd81018a1ad6f61183d8

commit r17-1726-g41006b6da54d2fd1b8e5fd81018a1ad6f61183d8
Author: Jason Merrill <[email protected]>
Date:   Sat Jun 20 18:23:09 2026 -0400

    c++: typedef in lambda in pack expansion

    In trying to reduce the testcase for PR125408, I came across an older
    regression, dating back to r14-9938, though the problem wasn't in that
    commit.

    cp_walk_subtrees avoids walking into uses of typedefs because it wants to
    look at what's actually written.  But here we were also skipping over the
    definition of the typedef, so extract_locals_r never got to see the use of
    't', so later substitution failed.

    Fixed by specifically handling typedef DECL_EXPR.

            PR c++/125408

    gcc/cp/ChangeLog:

            * tree.cc (cp_walk_subtrees): Walk into the DECL_ORIGINAL_TYPE of a
            typedef DECL_EXPR.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/lambda-targ33.C: New test.

Reply via email to