https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122789
--- Comment #3 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:dabaca84b2bce49d2c5e9c98f88cf13ea61a7604 commit r15-10552-gdabaca84b2bce49d2c5e9c98f88cf13ea61a7604 Author: Nathaniel Shead <[email protected]> Date: Sun Nov 23 23:24:39 2025 +1100 c++/modules: Stream all REQUIRES_EXPR_PARMS [PR122789] We don't generally stream the TREE_CHAIN of a DECL, as this would cause us to unnecessarily walk into the next member in its scope chain any time it was referenced by an expression. Unfortunately, REQUIRES_EXPR_PARMS is a tree chain of PARM_DECLs, so we were only ever streaming the first parameter. This meant that when a parameter's type could not be tsubst'd we would ICE instead of returning false. This patch special-cases REQUIRES_EXPR to always stream the chain of decls in its first operand. As a drive-by improvement we also remove a fixme about checking uncontexted PARM_DECLs. PR c++/122789 gcc/cp/ChangeLog: * module.cc (trees_out::core_vals): Treat REQUIRES_EXPR specially and stream the chained decls of its first operand. (trees_in::core_vals): Likewise. (trees_out::tree_node): Check the PARM_DECLs we see are what we expect. gcc/testsuite/ChangeLog: * g++.dg/modules/concept-12_a.C: New test. * g++.dg/modules/concept-12_b.C: New test. Signed-off-by: Nathaniel Shead <[email protected]> Reviewed-by: Jason Merrill <[email protected]> (cherry picked from commit 53b4e1d951eaf5bbb2fcedfdd156d80a4160878a)
