From: Jason Merrill Date: Fri, 21 Feb 2014 15:29:32 +0000 (-0500) Subject: re PR c++/60216 ([c++11] Trouble with deleted template functions) X-Git-Tag: releases/gcc-4.8.3~328 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf757b6be8fced577196132336e2cfab27540b67;p=thirdparty%2Fgcc.git re PR c++/60216 ([c++11] Trouble with deleted template functions) PR c++/60216 * pt.c (register_specialization): Copy DECL_DELETED_FN to clones. From-SVN: r208008 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index da19925f76f5..51bb21df7028 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-02-21 Jason Merrill + 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 e6e98a4e1aa1..b63b3d9cab19 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 000000000000..67836773af34 --- /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 A(T) = delete; +}; + +template<> A::A(int) {} + +A a(0);