aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 99b8bcbee15..ea1ebc26dfe 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -6429,10 +6429,7 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
tree var;
/* Create the variable. */
- var = build_decl (VAR_DECL, NULL_TREE, type);
- DECL_ARTIFICIAL (var) = 1;
- DECL_IGNORED_P (var) = 1;
- TREE_USED (var) = 1;
+ var = create_temporary_var (type);
/* Register the variable. */
if (TREE_STATIC (decl))
@@ -6447,12 +6444,8 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
var = pushdecl_top_level (var);
}
else
- {
- /* Create a new cleanup level if necessary. */
- maybe_push_cleanup_level (type);
- /* Don't push unnamed temps. Do set DECL_CONTEXT, though. */
- DECL_CONTEXT (var) = current_function_decl;
- }
+ /* Create a new cleanup level if necessary. */
+ maybe_push_cleanup_level (type);
return var;
}