Commit a3c5267c by Volker Reichelt Committed by Volker Reichelt

re PR c++/15759 (ICE with function pointers)

	PR c++/15759
	* tree.c (bot_manip): Don't call mark_used.

	* g++.dg/other/default4.C: New test.

From-SVN: r111754
parent c92f986f
2006-03-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/15759
* tree.c (bot_manip): Don't call mark_used.
2006-03-02 Mike Stump <mrs@apple.com>
* decl2.c (import_export_decl): Remove redundant call to
......
......@@ -1173,16 +1173,11 @@ bot_manip (tree* tp, int* walk_subtrees, void* data)
tree u;
if (TREE_CODE (TREE_OPERAND (t, 1)) == AGGR_INIT_EXPR)
{
mark_used (TREE_OPERAND (TREE_OPERAND (TREE_OPERAND (t, 1), 0), 0));
u = build_cplus_new
(TREE_TYPE (t), break_out_target_exprs (TREE_OPERAND (t, 1)));
}
u = build_cplus_new
(TREE_TYPE (t), break_out_target_exprs (TREE_OPERAND (t, 1)));
else
{
u = build_target_expr_with_type
(break_out_target_exprs (TREE_OPERAND (t, 1)), TREE_TYPE (t));
}
u = build_target_expr_with_type
(break_out_target_exprs (TREE_OPERAND (t, 1)), TREE_TYPE (t));
/* Map the old variable to the new one. */
splay_tree_insert (target_remap,
......@@ -1197,8 +1192,6 @@ bot_manip (tree* tp, int* walk_subtrees, void* data)
*walk_subtrees = 0;
return NULL_TREE;
}
else if (TREE_CODE (t) == CALL_EXPR)
mark_used (TREE_OPERAND (TREE_OPERAND (t, 0), 0));
/* Make a copy of this node. */
return copy_tree_r (tp, walk_subtrees, NULL);
......
2006-03-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/15759
* g++.dg/other/default4.C: New test.
2005-03-05 Erik Edelmann <eedelman@gcc.gnu.org>
PR fortran/16136
// PR c++/15759
// Origin: Lars Rune Nstdal <larsnostdal@gmail.com>
// Testcase: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// { dg-do run }
extern "C" void abort();
int n = 0;
int f() { return ++n; }
int(&foo1)() = f;
int(*foo2)() = &f;
int(*foo3)() = f;
int bar1(int i = foo1()) { return i; }
int bar2(int i = foo2()) { return i; }
int bar3(int i = foo3()) { return i; }
int bar4(int i = f()) { return i; }
int main()
{
if (bar1() != 1) abort();
if (bar2() != 2) abort();
if (bar3() != 3) abort();
if (bar4() != 4) abort();
return 0;
}
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