tree.c (bot_manip): Set DECL_CONTEXT for newly created VAR_DECLs.

* tree.c (bot_manip): Set DECL_CONTEXT for newly created
	VAR_DECLs.

From-SVN: r31498
This commit is contained in:
Mark Mitchell 2000-01-19 09:04:41 +00:00 committed by Mark Mitchell
parent 1455913a0b
commit 301e21af2c
3 changed files with 30 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2000-01-19 Mark Mitchell <mark@codesourcery.com>
* tree.c (bot_manip): Set DECL_CONTEXT for newly created
VAR_DECLs.
2000-01-18 Nathan Sidwell <sidwell@codesourcery.com>
* cp-tree.h (get_tinfo_fn_dynamic): Remove prototype.

View File

@ -1560,9 +1560,13 @@ bot_manip (tp, walk_subtrees, data)
}
else
{
tree var;
u = copy_node (t);
TREE_OPERAND (u, 0) = build (VAR_DECL, TREE_TYPE (t));
layout_decl (TREE_OPERAND (u, 0), 0);
var = build (VAR_DECL, TREE_TYPE (t));
DECL_CONTEXT (var) = current_function_decl;
layout_decl (var, 0);
TREE_OPERAND (u, 0) = var;
}
/* Map the old variable to the new one. */

View File

@ -0,0 +1,19 @@
// Build don't link:
// Special g++ Options: -O2
// Origin: Mark Mitchell <mark@codesourcery.com>
struct S
{
};
void f (S s = S ());
inline void g ()
{
f ();
}
void h ()
{
g ();
}