Commit 86c0810c by Jason Merrill Committed by Jason Merrill

DR 941

	DR 941
	* decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
	template specializations.

From-SVN: r198098
parent f6b64c35
2013-04-19 Jason Merrill <jason@redhat.com>
DR 941
* decl.c (duplicate_decls): Don't propagate DECL_DELETED_FN to
template specializations.
2013-04-16 Ed Smith-Rowland <3dw4rd@verizon.net>
Implement n3599 - Literal operator templates for strings.
......
......@@ -1764,12 +1764,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. */
......
// DR 941
// { dg-require-effective-target c++11 }
template <class T> T f(T) = delete;
template<> int f(int) { return 42; }
int main()
{
f(42);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment