* decl.c (grokdeclarator): Complain about misplaced function
definition using =, as well.
From-SVN: r246291
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.
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%> "
--- /dev/null
+// 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 "" }
+};