Commit 25200ab2 by Mark Mitchell Committed by Mark Mitchell

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

From-SVN: r39990
parent 515edc9b
2001-02-22 Mark Mitchell <mark@codesourcery.com> 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 * mangle.c (write_encoding): Pass write_function_type the
FUNCTION_DECL for the function being encoded. FUNCTION_DECL for the function being encoded.
(write_function_type): Pass it along to write_bare_function_type. (write_function_type): Pass it along to write_bare_function_type.
......
...@@ -719,6 +719,8 @@ yylex () ...@@ -719,6 +719,8 @@ yylex ()
{ {
int yychr; int yychr;
int old_looking_for_typename = 0; int old_looking_for_typename = 0;
int just_saw_new = 0;
int just_saw_friend = 0;
timevar_push (TV_LEX); timevar_push (TV_LEX);
...@@ -804,13 +806,13 @@ yylex () ...@@ -804,13 +806,13 @@ yylex ()
} }
/* do_aggr needs to know if the previous token was `friend'. */ /* do_aggr needs to know if the previous token was `friend'. */
else if (nth_token (0)->yylval.ttype == ridpointers[RID_FRIEND]) else if (nth_token (0)->yylval.ttype == ridpointers[RID_FRIEND])
after_friend = 1; just_saw_friend = 1;
break; break;
case NEW: case NEW:
/* do_aggr needs to know if the previous token was `new'. */ /* do_aggr needs to know if the previous token was `new'. */
after_new = 1; just_saw_new = 1;
break; break;
case TYPESPEC: case TYPESPEC:
...@@ -824,7 +826,6 @@ yylex () ...@@ -824,7 +826,6 @@ yylex ()
case AGGR: case AGGR:
do_aggr (); do_aggr ();
after_friend = after_new = 0;
break; break;
case ENUM: case ENUM:
...@@ -836,6 +837,9 @@ yylex () ...@@ -836,6 +837,9 @@ yylex ()
break; break;
} }
after_friend = just_saw_friend;
after_new = just_saw_new;
/* class member lookup only applies to the first token after the object /* class member lookup only applies to the first token after the object
expression, except for explicit destructor calls. */ expression, except for explicit destructor calls. */
if (yychr != '~') if (yychr != '~')
......
// Build don't link:
// Origin: robt@flyingpig.com
class Outer
{
friend void f1();
class Inner2;
};
class Outer::Inner2
{
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment