--- gcc/cp/spew.c 2018/04/24 18:20:22 1.1.1.1 +++ gcc/cp/spew.c 2018/04/24 18:27:14 1.1.1.2 @@ -1,5 +1,5 @@ /* Type Analyzer for GNU C++. - Copyright (C) 1987, 1989, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 1987, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com) This file is part of GNU CC. @@ -16,7 +16,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* This file is the type analyzer for GNU C++. To debug it, define SPEW_DEBUG @@ -242,6 +243,14 @@ int looking_for_template; extern struct obstack *current_obstack, *saveable_obstack; tree got_scope; +tree got_object; + +int +peekyylex() +{ + scan_tokens (0); + return nth_token (0)->yychar; +} int yylex() @@ -316,7 +325,7 @@ yylex() if (lastiddecl != trrr) { lastiddecl = trrr; - if (got_scope) + if (got_scope || got_object) tmp_token.yylval.ttype = DECL_NESTED_TYPENAME (trrr); } break; @@ -326,6 +335,11 @@ yylex() case PTYPENAME: lastiddecl = NULL_TREE; break; + case NSNAME: + lastiddecl = trrr; + if (got_scope || got_object) + tmp_token.yylval.ttype = trrr; + break; default: my_friendly_abort (101); } @@ -334,8 +348,11 @@ yylex() lastiddecl = trrr; got_scope = NULL_TREE; /* and fall through to... */ + case IDENTIFIER_DEFN: case TYPENAME: + case TYPENAME_DEFN: case PTYPENAME: + case PTYPENAME_DEFN: consume_token (); if (looking_for_typename > 0) looking_for_typename--;