Revert _binding -> _value change.
* name-lookup.h (get_namespace_value, set_global_value): Rename to ... (get_namespace_binding, set_global_binding): ... these. * name-lookup.c (get_namespace_value, set_global_value): Rename to ... (get_namespace_binding, set_global_binding): ... these. (arg_assoc_namespace, pushdecl_maybe_friend_1) check_for_out_of_scope_variable, push_overloaded_decl_1, lookup_name_innermost_nonclass_level, push_namespace): Adjust. * cp-tree.h (IDENTIFIER_GLOBAL_VALUE) SET_IDENTIFIER_GLOBAL_VALUE): Adjust. * decl.c (poplevel): Adjust. * pt.c (make_constrained_auto): Likewise. ((--This line, and those below, will be ignored-- M cp/cp-tree.h M cp/name-lookup.c M cp/name-lookup.h M cp/decl.c M cp/ChangeLog M cp/pt.c From-SVN: r247745
This commit is contained in:
parent
1e5c24003b
commit
06aa549005
6 changed files with 36 additions and 21 deletions
|
@ -1,3 +1,18 @@
|
||||||
|
2017-05-08 Nathan Sidwell <nathan@acm.org>
|
||||||
|
|
||||||
|
Revert _binding -> _value change.
|
||||||
|
* name-lookup.h (get_namespace_value, set_global_value): Rename to ...
|
||||||
|
(get_namespace_binding, set_global_binding): ... these.
|
||||||
|
* name-lookup.c (get_namespace_value, set_global_value): Rename to ...
|
||||||
|
(get_namespace_binding, set_global_binding): ... these.
|
||||||
|
(arg_assoc_namespace, pushdecl_maybe_friend_1,
|
||||||
|
check_for_out_of_scope_variable, push_overloaded_decl_1,
|
||||||
|
lookup_name_innermost_nonclass_level, push_namespace): Adjust.
|
||||||
|
* cp-tree.h (IDENTIFIER_GLOBAL_VALUE,
|
||||||
|
SET_IDENTIFIER_GLOBAL_VALUE): Adjust.
|
||||||
|
* decl.c (poplevel): Adjust.
|
||||||
|
* pt.c (make_constrained_auto): Likewise.
|
||||||
|
|
||||||
2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
|
2017-05-07 Volker Reichelt <v.reichelt@netcologne.de>
|
||||||
|
|
||||||
PR translation/80280
|
PR translation/80280
|
||||||
|
|
|
@ -554,9 +554,9 @@ struct GTY(()) ptrmem_cst {
|
||||||
typedef struct ptrmem_cst * ptrmem_cst_t;
|
typedef struct ptrmem_cst * ptrmem_cst_t;
|
||||||
|
|
||||||
#define IDENTIFIER_GLOBAL_VALUE(NODE) \
|
#define IDENTIFIER_GLOBAL_VALUE(NODE) \
|
||||||
get_namespace_value (NULL_TREE, (NODE))
|
get_namespace_binding (NULL_TREE, (NODE))
|
||||||
#define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
|
#define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
|
||||||
set_global_value ((NODE), (VAL))
|
set_global_binding ((NODE), (VAL))
|
||||||
|
|
||||||
#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
|
#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
|
||||||
|
|
||||||
|
|
|
@ -693,7 +693,7 @@ poplevel (int keep, int reverse, int functionbody)
|
||||||
/*class_p=*/true);
|
/*class_p=*/true);
|
||||||
tree ns_binding = NULL_TREE;
|
tree ns_binding = NULL_TREE;
|
||||||
if (!ob)
|
if (!ob)
|
||||||
ns_binding = get_namespace_value (current_namespace, name);
|
ns_binding = get_namespace_binding (current_namespace, name);
|
||||||
|
|
||||||
if (ob && ob->scope == current_binding_level->level_chain)
|
if (ob && ob->scope == current_binding_level->level_chain)
|
||||||
/* We have something like:
|
/* We have something like:
|
||||||
|
|
|
@ -215,7 +215,7 @@ arg_assoc_namespace (struct arg_lookup *k, tree scope)
|
||||||
if (arg_assoc_namespace (k, TREE_PURPOSE (value)))
|
if (arg_assoc_namespace (k, TREE_PURPOSE (value)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
value = get_namespace_value (scope, k->name);
|
value = get_namespace_binding (scope, k->name);
|
||||||
if (!value)
|
if (!value)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1250,7 +1250,7 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
|
||||||
/* In case this decl was explicitly namespace-qualified, look it
|
/* In case this decl was explicitly namespace-qualified, look it
|
||||||
up in its namespace context. */
|
up in its namespace context. */
|
||||||
if (DECL_NAMESPACE_SCOPE_P (x) && namespace_bindings_p ())
|
if (DECL_NAMESPACE_SCOPE_P (x) && namespace_bindings_p ())
|
||||||
t = get_namespace_value (DECL_CONTEXT (x), name);
|
t = get_namespace_binding (DECL_CONTEXT (x), name);
|
||||||
else
|
else
|
||||||
t = lookup_name_innermost_nonclass_level (name);
|
t = lookup_name_innermost_nonclass_level (name);
|
||||||
|
|
||||||
|
@ -1267,7 +1267,7 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
|
||||||
t = innermost_non_namespace_value (name);
|
t = innermost_non_namespace_value (name);
|
||||||
/* Or in the innermost namespace. */
|
/* Or in the innermost namespace. */
|
||||||
if (! t)
|
if (! t)
|
||||||
t = get_namespace_value (DECL_CONTEXT (x), name);
|
t = get_namespace_binding (DECL_CONTEXT (x), name);
|
||||||
/* Does it have linkage? Note that if this isn't a DECL, it's an
|
/* Does it have linkage? Note that if this isn't a DECL, it's an
|
||||||
OVERLOAD, which is OK. */
|
OVERLOAD, which is OK. */
|
||||||
if (t && DECL_P (t) && ! (TREE_STATIC (t) || DECL_EXTERNAL (t)))
|
if (t && DECL_P (t) && ! (TREE_STATIC (t) || DECL_EXTERNAL (t)))
|
||||||
|
@ -1521,7 +1521,7 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
|
||||||
{
|
{
|
||||||
tree decl;
|
tree decl;
|
||||||
|
|
||||||
decl = get_namespace_value (current_namespace, name);
|
decl = get_namespace_binding (current_namespace, name);
|
||||||
if (decl && TREE_CODE (decl) == OVERLOAD)
|
if (decl && TREE_CODE (decl) == OVERLOAD)
|
||||||
decl = OVL_FUNCTION (decl);
|
decl = OVL_FUNCTION (decl);
|
||||||
|
|
||||||
|
@ -1568,7 +1568,7 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Here to install a non-global value. */
|
/* Here to install a non-global value. */
|
||||||
tree oldglobal = get_namespace_value (current_namespace, name);
|
tree oldglobal = get_namespace_binding (current_namespace, name);
|
||||||
tree oldlocal = NULL_TREE;
|
tree oldlocal = NULL_TREE;
|
||||||
cp_binding_level *oldscope = NULL;
|
cp_binding_level *oldscope = NULL;
|
||||||
cxx_binding *oldbinding = outer_binding (name, NULL, true);
|
cxx_binding *oldbinding = outer_binding (name, NULL, true);
|
||||||
|
@ -1608,7 +1608,7 @@ pushdecl_maybe_friend_1 (tree x, bool is_friend)
|
||||||
|
|
||||||
if (oldlocal == NULL_TREE)
|
if (oldlocal == NULL_TREE)
|
||||||
oldlocal
|
oldlocal
|
||||||
= get_namespace_value (current_namespace, DECL_NAME (d));
|
= get_namespace_binding (current_namespace, DECL_NAME (d));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If this is an extern function declaration, see if we
|
/* If this is an extern function declaration, see if we
|
||||||
|
@ -1972,7 +1972,7 @@ check_for_out_of_scope_variable (tree decl)
|
||||||
shadowed = DECL_HAS_SHADOWED_FOR_VAR_P (shadowed)
|
shadowed = DECL_HAS_SHADOWED_FOR_VAR_P (shadowed)
|
||||||
? DECL_SHADOWED_FOR_VAR (shadowed) : NULL_TREE;
|
? DECL_SHADOWED_FOR_VAR (shadowed) : NULL_TREE;
|
||||||
if (!shadowed)
|
if (!shadowed)
|
||||||
shadowed = get_namespace_value (current_namespace, DECL_NAME (decl));
|
shadowed = get_namespace_binding (current_namespace, DECL_NAME (decl));
|
||||||
if (shadowed)
|
if (shadowed)
|
||||||
{
|
{
|
||||||
if (!DECL_ERROR_REPORTED (decl))
|
if (!DECL_ERROR_REPORTED (decl))
|
||||||
|
@ -2934,7 +2934,7 @@ push_overloaded_decl_1 (tree decl, int flags, bool is_friend)
|
||||||
int doing_global = (namespace_bindings_p () || !(flags & PUSH_LOCAL));
|
int doing_global = (namespace_bindings_p () || !(flags & PUSH_LOCAL));
|
||||||
|
|
||||||
if (doing_global)
|
if (doing_global)
|
||||||
old = get_namespace_value (DECL_CONTEXT (decl), name);
|
old = get_namespace_binding (DECL_CONTEXT (decl), name);
|
||||||
else
|
else
|
||||||
old = lookup_name_innermost_nonclass_level (name);
|
old = lookup_name_innermost_nonclass_level (name);
|
||||||
|
|
||||||
|
@ -4023,7 +4023,7 @@ namespace_binding_1 (tree name, tree scope)
|
||||||
global_namespace. */
|
global_namespace. */
|
||||||
|
|
||||||
tree
|
tree
|
||||||
get_namespace_value (tree ns, tree name)
|
get_namespace_binding (tree ns, tree name)
|
||||||
{
|
{
|
||||||
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
|
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
|
||||||
if (!ns)
|
if (!ns)
|
||||||
|
@ -4052,11 +4052,11 @@ set_namespace_binding (tree name, tree scope, tree val)
|
||||||
supplement_binding (b, val);
|
supplement_binding (b, val);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set NAME in the global namespace to VAL. Does not add it to the
|
/* Set value binding og NAME in the global namespace to VAL. Does not
|
||||||
list of things in the namespace. */
|
add it to the list of things in the namespace. */
|
||||||
|
|
||||||
void
|
void
|
||||||
set_global_value (tree name, tree val)
|
set_global_binding (tree name, tree val)
|
||||||
{
|
{
|
||||||
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
|
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
|
||||||
|
|
||||||
|
@ -5823,7 +5823,7 @@ lookup_name_innermost_nonclass_level_1 (tree name)
|
||||||
|
|
||||||
if (b->kind == sk_namespace)
|
if (b->kind == sk_namespace)
|
||||||
{
|
{
|
||||||
t = get_namespace_value (current_namespace, name);
|
t = get_namespace_binding (current_namespace, name);
|
||||||
|
|
||||||
/* extern "C" function() */
|
/* extern "C" function() */
|
||||||
if (t != NULL_TREE && TREE_CODE (t) == TREE_LIST)
|
if (t != NULL_TREE && TREE_CODE (t) == TREE_LIST)
|
||||||
|
@ -6475,7 +6475,7 @@ push_namespace (tree name)
|
||||||
if (anon)
|
if (anon)
|
||||||
{
|
{
|
||||||
name = anon_identifier;
|
name = anon_identifier;
|
||||||
d = get_namespace_value (current_namespace, name);
|
d = get_namespace_binding (current_namespace, name);
|
||||||
if (d)
|
if (d)
|
||||||
/* Reopening anonymous namespace. */
|
/* Reopening anonymous namespace. */
|
||||||
need_new = false;
|
need_new = false;
|
||||||
|
@ -6484,7 +6484,7 @@ push_namespace (tree name)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Check whether this is an extended namespace definition. */
|
/* Check whether this is an extended namespace definition. */
|
||||||
d = get_namespace_value (current_namespace, name);
|
d = get_namespace_binding (current_namespace, name);
|
||||||
if (d != NULL_TREE && TREE_CODE (d) == NAMESPACE_DECL)
|
if (d != NULL_TREE && TREE_CODE (d) == NAMESPACE_DECL)
|
||||||
{
|
{
|
||||||
tree dna = DECL_NAMESPACE_ALIAS (d);
|
tree dna = DECL_NAMESPACE_ALIAS (d);
|
||||||
|
|
|
@ -311,8 +311,8 @@ extern tree pushdecl_with_scope (tree, cp_binding_level *, bool);
|
||||||
extern tree lookup_name_prefer_type (tree, int);
|
extern tree lookup_name_prefer_type (tree, int);
|
||||||
extern tree lookup_name_real (tree, int, int, bool, int, int);
|
extern tree lookup_name_real (tree, int, int, bool, int, int);
|
||||||
extern tree lookup_type_scope (tree, tag_scope);
|
extern tree lookup_type_scope (tree, tag_scope);
|
||||||
extern tree get_namespace_value (tree ns, tree id);
|
extern tree get_namespace_binding (tree ns, tree id);
|
||||||
extern void set_global_value (tree id, tree val);
|
extern void set_global_binding (tree id, tree val);
|
||||||
extern bool hidden_name_p (tree);
|
extern bool hidden_name_p (tree);
|
||||||
extern tree remove_hidden_names (tree);
|
extern tree remove_hidden_names (tree);
|
||||||
extern tree lookup_qualified_name (tree, tree, int, bool, /*hidden*/bool = false);
|
extern tree lookup_qualified_name (tree, tree, int, bool, /*hidden*/bool = false);
|
||||||
|
|
|
@ -24731,7 +24731,7 @@ make_constrained_auto (tree con, tree args)
|
||||||
static tree
|
static tree
|
||||||
listify (tree arg)
|
listify (tree arg)
|
||||||
{
|
{
|
||||||
tree std_init_list = get_namespace_value (std_node, init_list_identifier);
|
tree std_init_list = get_namespace_binding (std_node, init_list_identifier);
|
||||||
tree argvec;
|
tree argvec;
|
||||||
if (!std_init_list || !DECL_CLASS_TEMPLATE_P (std_init_list))
|
if (!std_init_list || !DECL_CLASS_TEMPLATE_P (std_init_list))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue