* spew.c (yylex): Correct handling of friends.

From-SVN: r39990
This commit is contained in:
Mark Mitchell 2001-02-23 02:33:03 +00:00 committed by Mark Mitchell
parent 515edc9bf8
commit 25200ab2eb
3 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,7 @@
2001-02-22 Mark Mitchell <mark@codesourcery.com>
* spew.c (yylex): Correct handling of friends.
2001-02-22 Mark Mitchell <mark@codesourcery.com>
* mangle.c (write_encoding): Pass write_function_type the

View File

@ -719,6 +719,8 @@ yylex ()
{
int yychr;
int old_looking_for_typename = 0;
int just_saw_new = 0;
int just_saw_friend = 0;
timevar_push (TV_LEX);
@ -804,13 +806,13 @@ yylex ()
}
/* do_aggr needs to know if the previous token was `friend'. */
else if (nth_token (0)->yylval.ttype == ridpointers[RID_FRIEND])
after_friend = 1;
just_saw_friend = 1;
break;
case NEW:
/* do_aggr needs to know if the previous token was `new'. */
after_new = 1;
just_saw_new = 1;
break;
case TYPESPEC:
@ -824,7 +826,6 @@ yylex ()
case AGGR:
do_aggr ();
after_friend = after_new = 0;
break;
case ENUM:
@ -836,6 +837,9 @@ yylex ()
break;
}
after_friend = just_saw_friend;
after_new = just_saw_new;
/* class member lookup only applies to the first token after the object
expression, except for explicit destructor calls. */
if (yychr != '~')

View File

@ -0,0 +1,12 @@
// Build don't link:
// Origin: robt@flyingpig.com
class Outer
{
friend void f1();
class Inner2;
};
class Outer::Inner2
{
};