This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH]: Fix bug 2744
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH]: Fix bug 2744
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Wed, 16 May 2001 10:47:45 +0100
- Organization: Codesourcery LLC
Hi,
I've installed this obvious patch on both branch and mainline. It fixes
regression 2744 where we ICE'd on finding an unexpected thing cpplib
tokenized.
boothed & tested on i686-pc-linux-gnu.
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2001-05-10 Nathan Sidwell <nathan@codesourcery.com>
* spew.c (read_token): Call yyerror on all unexpected tokens.
Index: cp/spew.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/spew.c,v
retrieving revision 1.47
diff -c -3 -p -r1.47 spew.c
*** spew.c 2001/05/01 10:53:09 1.47
--- spew.c 2001/05/10 08:01:55
***************
*** 1,6 ****
/* Type Analyzer for GNU C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
! 1999, 2000 Free Software Foundation, Inc.
Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com)
This file is part of GNU CC.
--- 1,6 ----
/* Type Analyzer for GNU C++.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
! 1999, 2000, 2001 Free Software Foundation, Inc.
Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com)
This file is part of GNU CC.
*************** read_token (t)
*** 353,366 ****
t->yychar = STRING;
break;
- /* These tokens should not survive translation phase 4. */
- case CPP_HASH:
- case CPP_PASTE:
- error ("syntax error before '#' token");
- goto retry;
-
default:
! abort ();
}
t->lineno = lineno;
--- 353,361 ----
t->yychar = STRING;
break;
default:
! yyerror ("parse error");
! goto retry;
}
t->lineno = lineno;
// Build don't link:
//
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 8 May 2001 <nathan@codesourcery.com>
// Bug 2744. We ICE'd on strange characters
@ // ERROR - parse error
int a; #// ERROR - parse error
## // ERROR - parse error
$ // ERROR - parse error
£ // ERROR - parse error
` // ERROR - parse error