The
r12-299-ga0fdff3cf33f7284 change can result in cplus_decl_attributes being called
even if there are no late attributes (but at least one early attribute) in
apply_late_template_attributes. This patch fixes that, so that we return early
if there are no late attrs, only arrange for TYPE_ATTRIBUTES to get the early
attribute list.
2021-11-25 Jakub Jelinek <jakub@redhat.com>
PR c++/101180
* pt.c (apply_late_template_attributes): Return early if there are no
dependent attributes.
/* Apply any non-dependent attributes. */
*p = nondep;
+ if (nondep == attributes)
+ return true;
+
/* And then any dependent ones. */
tree late_attrs = NULL_TREE;
tree *q = &late_attrs;