up in the global scope.
we disregard block-scope declarations of "operator new". */
- fns = lookup_name_real (fnname, LOOK_where::NAMESPACE, LOOK_want::NORMAL);
+ fns = lookup_name (fnname, LOOK_where::NAMESPACE);
fns = lookup_arg_dependent (fnname, fns, *args);
if (align_arg)
consider. */
if (!memonly)
{
- tree fns = lookup_name_real (fnname, LOOK_where::BLOCK_NAMESPACE,
- LOOK_want::NORMAL);
+ tree fns = lookup_name (fnname, LOOK_where::BLOCK_NAMESPACE);
fns = lookup_arg_dependent (fnname, fns, arglist);
add_candidates (fns, NULL_TREE, arglist, NULL_TREE,
NULL_TREE, false, NULL_TREE, NULL_TREE,
fns = NULL_TREE;
if (fns == NULL_TREE)
- fns = lookup_name_nonclass (fnname);
+ fns = lookup_name (fnname, LOOK_where::BLOCK_NAMESPACE);
/* Strip const and volatile from addr. */
tree oaddr = addr;
return REAL_IDENTIFIER_TYPE_VALUE (id);
/* Have to search for it. It must be on the global level, now.
Ask lookup_name not to return non-types. */
- id = lookup_name_real (id, LOOK_where::BLOCK_NAMESPACE, LOOK_want::TYPE);
+ id = lookup_name (id, LOOK_where::BLOCK_NAMESPACE, LOOK_want::TYPE);
if (id)
return TREE_TYPE (id);
return NULL_TREE;
}
/* Given a lookup that returned VAL, use FLAGS to decide if we want to
- ignore it or not. Subroutine of lookup_name_real and
- lookup_type_scope. */
+ ignore it or not. Subroutine of lookup_name_1 and lookup_type_scope. */
static bool
qualify_lookup (tree val, LOOK_want want)
/* Look up NAME (an IDENTIFIER_NODE) in SCOPE (either a NAMESPACE_DECL
or a class TYPE).
- WANT as for lookup_name_real_1.
+ WANT as for lookup_name_1.
Returns a DECL (or OVERLOAD, or BASELINK) representing the
declaration found. If no suitable declaration can be found,
LOOK_want::NORMAL for normal lookup (implicit typedefs can be
hidden). LOOK_want::TYPE for only TYPE_DECLS, LOOK_want::NAMESPACE
for only NAMESPACE_DECLS. These two can be bit-ored to find
- namespace or type. */
+ namespace or type.
+
+ WANT can also have LOOK_want::HIDDEN_FRIEND or
+ LOOK_want::HIDDEN_LAMBDa added to it. */
static tree
-lookup_name_real_1 (tree name, LOOK_where where, LOOK_want want)
+lookup_name_1 (tree name, LOOK_where where, LOOK_want want)
{
tree val = NULL_TREE;
return val;
}
-/* Wrapper for lookup_name_real_1. */
+/* Wrapper for lookup_name_1. */
tree
-lookup_name_real (tree name, LOOK_where where, LOOK_want want)
+lookup_name (tree name, LOOK_where where, LOOK_want want)
{
bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
- tree ret = lookup_name_real_1 (name, where, want);
+ tree ret = lookup_name_1 (name, where, want);
timevar_cond_stop (TV_NAME_LOOKUP, subtime);
return ret;
}
-tree
-lookup_name_nonclass (tree name)
-{
- return lookup_name_real (name, LOOK_where::BLOCK_NAMESPACE, LOOK_want::NORMAL);
-}
-
tree
lookup_name (tree name)
{
- return lookup_name_real (name, LOOK_where::ALL, LOOK_want::NORMAL);
-}
-
-tree
-lookup_name (tree name, LOOK_want want)
-{
- return lookup_name_real (name, LOOK_where::ALL, want);
+ return lookup_name (name, LOOK_where::ALL, LOOK_want::NORMAL);
}
/* Look up NAME for type used in elaborated name specifier in
name, more scopes are checked if cleanup or template parameter
scope is encountered.
- Unlike lookup_name_real, we make sure that NAME is actually
+ Unlike lookup_name_1, we make sure that NAME is actually
declared in the desired scope, not from inheritance, nor using
directive. For using declaration, there is DR138 still waiting
to be resolved. Hidden name coming from an earlier friend
return LOOK_want (unsigned (a) & unsigned (b));
}
-extern tree lookup_name_real (tree, LOOK_where, LOOK_want);
+extern tree lookup_name (tree, LOOK_where, LOOK_want = LOOK_want::NORMAL);
+/* Also declared in c-family/c-common.h. */
+extern tree lookup_name (tree name);
+inline tree lookup_name (tree name, LOOK_want want)
+{
+ return lookup_name (name, LOOK_where::ALL, want);
+}
+
extern tree lookup_type_scope (tree, tag_scope);
extern tree get_namespace_binding (tree ns, tree id);
extern void set_global_binding (tree decl);
{
return get_namespace_binding (NULL_TREE, id);
}
-/* Also declared in c-family/c-common.h. */
-extern tree lookup_name (tree name);
-extern tree lookup_name (tree name, LOOK_want);
extern tree lookup_qualified_name (tree scope, tree name,
LOOK_want = LOOK_want::NORMAL,
bool = true);
extern tree lookup_qualified_name (tree scope, const char *name,
LOOK_want = LOOK_want::NORMAL,
bool = true);
-extern tree lookup_name_nonclass (tree);
extern bool is_local_extern (tree);
extern bool pushdecl_class_level (tree);
extern tree pushdecl_namespace_level (tree, bool);
/* Support Functions */
-/* Return the appropriate prefer_type argument for lookup_name_real based on
+/* Return the appropriate prefer_type argument for lookup_name based on
tag_type. */
static inline LOOK_want
if (!decl)
/* Look it up in the enclosing context. DR 141: When looking for a
template-name after -> or ., only consider class templates. */
- decl = lookup_name_real (name, LOOK_where::ALL,
- is_namespace ? LOOK_want::NAMESPACE
- /* DR 141: When looking in the
- current enclosing context for a
- template-name after -> or ., only
- consider class templates. */
- : is_template ? LOOK_want::TYPE
- : prefer_type_arg (tag_type));
+ decl = lookup_name (name, is_namespace ? LOOK_want::NAMESPACE
+ /* DR 141: When looking in the
+ current enclosing context for a
+ template-name after -> or ., only
+ consider class templates. */
+ : is_template ? LOOK_want::TYPE
+ : prefer_type_arg (tag_type));
parser->object_scope = object_type;
parser->qualifying_scope = NULL_TREE;
}
else
{
- decl = lookup_name_real (name, LOOK_where::ALL,
- is_namespace ? LOOK_want::NAMESPACE
- : prefer_type_arg (tag_type));
+ decl = lookup_name (name, is_namespace ? LOOK_want::NAMESPACE
+ : prefer_type_arg (tag_type));
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
}
push_nested_class (context);
}
- tmpl = lookup_name_real (DECL_NAME (friend_tmpl), LOOK_where::CLASS_NAMESPACE,
- LOOK_want::NORMAL | LOOK_want::HIDDEN_FRIEND);
+ tmpl = lookup_name (DECL_NAME (friend_tmpl), LOOK_where::CLASS_NAMESPACE,
+ LOOK_want::NORMAL | LOOK_want::HIDDEN_FRIEND);
if (tmpl && DECL_CLASS_TEMPLATE_P (tmpl))
{
for (int i = 0; i < len; ++i)
{
tree ename = vec ? make_ith_pack_parameter_name (cname, i) : cname;
- tree elt = lookup_name_real (ename, LOOK_where::ALL, LOOK_want::NORMAL);
+ tree elt = lookup_name (ename);
if (vec)
TREE_VEC_ELT (vec, i) = elt;
else
tree inst;
if (!DECL_PACK_P (decl))
{
- inst = (lookup_name_real
- (DECL_NAME (decl), LOOK_where::BLOCK,
- LOOK_want::NORMAL | LOOK_want::HIDDEN_LAMBDA));
+ inst = lookup_name (DECL_NAME (decl), LOOK_where::BLOCK,
+ LOOK_want::HIDDEN_LAMBDA);
gcc_assert (inst != decl && is_capture_proxy (inst));
}
else if (is_normal_capture_proxy (decl))
capture_decltype (tree decl)
{
tree lam = CLASSTYPE_LAMBDA_EXPR (DECL_CONTEXT (current_function_decl));
- tree cap = lookup_name_real (DECL_NAME (decl), LOOK_where::BLOCK,
- LOOK_want::NORMAL | LOOK_want::HIDDEN_LAMBDA);
+ tree cap = lookup_name (DECL_NAME (decl), LOOK_where::BLOCK,
+ LOOK_want::HIDDEN_LAMBDA);
tree type;
if (cap && is_capture_proxy (cap))
}
tree res = identifier;
if (!scope)
- res = lookup_name_real (res, LOOK_where::BLOCK_NAMESPACE,
- LOOK_want::NORMAL);
+ res = lookup_name (res, LOOK_where::BLOCK_NAMESPACE);
else if (!TYPE_P (scope) || !dependent_scope_p (scope))
{
res = lookup_qualified_name (scope, res, LOOK_want::NORMAL, true);