aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2021-11-25 08:39:35 +0100
committerJakub Jelinek <jakub@redhat.com>2021-11-25 08:39:35 +0100
commit8e86218f05c1a866b43ae5af3e303f91fb6d7ff0 (patch)
treef8ba6c3713fe7158cd60bea725394307baac6472 /gcc
parentb38c9cf6d570f6c4c1109e00c8b81d82d0f24df3 (diff)
downloadgcc-8e86218f05c1a866b43ae5af3e303f91fb6d7ff0.zip
gcc-8e86218f05c1a866b43ae5af3e303f91fb6d7ff0.tar.gz
gcc-8e86218f05c1a866b43ae5af3e303f91fb6d7ff0.tar.bz2
c++: Return early in apply_late_template_attributes if there are no late attribs [PR101180]
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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/pt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 49e5745..221628a 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -11712,6 +11712,9 @@ apply_late_template_attributes (tree *decl_p, tree attributes, int attr_flags,
/* 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;