2014-12-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58650
* parser.c (cp_parser_member_declaration): Fix error recovery for
initialized non-static data member declared friend.
/testsuite
2014-12-16 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58650
* g++.dg/parse/friend12.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218801
138bc75d-0d04-0410-961f-
82ee72b054a4
+2014-12-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58650
+ * parser.c (cp_parser_member_declaration): Fix error recovery for
+ initialized non-static data member declared friend.
+
2014-12-15 Jan Hubicka <hubicka@ucw.cz>
* decl2.c (decl_needed_p): When not optimizing, do not consider external
if (decl)
{
/* Add DECL to the list of members. */
- if (!friend_p)
+ if (!friend_p
+ /* Explicitly include, eg, NSDMIs, for better error
+ recovery (c++/58650). */
+ || !DECL_DECLARES_FUNCTION_P (decl))
finish_member_declaration (decl);
if (TREE_CODE (decl) == FUNCTION_DECL)
+2014-12-16 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/58650
+ * g++.dg/parse/friend12.C: New.
+
2014-12-16 Oleg Endo <olegendo@gcc.gnu.org>
PR target/54089
--- /dev/null
+// PR c++/58650
+
+struct A
+{
+ friend int i = 0; // { dg-error "cannot be declared friend" }
+// { dg-error "non-static data member" "" { target { ! c++11 } } 5 }
+};