From df8dfb05507eb871736cafc9715cd020a52ab760 Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 16 May 2001 09:37:21 +0000 Subject: [PATCH] cp: * spew.c (read_token): Call yyerror on all unexpected tokens. testsuite: * g++.old-deja/g++.other/crash41.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@42143 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/spew.c | 11 +++-------- gcc/testsuite/ChangeLog | 8 ++++++-- gcc/testsuite/g++.old-deja/g++.other/crash41.C | 13 +++++++++++++ 4 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/crash41.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a739534..06e64a5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2001-05-16 Nathan Sidwell + * spew.c (read_token): Call yyerror on all unexpected tokens. + +2001-05-16 Nathan Sidwell + * init.c (member_init_ok_or_else): Take a tree rather than string for name. (expand_member_init): Adjust. diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c index 4a230f0..7b88757 100644 --- a/gcc/cp/spew.c +++ b/gcc/cp/spew.c @@ -1,6 +1,6 @@ /* Type Analyzer for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000 Free Software Foundation, Inc. + 1999, 2000, 2001 Free Software Foundation, Inc. Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com) This file is part of GNU CC. @@ -353,14 +353,9 @@ read_token (t) 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 (); + yyerror ("parse error"); + goto retry; } t->lineno = lineno; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9793562..ffe5ab5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,7 +1,11 @@ 2001-05-16 Nathan Sidwell - * g++.pt/inherit2.C: Remove XFAIL. - * g++.pt/crash66.C: New test. + * g++.old-deja/g++.other/crash41.C: New test. + +2001-05-16 Nathan Sidwell + + * g++.old-deja/g++.pt/inherit2.C: Remove XFAIL. + * g++.old-deja/g++.pt/crash66.C: New test. 2001-05-15 Benjamin Kosnik diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash41.C b/gcc/testsuite/g++.old-deja/g++.other/crash41.C new file mode 100644 index 0000000..7043450 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/crash41.C @@ -0,0 +1,13 @@ +// Build don't link: +// +// Copyright (C) 2001 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 8 May 2001 + +// 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 -- 2.7.4