aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2014-02-21 15:29:32 +0000
committerJason Merrill <jason@redhat.com>2014-02-21 15:29:32 +0000
commitcc9692fe30c0a227325a211939d0040ca85d5263 (patch)
tree7ab7bdff5ec5e8e5271fd8deea1550cda6ac5070
parent01f5ebd5a74c42c5978b3010713a3c9715ecfd69 (diff)
PR c++/60216
* pt.c (register_specialization): Copy DECL_DELETED_FN to clones. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@208008 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog3
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/deleted3.C11
3 files changed, 16 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index da19925f76f..51bb21df702 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,8 @@
2014-02-21 Jason Merrill <jason@redhat.com>
+ PR c++/60216
+ * pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
+
PR c++/60219
* pt.c (coerce_template_parms): Bail if argument packing fails.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e6e98a4e1aa..b63b3d9cab1 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -1419,6 +1419,8 @@ register_specialization (tree spec, tree tmpl, tree args, bool is_friend,
= DECL_DECLARED_INLINE_P (fn);
DECL_SOURCE_LOCATION (clone)
= DECL_SOURCE_LOCATION (fn);
+ DECL_DELETED_FN (clone)
+ = DECL_DELETED_FN (fn);
}
check_specialization_namespace (tmpl);
diff --git a/gcc/testsuite/g++.dg/cpp0x/deleted3.C b/gcc/testsuite/g++.dg/cpp0x/deleted3.C
new file mode 100644
index 00000000000..67836773af3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/deleted3.C
@@ -0,0 +1,11 @@
+// PR c++/60216
+// { dg-require-effective-target c++11 }
+
+struct A
+{
+ template<typename T> A(T) = delete;
+};
+
+template<> A::A<int>(int) {}
+
+A a(0);