PR c++/11553
* parser.c (cp_parser_decl_specifier_seq): Add check for a
duplicate friend decl-specifier.
PR c++/11553
* g++.dg/parse/friend3.C: New test.
From-SVN: r71008
+2003-09-02 Scott Brumbaugh <scottb.lists@verizon.net>
+
+ PR c++/11553
+ * parser.c (cp_parser_decl_specifier_seq): Add check for a
+ duplicate friend decl-specifier.
+
2003-09-02 Mark Mitchell <mark@codesourcery.com>
PR c++/11847
case RID_FRIEND:
/* decl-specifier:
friend */
- friend_p = true;
+ if (friend_p)
+ error ("duplicate `friend'");
+ else
+ friend_p = true;
/* The representation of the specifier is simply the
appropriate TREE_IDENTIFIER node. */
decl_spec = token->value;
+2003-09-02 Scott Brumbaugh <scottb.lists@verizon.net>
+
+ PR c++/11553
+ * g++.dg/parse/friend3.C: New test.
+
2003-09-02 Mark Mitchell <mark@codesourcery.com>
PR c++/11847
--- /dev/null
+// { dg-do compile }
+//
+// PR 11553 catch duplicate friend specifiers
+
+struct S
+{
+ friend friend class C; // { dg-error "duplicate" }
+};
+
+