Commit 863a3314 by Nathan Sidwell Committed by Nathan Sidwell

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
parent b9a66240
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
......
......@@ -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;
......
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
......
// 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);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment