aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2013-04-19 16:28:47 +0000
committerJason Merrill <jason@redhat.com>2013-04-19 16:28:47 +0000
commit0f43862e8f520d9ae9d1b40fafcc9b31285f9996 (patch)
tree9a612fcb4d10c020010cf32bc512f31908cc99f3 /gcc/cp
parent69954abec563c09241418e41304012fdfbfb95dc (diff)
DR 941
* decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to template specializations. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@198100 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c12
2 files changed, 14 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index af7fda52754..929b24bb2f9 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-17 Jason Merrill <jason@redhat.com>
+
+ DR 941
+ * decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
+ template specializations.
+
2013-04-15 Jason Merrill <jason@redhat.com>
PR c++/52748
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 82d857dfb06..1c0bc15ecd0 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -1756,12 +1756,16 @@ duplicate_decls (tree newdecl, tree olddecl, bool newdecl_is_friend)
warning (OPT_Wredundant_decls, "previous declaration of %q+D", olddecl);
}
- if (DECL_DELETED_FN (newdecl))
+ if (!(DECL_TEMPLATE_INSTANTIATION (olddecl)
+ && DECL_TEMPLATE_SPECIALIZATION (newdecl)))
{
- error ("deleted definition of %qD", newdecl);
- error ("after previous declaration %q+D", olddecl);
+ if (DECL_DELETED_FN (newdecl))
+ {
+ error ("deleted definition of %qD", newdecl);
+ error ("after previous declaration %q+D", olddecl);
+ }
+ DECL_DELETED_FN (newdecl) |= DECL_DELETED_FN (olddecl);
}
- DECL_DELETED_FN (newdecl) |= DECL_DELETED_FN (olddecl);
}
/* Deal with C++: must preserve virtual function table size. */