aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2019-05-28 17:04:12 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2019-05-28 17:04:12 +0000
commita01d3b0481fe250079e730eb20cd534d6f52ff73 (patch)
tree0156579df96c083405c2eb0e2e05a13f8b2b3640 /gcc
parentde1644122d0ad0a727042089083595cdfa99815f (diff)
downloadgcc-a01d3b0481fe250079e730eb20cd534d6f52ff73.zip
gcc-a01d3b0481fe250079e730eb20cd534d6f52ff73.tar.gz
gcc-a01d3b0481fe250079e730eb20cd534d6f52ff73.tar.bz2
[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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 36a415d..0552d91 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+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.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 5b22f65..2bb50e4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -2025,9 +2025,10 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
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);