https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116175
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:9426ce98ccb35a43b4f3e8ea14dcbf2f5de5dc48 commit r15-2790-g9426ce98ccb35a43b4f3e8ea14dcbf2f5de5dc48 Author: Jakub Jelinek <ja...@redhat.com> Date: Wed Aug 7 09:48:07 2024 +0200 c++: Fix up handling of dependent (late) attributes on function/method types [PR116175] When working on unsequenced/reproducible attributes, I've noticed that on templates for some attributes decl_attributes isn't called at all, so they are kept in TYPE_ATTRIBUTES without any verification/transformations and also without argument substitution. The following patch fixes that for FUNCTION/METHOD_TYPE attributes. The included testcase ICEs without the pt.cc changes. 2024-08-07 Jakub Jelinek <ja...@redhat.com> PR c++/116175 * pt.cc (apply_late_template_attributes): For function/method types call cp_build_type_attribute_variant on the non-dependent attributes. (rebuild_function_or_method_type): Add ARGS argument. Use apply_late_template_attributes rather than cp_build_type_attribute_variant. (maybe_rebuild_function_decl_type): Add ARGS argument, pass it to rebuild_function_or_method_type. (tsubst_function_decl): Adjust caller. (tsubst_function_type): Adjust rebuild_function_or_method_type caller. * g++.dg/ext/attr-format4.C: New test.