+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>
PR translation/80280
if (arg_assoc_namespace (k, TREE_PURPOSE (value)))
return true;
- value = get_namespace_value (scope, k->name);
+ value = get_namespace_binding (scope, k->name);
if (!value)
return false;
/* In case this decl was explicitly namespace-qualified, look it
up in its namespace context. */
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
t = lookup_name_innermost_nonclass_level (name);
t = innermost_non_namespace_value (name);
/* Or in the innermost namespace. */
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
OVERLOAD, which is OK. */
if (t && DECL_P (t) && ! (TREE_STATIC (t) || DECL_EXTERNAL (t)))
{
tree decl;
- decl = get_namespace_value (current_namespace, name);
+ decl = get_namespace_binding (current_namespace, name);
if (decl && TREE_CODE (decl) == OVERLOAD)
decl = OVL_FUNCTION (decl);
else
{
/* 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;
cp_binding_level *oldscope = NULL;
cxx_binding *oldbinding = outer_binding (name, NULL, true);
if (oldlocal == NULL_TREE)
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
shadowed = DECL_HAS_SHADOWED_FOR_VAR_P (shadowed)
? DECL_SHADOWED_FOR_VAR (shadowed) : NULL_TREE;
if (!shadowed)
- shadowed = get_namespace_value (current_namespace, DECL_NAME (decl));
+ shadowed = get_namespace_binding (current_namespace, DECL_NAME (decl));
if (shadowed)
{
if (!DECL_ERROR_REPORTED (decl))
int doing_global = (namespace_bindings_p () || !(flags & PUSH_LOCAL));
if (doing_global)
- old = get_namespace_value (DECL_CONTEXT (decl), name);
+ old = get_namespace_binding (DECL_CONTEXT (decl), name);
else
old = lookup_name_innermost_nonclass_level (name);
global_namespace. */
tree
-get_namespace_value (tree ns, tree name)
+get_namespace_binding (tree ns, tree name)
{
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
if (!ns)
supplement_binding (b, val);
}
-/* Set NAME in the global namespace to VAL. Does not add it to the
- list of things in the namespace. */
+/* Set value binding og NAME in the global namespace to VAL. Does not
+ add it to the list of things in the namespace. */
void
-set_global_value (tree name, tree val)
+set_global_binding (tree name, tree val)
{
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
if (b->kind == sk_namespace)
{
- t = get_namespace_value (current_namespace, name);
+ t = get_namespace_binding (current_namespace, name);
/* extern "C" function() */
if (t != NULL_TREE && TREE_CODE (t) == TREE_LIST)
if (anon)
{
name = anon_identifier;
- d = get_namespace_value (current_namespace, name);
+ d = get_namespace_binding (current_namespace, name);
if (d)
/* Reopening anonymous namespace. */
need_new = false;
else
{
/* 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)
{
tree dna = DECL_NAMESPACE_ALIAS (d);
extern tree lookup_name_prefer_type (tree, int);
extern tree lookup_name_real (tree, int, int, bool, int, int);
extern tree lookup_type_scope (tree, tag_scope);
-extern tree get_namespace_value (tree ns, tree id);
-extern void set_global_value (tree id, tree val);
+extern tree get_namespace_binding (tree ns, tree id);
+extern void set_global_binding (tree id, tree val);
extern bool hidden_name_p (tree);
extern tree remove_hidden_names (tree);
extern tree lookup_qualified_name (tree, tree, int, bool, /*hidden*/bool = false);