Skip to content
Snippets Groups Projects
Commit 9426ce98 authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

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  <jakub@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.
parent 2cf89ae8
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment