summaryrefslogtreecommitdiff
path: root/libcc1
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2020-08-14 09:55:33 -0700
committerNathan Sidwell <nathan@acm.org>2020-08-14 10:54:53 -0700
commitdb1c2a89db09c8fe140ed3e65a707a08737e3b41 (patch)
treee439889780d093caf396a363abc171c2ec293bc4 /libcc1
parent320054784250e572cb75d6f69ab44b2330d61d8b (diff)
c++: Yet more name-lookup api simplification
This patch deals with LOOKUP_HIDDEN, which originally meant 'find hidden friends', but it's being pressed into service for not ignoring lambda-relevant internals. However these two functions are different. (a) hidden friends can occur in block scope (very uncommon) and (b) it had the semantics of stopping after the innermost enclosing namepspace. That's really suspect for the lambda case, but not relevant there because we never get to namespace scope (I think). Anyway, I've split the flag into two and adjusted the lambda callers to just search block scope. These two flags are added to the LOOK_want enum class, which allows dropping another parameter from the name lookup routines. The remaining LOOKUP_$FOO flags in cp-tree.h are, I think, now all related to features of overload resolution, conversion operators and reference binding. Nothing to do with /name/ lookup. gcc/cp/ * cp-tree.h (LOOKUP_HIDDEN): Delete. (LOOKUP_PREFER_RVALUE): Adjust initializer. * name-lookup.h (enum class LOOK_want): Add HIDDEN_FRIEND and HIDDEN_LAMBDA flags. (lookup_name_real): Drop flags parm. (lookup_qualified_name): Drop find_hidden parm. * name-lookup.c (class name_lookup): Drop hidden field, adjust ctors. (name_lookup::add_overload): Check want for hiddenness. (name_lookup::process_binding): Likewise. (name_lookup::search_unqualified): Likewise. (identifier_type_value_1): Adjust lookup_name_real call. (set_decl_namespace): Adjust name_lookup ctor. (qualify_lookup): Drop flags parm, use want for hiddenness. (lookup_qualified_name): Drop find_hidden parm. (lookup_name_real_1): Drop flags parm, adjust qualify_lookup calls. (lookup_name_real): Drop flags parm. (lookup_name_nonclass, lookup_name): Adjust lookup_name_real calls. (lookup_type_scope_1): Adjust qualify_lookup calls. * call.c (build_operator_new_call): Adjust lookup_name_real call. (add_operator_candidates): Likewise. * coroutines.cc (morph_fn_to_coro): Adjust lookup_qualified_name call. * parser.c (cp_parser_lookup_name): Adjust lookup_name_real calls. * pt.c (check_explicit_specialization): Adjust lookup_qualified_name call. (deduction_guides_for): Likewise. (tsubst_friend_class): Adjust lookup_name_real call. (lookup_init_capture_pack): Likewise. (tsubst_expr): Likewise, don't look in namespaces. * semantics.c (capture_decltype): Adjust lookup_name_real. Don't look in namespaces. libcc1/ * libcp1plugin.cc (plugin_build_dependent_exp): Adjust lookup_name_real call.
Diffstat (limited to 'libcc1')
-rw-r--r--libcc1/libcp1plugin.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libcc1/libcp1plugin.cc b/libcc1/libcp1plugin.cc
index ddff7452226..e30cb8c024b 100644
--- a/libcc1/libcp1plugin.cc
+++ b/libcc1/libcp1plugin.cc
@@ -2653,7 +2653,7 @@ plugin_build_dependent_expr (cc1_plugin::connection *self,
tree res = identifier;
if (!scope)
res = lookup_name_real (res, LOOK_where::BLOCK_NAMESPACE,
- LOOK_want::NORMAL, 0);
+ LOOK_want::NORMAL);
else if (!TYPE_P (scope) || !dependent_scope_p (scope))
{
res = lookup_qualified_name (scope, res, LOOK_want::NORMAL, true);