re PR c++/22454 (ICE with operator in default argument in template class)

cp:
	PR c++/22454
	* parser.c (cp_lexer_peek_nth_token): Relax assert.
testsuite:
	PR c++/22454
	* g++.dg/parse/crash29.C: New.

From-SVN: r103438
This commit is contained in:
Nathan Sidwell 2005-08-24 10:21:46 +00:00 committed by Nathan Sidwell
parent b9a6624012
commit 863a331486
4 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-08-24 Nathan Sidwell <nathan@codesourcery.com>
PR c++/22454
* parser.c (cp_lexer_peek_nth_token): Relax assert.
2005-08-23 Nathan Sidwell <nathan@codesourcery.com>
PR c++/23044

View File

@ -497,14 +497,15 @@ cp_lexer_peek_nth_token (cp_lexer* lexer, size_t n)
cp_token *token;
/* N is 1-based, not zero-based. */
gcc_assert (n > 0 && lexer->next_token != &eof_token);
gcc_assert (n > 0);
if (cp_lexer_debugging_p (lexer))
fprintf (cp_lexer_debug_stream,
"cp_lexer: peeking ahead %ld at token: ", (long)n);
--n;
token = lexer->next_token;
gcc_assert (!n || token != &eof_token);
while (n != 0)
{
++token;

View File

@ -1,3 +1,8 @@
2005-08-24 Nathan Sidwell <nathan@codesourcery.com>
PR c++/22454
* g++.dg/parse/crash29.C: New.
2005-08-23 DJ Delorie <dj@redhat.com>
* gcc.c-torture/execute/stdarg-2.c (main): Make sure long

View File

@ -0,0 +1,10 @@
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 23 Aug 2005 <nathan@codesourcery.com>
// PR 22454: ICE
// Origin: Volker Reichelt reichelt@gcc.gnu.org
template<int> struct A
{
A(void* = &operator new);
};