Commit 77fa3ec1 by Nathan Sidwell Committed by Nathan Sidwell

call.c (make_temporary_var_for_ref_to_temp): Push decl into current scope.

	* call.c (make_temporary_var_for_ref_to_temp): Push decl into
	current scope.
	* lex.c (unqualified_name_lookup_error): Likewise.

From-SVN: r247645
parent 7187a6c8
2017-05-05 Nathan Sidwell <nathan@acm.org> 2017-05-05 Nathan Sidwell <nathan@acm.org>
* call.c (make_temporary_var_for_ref_to_temp): Push decl into
current scope.
* lex.c (unqualified_name_lookup_error): Likewise.
* class.c (alter_class): Use retrofit_lang_decl directly. * class.c (alter_class): Use retrofit_lang_decl directly.
* decl.c (push_local_name, dupliate_decls): Likewise. * decl.c (push_local_name, dupliate_decls): Likewise.
* semantics.c (omp_privatize_field): Likewise. * semantics.c (omp_privatize_field): Likewise.
......
...@@ -10234,10 +10234,7 @@ perform_direct_initialization_if_possible (tree type, ...@@ -10234,10 +10234,7 @@ perform_direct_initialization_if_possible (tree type,
tree tree
make_temporary_var_for_ref_to_temp (tree decl, tree type) make_temporary_var_for_ref_to_temp (tree decl, tree type)
{ {
tree var; tree var = create_temporary_var (type);
/* Create the variable. */
var = create_temporary_var (type);
/* Register the variable. */ /* Register the variable. */
if (VAR_P (decl) if (VAR_P (decl)
...@@ -10245,15 +10242,16 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type) ...@@ -10245,15 +10242,16 @@ make_temporary_var_for_ref_to_temp (tree decl, tree type)
{ {
/* Namespace-scope or local static; give it a mangled name. */ /* Namespace-scope or local static; give it a mangled name. */
/* FIXME share comdat with decl? */ /* FIXME share comdat with decl? */
tree name;
TREE_STATIC (var) = TREE_STATIC (decl); TREE_STATIC (var) = TREE_STATIC (decl);
CP_DECL_THREAD_LOCAL_P (var) = CP_DECL_THREAD_LOCAL_P (decl); CP_DECL_THREAD_LOCAL_P (var) = CP_DECL_THREAD_LOCAL_P (decl);
set_decl_tls_model (var, DECL_TLS_MODEL (decl)); set_decl_tls_model (var, DECL_TLS_MODEL (decl));
name = mangle_ref_init_variable (decl);
tree name = mangle_ref_init_variable (decl);
DECL_NAME (var) = name; DECL_NAME (var) = name;
SET_DECL_ASSEMBLER_NAME (var, name); SET_DECL_ASSEMBLER_NAME (var, name);
var = pushdecl_top_level (var);
var = pushdecl (var);
} }
else else
/* Create a new cleanup level if necessary. */ /* Create a new cleanup level if necessary. */
......
...@@ -447,13 +447,9 @@ unqualified_name_lookup_error (tree name, location_t loc) ...@@ -447,13 +447,9 @@ unqualified_name_lookup_error (tree name, location_t loc)
this NAME in the innermost block scope. */ this NAME in the innermost block scope. */
if (local_bindings_p ()) if (local_bindings_p ())
{ {
tree decl; tree decl = build_decl (loc, VAR_DECL, name, error_mark_node);
decl = build_decl (loc, VAR_DECL, name, error_mark_node); TREE_USED (decl) = true;
DECL_CONTEXT (decl) = current_function_decl; pushdecl (decl);
push_local_binding (name, decl, 0);
/* Mark the variable as used so that we do not get warnings
about it being unused later. */
TREE_USED (decl) = 1;
} }
} }
......
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