/cp
2018-02-19 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84348
* decl.c (grokdeclarator): Early return error_mark_node upon
ill-formed friend declaration.
/testsuite
2018-02-19 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/84348
* g++.dg/cpp0x/auto50.C: New.
* g++.dg/parse/friend12.C: Adjust.
From-SVN: r257802
+2018-02-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/84348
+ * decl.c (grokdeclarator): Early return error_mark_node upon
+ ill-formed friend declaration.
+
2018-02-16 Marek Polacek <polacek@redhat.com>
Jakub Jelinek <jakub@redhat.com>
{
error ("%qE is neither function nor member function; "
"cannot be declared friend", unqualified_id);
- friendp = 0;
+ return error_mark_node;
}
decl = NULL_TREE;
}
+2018-02-19 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/84348
+ * g++.dg/cpp0x/auto50.C: New.
+ * g++.dg/parse/friend12.C: Adjust.
+
2018-02-18 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/84389
--- /dev/null
+// PR c++/84348
+// { dg-do compile { target c++11 } }
+
+template<typename> struct A
+{
+ friend auto foo; // { dg-error "cannot be declared friend" }
+};
struct A
{
friend int i = 0; // { dg-error "cannot be declared friend" }
-// { dg-error "non-static data member" "" { target { ! c++11 } } .-1 }
};