+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>
PR c++/90548 - ICE with generic lambda and empty pack.
tree old_result = DECL_TEMPLATE_RESULT (olddecl);
tree new_result = DECL_TEMPLATE_RESULT (newdecl);
TREE_TYPE (olddecl) = TREE_TYPE (old_result);
- DECL_TEMPLATE_SPECIALIZATIONS (olddecl)
- = chainon (DECL_TEMPLATE_SPECIALIZATIONS (olddecl),
- DECL_TEMPLATE_SPECIALIZATIONS (newdecl));
+
+ /* The new decl should not already have gathered any
+ specializations. */
+ gcc_assert (!DECL_TEMPLATE_SPECIALIZATIONS (newdecl));
DECL_ATTRIBUTES (old_result)
= (*targetm.merge_decl_attributes) (old_result, new_result);