Commit 5089de93 by Mark Mitchell Committed by Mark Mitchell

re PR c++/8720 (ICE with bitwise or (3 operands))

	PR c++/8720
	* spew.c (remove_last_token): Make sure that last_chunk is set
	correctly.

	PR c++/8615
	* error.c (dump_expr): Handle character constants with
	TREE_OVERFLOW set.

	PR c++/8720
	* g++.dg/parse/defarg1.C: New test.

	PR c++/8615
	* g++.dg/template/char1.C: New test.

From-SVN: r59757
parent 35e058a2
2002-12-02 Mark Mitchell <mark@codesourcery.com>
PR c++/8720
* spew.c (remove_last_token): Make sure that last_chunk is set
correctly.
PR c++/8615
* error.c (dump_expr): Handle character constants with
TREE_OVERFLOW set.
2002-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2002-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
DR 180 DR 180
......
...@@ -1473,7 +1473,10 @@ dump_expr (t, flags) ...@@ -1473,7 +1473,10 @@ dump_expr (t, flags)
else if (type == char_type_node) else if (type == char_type_node)
{ {
output_add_character (scratch_buffer, '\''); output_add_character (scratch_buffer, '\'');
dump_char (tree_low_cst (t, 0)); if (host_integerp (t, TREE_UNSIGNED (type)))
dump_char (tree_low_cst (t, TREE_UNSIGNED (type)));
else
output_printf (scratch_buffer, "\\x%x", TREE_INT_CST_LOW (t));
output_add_character (scratch_buffer, '\''); output_add_character (scratch_buffer, '\'');
} }
else else
......
...@@ -1042,11 +1042,13 @@ remove_last_token (t) ...@@ -1042,11 +1042,13 @@ remove_last_token (t)
t->last_pos--; t->last_pos--;
if (t->last_pos == 0 && t->last_chunk != t->tokens) if (t->last_pos == 0 && t->last_chunk != t->tokens)
{ {
struct token_chunk **tc; struct token_chunk *c;
for (tc = &t->tokens; (*tc)->next != NULL; tc = &(*tc)->next) c = t->tokens;
; while (c->next != t->last_chunk)
*tc = NULL; c = c->next;
t->last_pos = ARRAY_SIZE ((*tc)->toks); c->next = NULL;
t->last_chunk = c;
t->last_pos = ARRAY_SIZE (c->toks);
} }
return result; return result;
} }
......
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
2002-12-02 Mark Mitchell <mark@codesourcery.com> 2002-12-02 Mark Mitchell <mark@codesourcery.com>
PR c++/8720
* g++.dg/parse/defarg1.C: New test.
PR c++/8615
* g++.dg/template/char1.C: New test.
* g++.dg/template/varmod1.C: Fix typo. * g++.dg/template/varmod1.C: Fix typo.
2002-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> 2002-12-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
......
class A
{
public:
A(int nBits = ((int)0x8) | ((int)0x4) | ((int)0x2));
};
template <class CharType, CharType line_terminator = 0>
class String {};
String<char, 255> s;
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