Commit ab085207 by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/3543 (gcc-3.0 Internal error #56 in resolve_offset_ref, at cp/init.c:1963)

cp:
	PR c++/3543
	* typeck.c (condition_conversion): Resolve an OFFSET_REF.
	* expr.c (cplus_expand_expr): An OFFSET_REF should never get here.
testsuite:
	* g++.old-deja/g++.other/optimize4.C: New test.

From-SVN: r44340
parent 0abe00c5
2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
PR c++/3543
* typeck.c (condition_conversion): Resolve an OFFSET_REF.
* expr.c (cplus_expand_expr): An OFFSET_REF should never get here.
2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
* class.c (build_vtbl_or_vbase_field): Remove, move into ...
(create_vtbl_ptr): ... here.
......
......@@ -105,9 +105,10 @@ cplus_expand_expr (exp, target, tmode, modifier)
target, tmode, modifier);
case OFFSET_REF:
return expand_expr (default_conversion (resolve_offset_ref (exp)),
target, tmode, EXPAND_NORMAL);
/* Offset refs should not make it through to here. */
my_friendly_abort (20010724);
return const0_rtx;
case THROW_EXPR:
expand_expr (TREE_OPERAND (exp, 0), const0_rtx, VOIDmode, 0);
return NULL;
......
......@@ -4331,6 +4331,8 @@ condition_conversion (expr)
tree t;
if (processing_template_decl)
return expr;
if (TREE_CODE (expr) == OFFSET_REF)
expr = resolve_offset_ref (expr);
t = perform_implicit_conversion (boolean_type_node, expr);
t = fold (build1 (CLEANUP_POINT_EXPR, boolean_type_node, t));
return t;
......
2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/optimize4.C: New test.
2001-07-25 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.abi/vbase8-5.C: New test.
2001-07-24 Jason Merrill <jason_merrill@redhat.com>
......
// Build don't link:
//
// Copyright (C) 2001 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 24 Jul 2001 <nathan@codesourcery.com>
// Bug 3543. We forgot to resolve an OFFSET_REF
struct Writeable {
bool blocking_mode;
};
struct Pipe : Writeable {
void ewrite();
void set_write_blocking ()
{
if (Writeable::blocking_mode);
}
};
void Pipe::ewrite()
{
set_write_blocking();
}
void ewrite(Pipe &p)
{
p.set_write_blocking();
}
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