PR c++/59766
* decl.c (grokdeclarator): Do not flag friends with deduced return.
From-SVN: r222095
+2015-04-14 David Krauss <david_work@me.com>
+
+ PR c++/59766
+ * decl.c (grokdeclarator): Do not flag friends with deduced return.
+
2015-04-14 Momchil Velikov <momchil.velikov@gmail.com>
Jason Merrill <jason@redhat.com>
}
else if (decl_context == FIELD)
{
- if (!staticp && TREE_CODE (type) != METHOD_TYPE
+ if (!staticp && !friendp && TREE_CODE (type) != METHOD_TYPE
&& type_uses_auto (type))
{
error ("non-static data member declared %<auto%>");
--- /dev/null
+// PR c++/59766
+// { dg-do compile { target c++14 } }
+
+struct T {
+ friend auto f() { }
+};