mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-06 05:56:53 +08:00
re PR c++/11553 (g++ accepts duplicate 'friend')
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
This commit is contained in:
parent
48c2d88a10
commit
1918facfd1
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -6312,7 +6312,10 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
|
||||
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;
|
||||
|
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
10
gcc/testsuite/g++.dg/parse/friend3.C
Normal file
10
gcc/testsuite/g++.dg/parse/friend3.C
Normal file
@ -0,0 +1,10 @@
|
||||
// { dg-do compile }
|
||||
//
|
||||
// PR 11553 catch duplicate friend specifiers
|
||||
|
||||
struct S
|
||||
{
|
||||
friend friend class C; // { dg-error "duplicate" }
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user