]> git.ipfire.org Git - thirdparty/gcc.git/commit
[c++]: Unconfuse lookup_name_real API a bit
authorNathan Sidwell <nathan@acm.org>
Thu, 13 Aug 2020 17:59:00 +0000 (10:59 -0700)
committerGiuliano Belinassi <giuliano.belinassi@usp.br>
Mon, 17 Aug 2020 18:08:10 +0000 (15:08 -0300)
commitc491a6e17b94f42c9b5ef3b3840a0d7c2ffb7102
treed8d2c4228b60e2bebdb111dbb1fb776f1c4e90d6
parent27aeb71c04eaa1a2125777d230057fbd0508af15
[c++]: Unconfuse lookup_name_real API a bit

The API for lookup_name_real is really confusing.  This addresses the part
where we have NONCLASS to say DON'T search class scopes, and BLOCK_P to say
DO search block scopes.  I've added a single bitmask to explicitly say which
scopes to search.  I used an enum class so one can't accidentally misorder
it.  It's also reordered so we don't mix it up with the parameters that say
what kind of thing we're looking for.

gcc/cp/
* name-lookup.h (enum class LOOK_where): New.
(operator|, operator&): Overloads for it.
(lookup_name_real): Replace NONCLASS & BLOCK_P parms with WHERE.
* name-lookup.c (identifier_type_value_w): Adjust
lookup_name_real call.
(lookup_name_real_1): Replace NONCLASS and BLOCK_P parameters
with WHERE bitmask. Don't search namespaces if not asked to.
(lookup_name_real): Adjust lookup_name_real_1 call.
(lookup_name_nonclass, lookup_name)
(lookup_name_prefer_type): Likewise.
* call.c (build_operator_new_call)
(add_operator_candidates): Adjust lookup_name_real calls.
* parser.c (cp_parser_lookup_name): Likewise.
* pt.c (tsubst_friend_class, lookup_init_capture_pack)
(tsubst_expr): Likewise.
* semantics.c (capture_decltype): Likewise.
libcc1/
* libcp1plugin.cc (plugin_build_dependent_expr): Likewise.
gcc/cp/call.c
gcc/cp/name-lookup.c
gcc/cp/name-lookup.h
gcc/cp/parser.c
gcc/cp/pt.c
gcc/cp/semantics.c
libcc1/libcp1plugin.cc