aboutsummaryrefslogtreecommitdiff
path: root/libcpp/files.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2021-02-05 10:36:49 -0500
committerJason Merrill <jason@redhat.com>2021-04-29 14:38:50 -0400
commita0fdff3cf33f72848d3f894272431a5d49fe6a16 (patch)
tree1a9a9a3c4757ea89f59abca94553403318d1f79c /libcpp/files.c
parent58a92b789a77cdade1f41800efebf6e0686f9982 (diff)
downloadgcc-a0fdff3cf33f72848d3f894272431a5d49fe6a16.zip
gcc-a0fdff3cf33f72848d3f894272431a5d49fe6a16.tar.gz
gcc-a0fdff3cf33f72848d3f894272431a5d49fe6a16.tar.bz2
c++: Fix friend attributes [PR51344]
51344 was a problem with calling save_template_attributes twice for the same friend function: once from do_friend and once from grokmethod. The 2012 patch for the bug avoided creating an infinite loop when this happens, but it's better to avoid the duplication in the first place. This also restores the dependent attributes to the beginning of the attribute list, as originally intended. And then apply_late_template_attributes can avoid copying the non-dependent attributes. gcc/cp/ChangeLog: PR c++/51344 * decl2.c (grokfield): Call cplus_decl_attributes for friend. (save_template_attributes): Use chainon. * friend.c (do_friend): Remove attrlist parm. * cp-tree.h (do_friend): Adjust. * class.c (add_implicitly_declared_members): Adjust. * decl.c (grokdeclarator): Adjust. * pt.c (apply_late_template_attributes): Optimize.
Diffstat (limited to 'libcpp/files.c')
0 files changed, 0 insertions, 0 deletions