Commit 18f73c5f by Jason Merrill Committed by Jason Merrill

PR c++/79519 - ICE with deleted template friend.

	* decl.c (grokdeclarator): Complain about misplaced function
	definition using =, as well.

From-SVN: r246291
parent c34923c4
2017-03-20 Jason Merrill <jason@redhat.com>
PR c++/79519 - ICE with deleted template friend.
* decl.c (grokdeclarator): Complain about misplaced function
definition using =, as well.
PR c++/79640 - infinite recursion with generic lambda.
* pt.c (tsubst_copy) [VAR_DECL]: Register the dummy instantiation
before substituting its initializer.
......
......@@ -11365,9 +11365,9 @@ grokdeclarator (const cp_declarator *declarator,
else if (TREE_CODE (type) == FUNCTION_TYPE)
{
if (current_class_type
&& (!friendp || funcdef_flag))
&& (!friendp || funcdef_flag || initialized))
{
error (funcdef_flag
error (funcdef_flag || initialized
? G_("cannot define member function %<%T::%s%> "
"within %<%T%>")
: G_("cannot declare member function %<%T::%s%> "
......
// PR c++/79519
// { dg-do compile { target c++11 } }
struct A
{
template<typename> void foo();
};
struct B
{
template<typename> friend void A::foo() = delete; // { dg-error "" }
};
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