spew.c (yyerror): Cope if yylval.ttype is NULL.
cp: * spew.c (yyerror): Cope if yylval.ttype is NULL. testsuite: * g++.old-deja/g++.other/parse2.C: New test. From-SVN: r37816
This commit is contained in:
parent
eeb753839f
commit
2f3608c33e
@ -1,3 +1,7 @@
|
||||
2000-11-28 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* spew.c (yyerror): Cope if yylval.ttype is NULL.
|
||||
|
||||
2000-11-28 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* decl.c (grokdeclarator): Diagnose undefined template contexts.
|
||||
|
@ -1398,9 +1398,13 @@ yyerror (msgid)
|
||||
|| last_token == CPP_INT
|
||||
|| last_token == CPP_FLOAT)
|
||||
error ("%s before numeric constant", string);
|
||||
else if (last_token == CPP_NAME
|
||||
&& TREE_CODE (yylval.ttype) == IDENTIFIER_NODE)
|
||||
error ("%s before \"%s\"", string, IDENTIFIER_POINTER (yylval.ttype));
|
||||
else if (last_token == CPP_NAME)
|
||||
{
|
||||
if (yylval.ttype && TREE_CODE (yylval.ttype) == IDENTIFIER_NODE)
|
||||
error ("%s before `%s'", string, IDENTIFIER_POINTER (yylval.ttype));
|
||||
else
|
||||
error ("%s before `%c'", string, yychar);
|
||||
}
|
||||
else
|
||||
error ("%s before '%s' token", string, NAME(last_token));
|
||||
error ("%s before `%s' token", string, NAME (last_token));
|
||||
}
|
||||
|
@ -1,3 +1,7 @@
|
||||
2000-11-28 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* g++.old-deja/g++.other/parse2.C: New test.
|
||||
|
||||
2000-11-28 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* g++.old-deja/g++.pt/incomplete1.C: New test.
|
||||
|
11
gcc/testsuite/g++.old-deja/g++.other/parse2.C
Normal file
11
gcc/testsuite/g++.old-deja/g++.other/parse2.C
Normal file
@ -0,0 +1,11 @@
|
||||
// Build don't link:
|
||||
|
||||
// Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
// Contributed by Nathan Sidwell 24 Nov 2000 <nathan@codesourcery.com>
|
||||
|
||||
// Bug 531: We ICEd trying to give a parse error.
|
||||
|
||||
struct X
|
||||
{
|
||||
bool operator (const X &) const; // ERROR - parse error
|
||||
};
|
Loading…
Reference in New Issue
Block a user