https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125408
--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Jason Merrill <[email protected]>: https://gcc.gnu.org/g:7114c0aad21a16075febb0cce1d64bda9d4a8dbb commit r16-9154-g7114c0aad21a16075febb0cce1d64bda9d4a8dbb Author: Jason Merrill <[email protected]> Date: Tue Jun 23 08:07:54 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. (cherry picked from commit 41006b6da54d2fd1b8e5fd81018a1ad6f61183d8)
