Commit a01d3b04 by Nathan Sidwell Committed by Nathan Sidwell

[C++ PATCH] template specializations

https://gcc.gnu.org/ml/gcc-patches/2019-05/msg01844.html
	* decl.c (duplicate_decls): Assert a template newdecl has no
	specializations.

From-SVN: r271713
parent de164412
2019-05-28 Nathan Sidwell <nathan@acm.org>
* decl.c (duplicate_decls): Assert a template newdecl has no
specializations.
2019-05-28 Marek Polacek <polacek@redhat.com> 2019-05-28 Marek Polacek <polacek@redhat.com>
PR c++/90548 - ICE with generic lambda and empty pack. PR c++/90548 - ICE with generic lambda and empty pack.
......
...@@ -2025,9 +2025,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend) ...@@ -2025,9 +2025,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
tree old_result = DECL_TEMPLATE_RESULT (olddecl); tree old_result = DECL_TEMPLATE_RESULT (olddecl);
tree new_result = DECL_TEMPLATE_RESULT (newdecl); tree new_result = DECL_TEMPLATE_RESULT (newdecl);
TREE_TYPE (olddecl) = TREE_TYPE (old_result); TREE_TYPE (olddecl) = TREE_TYPE (old_result);
DECL_TEMPLATE_SPECIALIZATIONS (olddecl)
= chainon (DECL_TEMPLATE_SPECIALIZATIONS (olddecl), /* The new decl should not already have gathered any
DECL_TEMPLATE_SPECIALIZATIONS (newdecl)); specializations. */
gcc_assert (!DECL_TEMPLATE_SPECIALIZATIONS (newdecl));
DECL_ATTRIBUTES (old_result) DECL_ATTRIBUTES (old_result)
= (*targetm.merge_decl_attributes) (old_result, new_result); = (*targetm.merge_decl_attributes) (old_result, new_result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment