Bug Summary

File:build/gcc/cp/name-lookup.cc
Warning:line 2180, column 5
Called C++ object pointer is null

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-suse-linux -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name name-lookup.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/15.0.7 -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I cp -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/backward -internal-isystem /usr/lib64/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2023-03-27-141847-20772-1/report-c4amNx.plist -x c++ /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc

/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc

1/* Definitions for C++ name lookup routines.
2 Copyright (C) 2003-2023 Free Software Foundation, Inc.
3 Contributed by Gabriel Dos Reis <gdr@integrable-solutions.net>
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21#include "config.h"
22#define INCLUDE_MEMORY
23#include "system.h"
24#include "coretypes.h"
25#include "cp-tree.h"
26#include "timevar.h"
27#include "stringpool.h"
28#include "print-tree.h"
29#include "attribs.h"
30#include "debug.h"
31#include "c-family/c-pragma.h"
32#include "gcc-rich-location.h"
33#include "spellcheck-tree.h"
34#include "parser.h"
35#include "c-family/name-hint.h"
36#include "c-family/known-headers.h"
37#include "c-family/c-spellcheck.h"
38#include "bitmap.h"
39
40static cxx_binding *cxx_binding_make (tree value, tree type);
41static cp_binding_level *innermost_nonclass_level (void);
42static void set_identifier_type_value_with_scope (tree id, tree decl,
43 cp_binding_level *b);
44static name_hint maybe_suggest_missing_std_header (location_t location,
45 tree name);
46static name_hint suggest_alternatives_for_1 (location_t location, tree name,
47 bool suggest_misspellings);
48
49/* Slots in BINDING_VECTOR. */
50enum binding_slots
51{
52 BINDING_SLOT_CURRENT, /* Slot for current TU. */
53 BINDING_SLOT_GLOBAL, /* Slot for merged global module. */
54 BINDING_SLOT_PARTITION, /* Slot for merged partition entities
55 (optional). */
56
57 /* Number of always-allocated slots. */
58 BINDING_SLOTS_FIXED = BINDING_SLOT_GLOBAL + 1
59};
60
61/* Create an overload suitable for recording an artificial TYPE_DECL
62 and another decl. We use this machanism to implement the struct
63 stat hack. */
64
65#define STAT_HACK_P(N)((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 65, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 65, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4))
((N) && TREE_CODE (N)((enum tree_code) (N)->base.code) == OVERLOAD && OVL_LOOKUP_P (N)((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 65, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 65, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)
)
66#define STAT_TYPE_VISIBLE_P(N)(((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 66, __FUNCTION__, (OVERLOAD))))->base.used_flag)
TREE_USED (OVERLOAD_CHECK (N))(((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 66, __FUNCTION__, (OVERLOAD))))->base.used_flag)
67#define STAT_TYPE(N)((contains_struct_check ((N), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 67, __FUNCTION__))->typed.type)
TREE_TYPE (N)((contains_struct_check ((N), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 67, __FUNCTION__))->typed.type)
68#define STAT_DECL(N)(((struct tree_overload*)(tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 68, __FUNCTION__, (OVERLOAD))))->function)
OVL_FUNCTION (N)(((struct tree_overload*)(tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 68, __FUNCTION__, (OVERLOAD))))->function)
69#define STAT_VISIBLE(N)(((struct tree_overload*)(tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 69, __FUNCTION__, (OVERLOAD))))->common.chain)
OVL_CHAIN (N)(((struct tree_overload*)(tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 69, __FUNCTION__, (OVERLOAD))))->common.chain)
70#define MAYBE_STAT_DECL(N)(((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 70, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 70, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)) ? (((struct tree_overload*)(tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 70, __FUNCTION__, (OVERLOAD))))->function) : N)
(STAT_HACK_P (N)((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 70, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 70, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4))
? STAT_DECL (N)(((struct tree_overload*)(tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 70, __FUNCTION__, (OVERLOAD))))->function)
: N)
71#define MAYBE_STAT_TYPE(N)(((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 71, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 71, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)) ? ((contains_struct_check ((N), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 71, __FUNCTION__))->typed.type) : (tree) nullptr)
(STAT_HACK_P (N)((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 71, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 71, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4))
? STAT_TYPE (N)((contains_struct_check ((N), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 71, __FUNCTION__))->typed.type)
: NULL_TREE(tree) nullptr)
72
73/* When a STAT_HACK_P is true, OVL_USING_P and OVL_EXPORT_P are valid
74 and apply to the hacked type. */
75
76/* For regular (maybe) overloaded functions, we have OVL_HIDDEN_P.
77 But we also need to indicate hiddenness on implicit type decls
78 (injected friend classes), and (coming soon) decls injected from
79 block-scope externs. It is too awkward to press the existing
80 overload marking for that. If we have a hidden non-function, we
81 always create a STAT_HACK, and use these two markers as needed. */
82#define STAT_TYPE_HIDDEN_P(N)((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 82, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 82, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_2)
OVL_HIDDEN_P (N)((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 82, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 82, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_2)
83#define STAT_DECL_HIDDEN_P(N)((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 83, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 83, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_0)
OVL_DEDUP_P (N)((tree_not_check2 (((tree_check ((N), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 83, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 83, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_0)
84
85/* Create a STAT_HACK node with DECL as the value binding and TYPE as
86 the type binding. */
87
88static tree
89stat_hack (tree decl = NULL_TREE(tree) nullptr, tree type = NULL_TREE(tree) nullptr)
90{
91 tree result = make_node (OVERLOAD);
92
93 /* Mark this as a lookup, so we can tell this is a stat hack. */
94 OVL_LOOKUP_P (result)((tree_not_check2 (((tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 94, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 94, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)
= true;
95 STAT_DECL (result)(((struct tree_overload*)(tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 95, __FUNCTION__, (OVERLOAD))))->function)
= decl;
96 STAT_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 96, __FUNCTION__))->typed.type)
= type;
97 return result;
98}
99
100/* Create a local binding level for NAME. */
101
102static cxx_binding *
103create_local_binding (cp_binding_level *level, tree name)
104{
105 cxx_binding *binding = cxx_binding_make (NULLnullptr, NULLnullptr);
106
107 LOCAL_BINDING_P (binding)((binding)->is_local) = true;
108 binding->scope = level;
109 binding->previous = IDENTIFIER_BINDING (name)(((struct lang_identifier*)(tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 109, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
110
111 IDENTIFIER_BINDING (name)(((struct lang_identifier*)(tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 111, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
= binding;
112
113 return binding;
114}
115
116/* Find the binding for NAME in namespace NS. If CREATE_P is true,
117 make an empty binding if there wasn't one. */
118
119static tree *
120find_namespace_slot (tree ns, tree name, bool create_p = false)
121{
122 tree *slot = DECL_NAMESPACE_BINDINGS (ns)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((ns), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 122, __FUNCTION__))->decl_common.lang_specific); if (((enum
tree_code) (ns)->base.code) != NAMESPACE_DECL || lt->u
.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 122, __FUNCTION__); &lt->u.ns; })->bindings)
123 ->find_slot_with_hash (name, name ? IDENTIFIER_HASH_VALUE (name)((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 123, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
: 0,
124 create_p ? INSERT : NO_INSERT);
125 return slot;
126}
127
128static tree
129find_namespace_value (tree ns, tree name)
130{
131 tree *b = find_namespace_slot (ns, name);
132
133 return b ? MAYBE_STAT_DECL (*b)(((*b) && ((enum tree_code) (*b)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((*b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 133, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 133, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((*b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 133, __FUNCTION__, (OVERLOAD))))->function) : *b)
: NULL_TREE(tree) nullptr;
134}
135
136/* Look in *SLOT for a the binding of NAME in imported module IX.
137 Returns pointer to binding's slot, or NULL if not found. Does a
138 binary search, as this is mainly used for random access during
139 importing. Do not use for the fixed slots. */
140
141static binding_slot *
142search_imported_binding_slot (tree *slot, unsigned ix)
143{
144 gcc_assert (ix)((void)(!(ix) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 144, __FUNCTION__), 0 : 0))
;
145
146 if (!*slot)
147 return NULLnullptr;
148
149 if (TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
150 return NULLnullptr;
151
152 unsigned clusters = BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 152, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
153 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (*slot)(((tree_binding_vec *)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 153, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
154
155 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
156 {
157 clusters--;
158 cluster++;
159 }
160
161 while (clusters > 1)
162 {
163 unsigned half = clusters / 2;
164 gcc_checking_assert (cluster[half].indices[0].span)((void)(!(cluster[half].indices[0].span) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 164, __FUNCTION__), 0 : 0))
;
165 if (cluster[half].indices[0].base > ix)
166 clusters = half;
167 else
168 {
169 clusters -= half;
170 cluster += half;
171 }
172 }
173
174 if (clusters)
175 /* Is it in this cluster? */
176 for (unsigned off = 0; off != BINDING_VECTOR_SLOTS_PER_CLUSTER2; off++)
177 {
178 if (!cluster->indices[off].span)
179 break;
180 if (cluster->indices[off].base > ix)
181 break;
182
183 if (cluster->indices[off].base + cluster->indices[off].span > ix)
184 return &cluster->slots[off];
185 }
186
187 return NULLnullptr;
188}
189
190static void
191init_global_partition (binding_cluster *cluster, tree decl)
192{
193 bool named = true;
194
195 if (header_module_p ())
196 named = false;
197 else if (TREE_PUBLIC (decl)((decl)->base.public_flag)
198 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
199 && !DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 199, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 199, __FUNCTION__))->decl_common.abstract_origin)
)
200 named = false;
201 else if (!get_originating_module (decl))
202 named = false;
203
204 binding_slot *mslot;
205 if (named)
206 mslot = &cluster[BINDING_SLOT_PARTITION
207 / BINDING_VECTOR_SLOTS_PER_CLUSTER2]
208 .slots[BINDING_SLOT_PARTITION
209 % BINDING_VECTOR_SLOTS_PER_CLUSTER2];
210 else
211 mslot = &cluster[0].slots[BINDING_SLOT_GLOBAL];
212
213 if (*mslot)
214 decl = ovl_make (decl, *mslot);
215 *mslot = decl;
216
217 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == CONST_DECL)
218 {
219 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 219, __FUNCTION__))->typed.type)
;
220 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE
221 && IDENTIFIER_ANON_P (DECL_NAME (TYPE_NAME (type)))((tree_check ((((contains_struct_check ((((tree_class_check (
(type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 221, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 221, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 221, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
222 && decl == TREE_VALUE (TYPE_VALUES (type))((tree_check ((((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 222, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 222, __FUNCTION__, (TREE_LIST)))->list.value)
)
223 /* Anonymous enums are keyed by their first enumerator, put
224 the TYPE_DECL here too. */
225 *mslot = ovl_make (TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 225, __FUNCTION__))->type_common.name)
, *mslot);
226 }
227}
228
229/* Get the fixed binding slot IX. Creating the vector if CREATE is
230 non-zero. If CREATE is < 0, make sure there is at least 1 spare
231 slot for an import. (It is an error for CREATE < 0 and the slot to
232 already exist.) */
233
234static tree *
235get_fixed_binding_slot (tree *slot, tree name, unsigned ix, int create)
236{
237 gcc_checking_assert (ix <= BINDING_SLOT_PARTITION)((void)(!(ix <= BINDING_SLOT_PARTITION) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 237, __FUNCTION__), 0 : 0))
;
238
239 /* An assumption is that the fixed slots all reside in one cluster. */
240 gcc_checking_assert (BINDING_VECTOR_SLOTS_PER_CLUSTER >= BINDING_SLOTS_FIXED)((void)(!(2 >= BINDING_SLOTS_FIXED) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 240, __FUNCTION__), 0 : 0))
;
241
242 if (!*slot || TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
243 {
244 if (ix == BINDING_SLOT_CURRENT)
245 /* The current TU can just use slot directly. */
246 return slot;
247
248 if (!create)
249 return NULLnullptr;
250
251 /* The partition slot is only needed when we're a named
252 module. */
253 bool partition_slot = named_module_p ();
254 unsigned want = ((BINDING_SLOTS_FIXED + partition_slot + (create < 0)
255 + BINDING_VECTOR_SLOTS_PER_CLUSTER2 - 1)
256 / BINDING_VECTOR_SLOTS_PER_CLUSTER2);
257 tree new_vec = make_binding_vec (name, want);
258 BINDING_VECTOR_NUM_CLUSTERS (new_vec)((tree_check ((new_vec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 258, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
= want;
259 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (new_vec)(((tree_binding_vec *)(tree_check ((new_vec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 259, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
260
261 /* Initialize the fixed slots. */
262 for (unsigned jx = BINDING_SLOTS_FIXED; jx--;)
263 {
264 cluster[0].indices[jx].base = 0;
265 cluster[0].indices[jx].span = 1;
266 cluster[0].slots[jx] = NULL_TREE(tree) nullptr;
267 }
268
269 if (partition_slot)
270 {
271 unsigned off = BINDING_SLOT_PARTITION % BINDING_VECTOR_SLOTS_PER_CLUSTER2;
272 unsigned ind = BINDING_SLOT_PARTITION / BINDING_VECTOR_SLOTS_PER_CLUSTER2;
273 cluster[ind].indices[off].base = 0;
274 cluster[ind].indices[off].span = 1;
275 cluster[ind].slots[off] = NULL_TREE(tree) nullptr;
276 }
277
278 if (tree orig = *slot)
279 {
280 /* Propagate existing value to current slot. */
281
282 /* Propagate global & module entities to the global and
283 partition slots. */
284 if (tree type = MAYBE_STAT_TYPE (orig)(((orig) && ((enum tree_code) (orig)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((orig),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 284, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 284, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? ((contains_struct_check ((orig), (TS_TYPED),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 284, __FUNCTION__))->typed.type) : (tree) nullptr)
)
285 init_global_partition (cluster, type);
286
287 for (ovl_iterator iter (MAYBE_STAT_DECL (orig)(((orig) && ((enum tree_code) (orig)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((orig),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 287, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 287, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((orig)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 287, __FUNCTION__, (OVERLOAD))))->function) : orig)
); iter; ++iter)
288 {
289 tree decl = *iter;
290
291 /* Internal linkage entities are in deduplicateable. */
292 init_global_partition (cluster, decl);
293 }
294
295 if (cluster[0].slots[BINDING_SLOT_GLOBAL]
296 && !(TREE_CODE (orig)((enum tree_code) (orig)->base.code) == NAMESPACE_DECL
297 && !DECL_NAMESPACE_ALIAS (orig)((contains_struct_check (((tree_check ((orig), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 297, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 297, __FUNCTION__))->decl_common.abstract_origin)
))
298 {
299 /* Note that we had some GMF entries. */
300 if (!STAT_HACK_P (orig)((orig) && ((enum tree_code) (orig)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((orig),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 300, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 300, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
301 orig = stat_hack (orig);
302
303 MODULE_BINDING_GLOBAL_P (orig)((tree_check ((orig), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 303, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
304 }
305
306 cluster[0].slots[BINDING_SLOT_CURRENT] = orig;
307 }
308
309 *slot = new_vec;
310 }
311 else
312 gcc_checking_assert (create >= 0)((void)(!(create >= 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 312, __FUNCTION__), 0 : 0))
;
313
314 unsigned off = ix % BINDING_VECTOR_SLOTS_PER_CLUSTER2;
315 binding_cluster &cluster
316 = BINDING_VECTOR_CLUSTER (*slot, ix / BINDING_VECTOR_SLOTS_PER_CLUSTER)(((tree_binding_vec *)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 316, __FUNCTION__, (BINDING_VECTOR))))->vec[ix / 2])
;
317
318 /* There must always be slots for these indices */
319 gcc_checking_assert (cluster.indices[off].span == 1((void)(!(cluster.indices[off].span == 1 && !cluster.
indices[off].base && !cluster.slots[off].is_lazy ()) ?
fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 321, __FUNCTION__), 0 : 0))
320 && !cluster.indices[off].base((void)(!(cluster.indices[off].span == 1 && !cluster.
indices[off].base && !cluster.slots[off].is_lazy ()) ?
fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 321, __FUNCTION__), 0 : 0))
321 && !cluster.slots[off].is_lazy ())((void)(!(cluster.indices[off].span == 1 && !cluster.
indices[off].base && !cluster.slots[off].is_lazy ()) ?
fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 321, __FUNCTION__), 0 : 0))
;
322
323 return reinterpret_cast<tree *> (&cluster.slots[off]);
324}
325
326/* *SLOT is a namespace binding slot. Append a slot for imported
327 module IX. */
328
329static binding_slot *
330append_imported_binding_slot (tree *slot, tree name, unsigned ix)
331{
332 gcc_checking_assert (ix)((void)(!(ix) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 332, __FUNCTION__), 0 : 0))
;
333
334 if (!*slot || TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
335 /* Make an initial module vector. */
336 get_fixed_binding_slot (slot, name, BINDING_SLOT_GLOBAL, -1);
337 else if (!BINDING_VECTOR_CLUSTER_LAST (*slot)(&(((tree_binding_vec *)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 337, __FUNCTION__, (BINDING_VECTOR))))->vec[((tree_check
((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 337, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base) - 1]))
338 ->indices[BINDING_VECTOR_SLOTS_PER_CLUSTER2 - 1].span)
339 /* There is space in the last cluster. */;
340 else if (BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 340, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
341 != BINDING_VECTOR_ALLOC_CLUSTERS (*slot)((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 341, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.clique)
)
342 /* There is space in the vector. */
343 BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 343, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
++;
344 else
345 {
346 /* Extend the vector. */
347 unsigned have = BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 347, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
348 unsigned want = (have * 3 + 1) / 2;
349
350 if (want > (unsigned short)~0)
351 want = (unsigned short)~0;
352
353 tree new_vec = make_binding_vec (name, want);
354 BINDING_VECTOR_NUM_CLUSTERS (new_vec)((tree_check ((new_vec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 354, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
= have + 1;
355 memcpy (BINDING_VECTOR_CLUSTER_BASE (new_vec)(((tree_binding_vec *)(tree_check ((new_vec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 355, __FUNCTION__, (BINDING_VECTOR))))->vec)
,
356 BINDING_VECTOR_CLUSTER_BASE (*slot)(((tree_binding_vec *)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 356, __FUNCTION__, (BINDING_VECTOR))))->vec)
,
357 have * sizeof (binding_cluster));
358 *slot = new_vec;
359 }
360
361 binding_cluster *last = BINDING_VECTOR_CLUSTER_LAST (*slot)(&(((tree_binding_vec *)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 361, __FUNCTION__, (BINDING_VECTOR))))->vec[((tree_check
((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 361, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base) - 1]))
;
362 for (unsigned off = 0; off != BINDING_VECTOR_SLOTS_PER_CLUSTER2; off++)
363 if (!last->indices[off].span)
364 {
365 /* Fill the free slot of the cluster. */
366 last->indices[off].base = ix;
367 last->indices[off].span = 1;
368 last->slots[off] = NULL_TREE(tree) nullptr;
369 /* Check monotonicity. */
370 gcc_checking_assert (last[off ? 0 : -1]((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 373, __FUNCTION__), 0 : 0))
371 .indices[off ? off - 1((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 373, __FUNCTION__), 0 : 0))
372 : BINDING_VECTOR_SLOTS_PER_CLUSTER - 1]((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 373, __FUNCTION__), 0 : 0))
373 .base < ix)((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 373, __FUNCTION__), 0 : 0))
;
374 return &last->slots[off];
375 }
376
377 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 377, __FUNCTION__))
;
378}
379
380/* Add DECL to the list of things declared in binding level B. */
381
382static void
383add_decl_to_level (cp_binding_level *b, tree decl)
384{
385 gcc_assert (b->kind != sk_class)((void)(!(b->kind != sk_class) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 385, __FUNCTION__), 0 : 0))
;
386
387 /* Make sure we don't create a circular list. xref_tag can end
388 up pushing the same artificial decl more than once. We
389 should have already detected that in update_binding. (This isn't a
390 complete verification of non-circularity.) */
391 gcc_assert (b->names != decl)((void)(!(b->names != decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 391, __FUNCTION__), 0 : 0))
;
392
393 /* We build up the list in reverse order, and reverse it later if
394 necessary. */
395 TREE_CHAIN (decl)((contains_struct_check ((decl), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 395, __FUNCTION__))->common.chain)
= b->names;
396 b->names = decl;
397
398 /* If appropriate, add decl to separate list of statics. We include
399 extern variables because they might turn out to be static later.
400 It's OK for this list to contain a few false positives. */
401 if (b->kind == sk_namespace
402 && ((VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && (TREE_STATIC (decl)((decl)->base.static_flag) || DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 402, __FUNCTION__))->decl_common.decl_flag_1)
))
403 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
404 && (!TREE_PUBLIC (decl)((decl)->base.public_flag)
405 || decl_internal_context_p (decl)
406 || DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 406, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
))))
407 vec_safe_push (static_decls, decl);
408}
409
410/* Find the binding for NAME in the local binding level B. */
411
412static cxx_binding *
413find_local_binding (cp_binding_level *b, tree name)
414{
415 if (cxx_binding *binding = IDENTIFIER_BINDING (name)(((struct lang_identifier*)(tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 415, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
)
416 for (;; b = b->level_chain)
417 {
418 if (binding->scope == b)
419 return binding;
420
421 /* Cleanup contours are transparent to the language. */
422 if (b->kind != sk_cleanup)
423 break;
424 }
425 return NULLnullptr;
426}
427
428class name_lookup
429{
430public:
431 typedef std::pair<tree, tree> using_pair;
432 typedef auto_vec<using_pair, 16> using_queue;
433
434public:
435 tree name; /* The identifier being looked for. */
436
437 /* Usually we just add things to the VALUE binding, but we record
438 (hidden) IMPLICIT_TYPEDEFs on the type binding, which is used for
439 using-decl resolution. */
440 tree value; /* A (possibly ambiguous) set of things found. */
441 tree type; /* A type that has been found. */
442
443 LOOK_want want; /* What kind of entity we want. */
444
445 bool deduping; /* Full deduping is needed because using declarations
446 are in play. */
447 vec<tree, va_heap, vl_embed> *scopes;
448 name_lookup *previous; /* Previously active lookup. */
449
450protected:
451 /* Marked scope stack for outermost name lookup. */
452 static vec<tree, va_heap, vl_embed> *shared_scopes;
453 /* Currently active lookup. */
454 static name_lookup *active;
455
456public:
457 name_lookup (tree n, LOOK_want w = LOOK_want::NORMAL)
458 : name (n), value (NULL_TREE(tree) nullptr), type (NULL_TREE(tree) nullptr),
459 want (w),
460 deduping (false), scopes (NULLnullptr), previous (NULLnullptr)
461 {
462 preserve_state ();
463 }
464 ~name_lookup ()
465 {
466 gcc_checking_assert (!deduping)((void)(!(!deduping) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 466, __FUNCTION__), 0 : 0))
;
467 restore_state ();
468 }
469
470private: /* Uncopyable, unmovable, unassignable. I am a rock. */
471 name_lookup (const name_lookup &);
472 name_lookup &operator= (const name_lookup &);
473
474 public:
475 /* Turn on or off deduping mode. */
476 void dedup (bool state)
477 {
478 if (deduping != state)
479 {
480 deduping = state;
481 lookup_mark (value, state);
482 }
483 }
484
485protected:
486 static bool seen_p (tree scope)
487 {
488 return LOOKUP_SEEN_P (scope)((scope)->base.visited);
489 }
490 static bool found_p (tree scope)
491 {
492 return LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 492, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 492, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
;
493 }
494
495 void mark_seen (tree scope); /* Mark and add to scope vector. */
496 static void mark_found (tree scope)
497 {
498 gcc_checking_assert (seen_p (scope))((void)(!(seen_p (scope)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 498, __FUNCTION__), 0 : 0))
;
499 LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 499, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 499, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
500 }
501 bool see_and_mark (tree scope)
502 {
503 bool ret = seen_p (scope);
504 if (!ret)
505 mark_seen (scope);
506 return ret;
507 }
508 bool find_and_mark (tree scope);
509
510private:
511 void preserve_state ();
512 void restore_state ();
513
514private:
515 static tree ambiguous (tree thing, tree current);
516 void add_overload (tree fns);
517 void add_value (tree new_val);
518 void add_type (tree new_type);
519 bool process_binding (tree val_bind, tree type_bind);
520 unsigned process_module_binding (tree val_bind, tree type_bind, unsigned);
521 /* Look in only namespace. */
522 bool search_namespace_only (tree scope);
523 /* Look in namespace and its (recursive) inlines. Ignore using
524 directives. Return true if something found (inc dups). */
525 bool search_namespace (tree scope);
526 /* Look in the using directives of namespace + inlines using
527 qualified lookup rules. */
528 bool search_usings (tree scope);
529
530private:
531 void queue_namespace (using_queue& queue, int depth, tree scope);
532 void queue_usings (using_queue& queue, int depth, vec<tree, va_gc> *usings);
533
534private:
535 void add_fns (tree);
536
537 private:
538 void adl_expr (tree);
539 void adl_type (tree);
540 void adl_template_arg (tree);
541 void adl_class (tree);
542 void adl_enum (tree);
543 void adl_bases (tree);
544 void adl_class_only (tree);
545 void adl_namespace (tree);
546 void adl_class_fns (tree);
547 void adl_namespace_fns (tree, bitmap);
548
549public:
550 /* Search namespace + inlines + maybe usings as qualified lookup. */
551 bool search_qualified (tree scope, bool usings = true);
552
553 /* Search namespace + inlines + usings as unqualified lookup. */
554 bool search_unqualified (tree scope, cp_binding_level *);
555
556 /* ADL lookup of ARGS. */
557 tree search_adl (tree fns, vec<tree, va_gc> *args);
558};
559
560/* Scope stack shared by all outermost lookups. This avoids us
561 allocating and freeing on every single lookup. */
562vec<tree, va_heap, vl_embed> *name_lookup::shared_scopes;
563
564/* Currently active lookup. */
565name_lookup *name_lookup::active;
566
567/* Name lookup is recursive, becase ADL can cause template
568 instatiation. This is of course a rare event, so we optimize for
569 it not happening. When we discover an active name-lookup, which
570 must be an ADL lookup, we need to unmark the marked scopes and also
571 unmark the lookup we might have been accumulating. */
572
573void
574name_lookup::preserve_state ()
575{
576 previous = active;
577 if (previous)
578 {
579 unsigned length = vec_safe_length (previous->scopes);
580 vec_safe_reserve (previous->scopes, length * 2);
581 for (unsigned ix = length; ix--;)
582 {
583 tree decl = (*previous->scopes)[ix];
584
585 gcc_checking_assert (LOOKUP_SEEN_P (decl))((void)(!(((decl)->base.visited)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 585, __FUNCTION__), 0 : 0))
;
586 LOOKUP_SEEN_P (decl)((decl)->base.visited) = false;
587
588 /* Preserve the FOUND_P state on the interrupted lookup's
589 stack. */
590 if (LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 590, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 590, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
)
591 {
592 LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 592, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 592, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= false;
593 previous->scopes->quick_push (decl);
594 }
595 }
596
597 /* Unmark the outer partial lookup. */
598 if (previous->deduping)
599 lookup_mark (previous->value, false);
600 }
601 else
602 scopes = shared_scopes;
603 active = this;
604}
605
606/* Restore the marking state of a lookup we interrupted. */
607
608void
609name_lookup::restore_state ()
610{
611 gcc_checking_assert (!deduping)((void)(!(!deduping) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 611, __FUNCTION__), 0 : 0))
;
612
613 /* Unmark and empty this lookup's scope stack. */
614 for (unsigned ix = vec_safe_length (scopes); ix--;)
615 {
616 tree decl = scopes->pop ();
617 gcc_checking_assert (LOOKUP_SEEN_P (decl))((void)(!(((decl)->base.visited)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 617, __FUNCTION__), 0 : 0))
;
618 LOOKUP_SEEN_P (decl)((decl)->base.visited) = false;
619 LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 619, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 619, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= false;
620 }
621
622 active = previous;
623 if (previous)
624 {
625 free (scopes);
626
627 unsigned length = vec_safe_length (previous->scopes);
628 for (unsigned ix = 0; ix != length; ix++)
629 {
630 tree decl = (*previous->scopes)[ix];
631 if (LOOKUP_SEEN_P (decl)((decl)->base.visited))
632 {
633 /* The remainder of the scope stack must be recording
634 FOUND_P decls, which we want to pop off. */
635 do
636 {
637 tree decl = previous->scopes->pop ();
638 gcc_checking_assert (LOOKUP_SEEN_P (decl)((void)(!(((decl)->base.visited) && !((tree_not_check2
(((tree_check4 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 639, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 639, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 639, __FUNCTION__), 0 : 0))
639 && !LOOKUP_FOUND_P (decl))((void)(!(((decl)->base.visited) && !((tree_not_check2
(((tree_check4 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 639, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 639, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 639, __FUNCTION__), 0 : 0))
;
640 LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 640, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 640, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
641 }
642 while (++ix != length);
643 break;
644 }
645
646 gcc_checking_assert (!LOOKUP_FOUND_P (decl))((void)(!(!((tree_not_check2 (((tree_check4 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 646, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 646, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 646, __FUNCTION__), 0 : 0))
;
647 LOOKUP_SEEN_P (decl)((decl)->base.visited) = true;
648 }
649
650 /* Remark the outer partial lookup. */
651 if (previous->deduping)
652 lookup_mark (previous->value, true);
653 }
654 else
655 shared_scopes = scopes;
656}
657
658void
659name_lookup::mark_seen (tree scope)
660{
661 gcc_checking_assert (!seen_p (scope))((void)(!(!seen_p (scope)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 661, __FUNCTION__), 0 : 0))
;
662 LOOKUP_SEEN_P (scope)((scope)->base.visited) = true;
663 vec_safe_push (scopes, scope);
664}
665
666bool
667name_lookup::find_and_mark (tree scope)
668{
669 bool result = LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 669, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 669, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
;
670 if (!result)
671 {
672 LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 672, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 672, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
673 if (!LOOKUP_SEEN_P (scope)((scope)->base.visited))
674 vec_safe_push (scopes, scope);
675 }
676
677 return result;
678}
679
680/* THING and CURRENT are ambiguous, concatenate them. */
681
682tree
683name_lookup::ambiguous (tree thing, tree current)
684{
685 if (TREE_CODE (current)((enum tree_code) (current)->base.code) != TREE_LIST)
686 {
687 current = build_tree_list (NULL_TREE(tree) nullptr, current);
688 TREE_TYPE (current)((contains_struct_check ((current), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 688, __FUNCTION__))->typed.type)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
689 }
690 current = tree_cons (NULL_TREE(tree) nullptr, thing, current);
691 TREE_TYPE (current)((contains_struct_check ((current), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 691, __FUNCTION__))->typed.type)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
692
693 return current;
694}
695
696/* FNS is a new overload set to add to the exising set. */
697
698void
699name_lookup::add_overload (tree fns)
700{
701 if (!deduping && TREE_CODE (fns)((enum tree_code) (fns)->base.code) == OVERLOAD)
702 {
703 tree probe = fns;
704 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
705 probe = ovl_skip_hidden (probe);
706 if (probe && TREE_CODE (probe)((enum tree_code) (probe)->base.code) == OVERLOAD
707 && OVL_DEDUP_P (probe)((tree_not_check2 (((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 707, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 707, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
708 /* We're about to add something found by multiple paths, so need to
709 engage deduping mode. */
710 dedup (true);
711 }
712
713 value = lookup_maybe_add (fns, value, deduping);
714}
715
716/* Add a NEW_VAL, a found value binding into the current value binding. */
717
718void
719name_lookup::add_value (tree new_val)
720{
721 if (OVL_P (new_val)(((enum tree_code) (new_val)->base.code) == FUNCTION_DECL ||
((enum tree_code) (new_val)->base.code) == OVERLOAD)
&& (!value || OVL_P (value)(((enum tree_code) (value)->base.code) == FUNCTION_DECL ||
((enum tree_code) (value)->base.code) == OVERLOAD)
))
722 add_overload (new_val);
723 else if (!value)
724 value = new_val;
725 else if (value == new_val)
726 ;
727 else if ((TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL
728 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == TYPE_DECL
729 && same_type_p (TREE_TYPE (value), TREE_TYPE (new_val))comptypes ((((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 729, __FUNCTION__))->typed.type)), (((contains_struct_check
((new_val), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 729, __FUNCTION__))->typed.type)), 0)
))
730 /* Typedefs to the same type. */;
731 else if (TREE_CODE (value)((enum tree_code) (value)->base.code) == NAMESPACE_DECL
732 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == NAMESPACE_DECL
733 && ORIGINAL_NAMESPACE (value)(((contains_struct_check (((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__))->decl_common.abstract_origin) : (value
))
== ORIGINAL_NAMESPACE (new_val)(((contains_struct_check (((tree_check ((new_val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((new_val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 733, __FUNCTION__))->decl_common.abstract_origin) : (new_val
))
)
734 /* Namespace (possibly aliased) to the same namespace. Locate
735 the namespace*/
736 value = ORIGINAL_NAMESPACE (value)(((contains_struct_check (((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 736, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 736, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 736, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 736, __FUNCTION__))->decl_common.abstract_origin) : (value
))
;
737 else
738 {
739 /* Disengage deduping mode. */
740 dedup (false);
741 value = ambiguous (new_val, value);
742 }
743}
744
745/* Add a NEW_TYPE, a found type binding into the current type binding. */
746
747void
748name_lookup::add_type (tree new_type)
749{
750 if (!type)
751 type = new_type;
752 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == TREE_LIST
753 || !same_type_p (TREE_TYPE (type), TREE_TYPE (new_type))comptypes ((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 753, __FUNCTION__))->typed.type)), (((contains_struct_check
((new_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 753, __FUNCTION__))->typed.type)), 0)
)
754 type = ambiguous (new_type, type);
755}
756
757/* Process a found binding containing NEW_VAL and NEW_TYPE. Returns
758 true if we actually found something noteworthy. Hiddenness has
759 already been handled in the caller. */
760
761bool
762name_lookup::process_binding (tree new_val, tree new_type)
763{
764 /* Did we really see a type? */
765 if (new_type
766 && (want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::NAMESPACE)
767 new_type = NULL_TREE(tree) nullptr;
768
769 /* Do we really see a value? */
770 if (new_val)
771 switch (TREE_CODE (new_val)((enum tree_code) (new_val)->base.code))
772 {
773 case TEMPLATE_DECL:
774 /* If we expect types or namespaces, and not templates,
775 or this is not a template class. */
776 if (bool (want & LOOK_want::TYPE_NAMESPACE)
777 && !DECL_TYPE_TEMPLATE_P (new_val)(((enum tree_code) (new_val)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((new_val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 777, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((new_val
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 777, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == TYPE_DECL)
)
778 new_val = NULL_TREE(tree) nullptr;
779 break;
780 case TYPE_DECL:
781 if ((want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::NAMESPACE
782 || (new_type && bool (want & LOOK_want::TYPE)))
783 new_val = NULL_TREE(tree) nullptr;
784 break;
785 case NAMESPACE_DECL:
786 if ((want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::TYPE)
787 new_val = NULL_TREE(tree) nullptr;
788 break;
789 default:
790 if (bool (want & LOOK_want::TYPE_NAMESPACE))
791 new_val = NULL_TREE(tree) nullptr;
792 }
793
794 if (!new_val)
795 {
796 new_val = new_type;
797 new_type = NULL_TREE(tree) nullptr;
798 }
799
800 /* Merge into the lookup */
801 if (new_val)
802 add_value (new_val);
803 if (new_type)
804 add_type (new_type);
805
806 return new_val != NULL_TREE(tree) nullptr;
807}
808
809/* If we're importing a module containing this binding, add it to the
810 lookup set. The trickiness is with namespaces, we only want to
811 find it once. */
812
813unsigned
814name_lookup::process_module_binding (tree new_val, tree new_type,
815 unsigned marker)
816{
817 /* Optimize for (re-)finding a public namespace. We only need to
818 look once. */
819 if (new_val && !new_type
820 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == NAMESPACE_DECL
821 && TREE_PUBLIC (new_val)((new_val)->base.public_flag)
822 && !DECL_NAMESPACE_ALIAS (new_val)((contains_struct_check (((tree_check ((new_val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 822, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 822, __FUNCTION__))->decl_common.abstract_origin)
)
823 {
824 if (marker & 2)
825 return marker;
826 marker |= 2;
827 }
828
829 if (new_type || new_val)
830 marker |= process_binding (new_val, new_type);
831
832 return marker;
833}
834
835/* Look in exactly namespace SCOPE. */
836
837bool
838name_lookup::search_namespace_only (tree scope)
839{
840 bool found = false;
841 if (tree *binding = find_namespace_slot (scope, name))
842 {
843 tree val = *binding;
844 if (TREE_CODE (val)((enum tree_code) (val)->base.code) == BINDING_VECTOR)
845 {
846 /* I presume the binding list is going to be sparser than
847 the import bitmap. Hence iterate over the former
848 checking for bits set in the bitmap. */
849 bitmap imports = get_import_bitmap ();
850 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (val)(((tree_binding_vec *)(tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 850, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
851 int marker = 0;
852 int dup_detect = 0;
853
854 if (tree bind = cluster->slots[BINDING_SLOT_CURRENT])
855 {
856 if (!deduping)
857 {
858 if (named_module_purview_p ())
859 {
860 dup_detect |= 2;
861
862 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 862, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 862, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 862, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
863 dup_detect |= 1;
864 }
865 else
866 dup_detect |= 1;
867 }
868 tree type = NULL_TREE(tree) nullptr;
869 tree value = bind;
870
871 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 871, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 871, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
872 {
873 type = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 873, __FUNCTION__))->typed.type)
;
874 value = STAT_DECL (bind)(((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 874, __FUNCTION__, (OVERLOAD))))->function)
;
875
876 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
877 {
878 if (STAT_TYPE_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 878, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 878, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
879 type = NULL_TREE(tree) nullptr;
880 if (STAT_DECL_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 880, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 880, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
881 value = NULL_TREE(tree) nullptr;
882 else
883 value = ovl_skip_hidden (value);
884 }
885 }
886 else if (!bool (want & LOOK_want::HIDDEN_FRIEND))
887 value = ovl_skip_hidden (value);
888
889 marker = process_module_binding (value, type, marker);
890 }
891
892 /* Scan the imported bindings. */
893 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (val)((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 893, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
894 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
895 {
896 ix--;
897 cluster++;
898 }
899
900 /* Do this in forward order, so we load modules in an order
901 the user expects. */
902 for (; ix--; cluster++)
903 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
904 {
905 /* Are we importing this module? */
906 if (unsigned base = cluster->indices[jx].base)
907 if (unsigned span = cluster->indices[jx].span)
908 do
909 if (bitmap_bit_p (imports, base))
910 goto found;
911 while (++base, --span);
912 continue;
913
914 found:;
915 /* Is it loaded? */
916 if (cluster->slots[jx].is_lazy ())
917 {
918 gcc_assert (cluster->indices[jx].span == 1)((void)(!(cluster->indices[jx].span == 1) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 918, __FUNCTION__), 0 : 0))
;
919 lazy_load_binding (cluster->indices[jx].base,
920 scope, name, &cluster->slots[jx]);
921 }
922 tree bind = cluster->slots[jx];
923 if (!bind)
924 /* Load errors could mean there's nothing here. */
925 continue;
926
927 /* Extract what we can see from here. If there's no
928 stat_hack, then everything was exported. */
929 tree type = NULL_TREE(tree) nullptr;
930
931
932 /* If STAT_HACK_P is false, everything is visible, and
933 there's no duplication possibilities. */
934 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 934, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 934, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
935 {
936 if (!deduping)
937 {
938 /* Do we need to engage deduplication? */
939 int dup = 0;
940 if (MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 940, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
941 dup = 1;
942 else if (MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 942, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
943 dup = 2;
944 if (unsigned hit = dup_detect & dup)
945 {
946 if ((hit & 1 && BINDING_VECTOR_GLOBAL_DUPS_P (val)((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 946, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag)
)
947 || (hit & 2
948 && BINDING_VECTOR_PARTITION_DUPS_P (val)((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 948, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
))
949 dedup (true);
950 }
951 dup_detect |= dup;
952 }
953
954 if (STAT_TYPE_VISIBLE_P (bind)(((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 954, __FUNCTION__, (OVERLOAD))))->base.used_flag)
)
955 type = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 955, __FUNCTION__))->typed.type)
;
956 bind = STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 956, __FUNCTION__, (OVERLOAD))))->common.chain)
;
957 }
958
959 /* And process it. */
960 marker = process_module_binding (bind, type, marker);
961 }
962 found |= marker & 1;
963 }
964 else
965 {
966 /* Only a current module binding, visible from the current module. */
967 tree bind = *binding;
968 tree value = bind, type = NULL_TREE(tree) nullptr;
969
970 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 970, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 970, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
971 {
972 type = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 972, __FUNCTION__))->typed.type)
;
973 value = STAT_DECL (bind)(((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 973, __FUNCTION__, (OVERLOAD))))->function)
;
974
975 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
976 {
977 if (STAT_TYPE_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 977, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 977, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
978 type = NULL_TREE(tree) nullptr;
979 if (STAT_DECL_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 979, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 979, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
980 value = NULL_TREE(tree) nullptr;
981 else
982 value = ovl_skip_hidden (value);
983 }
984 }
985 else if (!bool (want & LOOK_want::HIDDEN_FRIEND))
986 value = ovl_skip_hidden (value);
987
988 found |= process_binding (value, type);
989 }
990 }
991
992 return found;
993}
994
995/* Conditionally look in namespace SCOPE and inline children. */
996
997bool
998name_lookup::search_namespace (tree scope)
999{
1000 if (see_and_mark (scope))
1001 /* We've visited this scope before. Return what we found then. */
1002 return found_p (scope);
1003
1004 /* Look in exactly namespace. */
1005 bool found = search_namespace_only (scope);
1006
1007 /* Don't look into inline children, if we're looking for an
1008 anonymous name -- it must be in the current scope, if anywhere. */
1009 if (name)
1010 /* Recursively look in its inline children. */
1011 if (vec<tree, va_gc> *inlinees = DECL_NAMESPACE_INLINEES (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1011, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1011, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1012 for (unsigned ix = inlinees->length (); ix--;)
1013 found |= search_namespace ((*inlinees)[ix]);
1014
1015 if (found)
1016 mark_found (scope);
1017
1018 return found;
1019}
1020
1021/* Recursively follow using directives of SCOPE & its inline children.
1022 Such following is essentially a flood-fill algorithm. */
1023
1024bool
1025name_lookup::search_usings (tree scope)
1026{
1027 /* We do not check seen_p here, as that was already set during the
1028 namespace_only walk. */
1029 if (found_p (scope))
1030 return true;
1031
1032 bool found = false;
1033 if (vec<tree, va_gc> *usings = NAMESPACE_LEVEL (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1033, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1033, __FUNCTION__); &lt->u.ns; })->level)
->using_directives)
1034 for (unsigned ix = usings->length (); ix--;)
1035 found |= search_qualified ((*usings)[ix], true);
1036
1037 /* Look in its inline children. */
1038 if (vec<tree, va_gc> *inlinees = DECL_NAMESPACE_INLINEES (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1038, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1038, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1039 for (unsigned ix = inlinees->length (); ix--;)
1040 found |= search_usings ((*inlinees)[ix]);
1041
1042 if (found)
1043 mark_found (scope);
1044
1045 return found;
1046}
1047
1048/* Qualified namespace lookup in SCOPE.
1049 1) Look in SCOPE (+inlines). If found, we're done.
1050 2) Otherwise, if USINGS is true,
1051 recurse for every using directive of SCOPE (+inlines).
1052
1053 Trickiness is (a) loops and (b) multiple paths to same namespace.
1054 In both cases we want to not repeat any lookups, and know whether
1055 to stop the caller's step #2. Do this via the FOUND_P marker. */
1056
1057bool
1058name_lookup::search_qualified (tree scope, bool usings)
1059{
1060 bool found = false;
1061
1062 if (seen_p (scope))
1063 found = found_p (scope);
1064 else
1065 {
1066 found = search_namespace (scope);
1067 if (!found && usings)
1068 found = search_usings (scope);
1069 }
1070
1071 dedup (false);
1072
1073 return found;
1074}
1075
1076/* Add SCOPE to the unqualified search queue, recursively add its
1077 inlines and those via using directives. */
1078
1079void
1080name_lookup::queue_namespace (using_queue& queue, int depth, tree scope)
1081{
1082 if (see_and_mark (scope))
1083 return;
1084
1085 /* Record it. */
1086 tree common = scope;
1087 while (SCOPE_DEPTH (common)((tree_check ((common), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1087, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
> depth)
1088 common = CP_DECL_CONTEXT (common)(!(! (((contains_struct_check ((common), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1088, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((common), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1088, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((common
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1088, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1089 queue.safe_push (using_pair (common, scope));
1090
1091 /* Queue its inline children. */
1092 if (vec<tree, va_gc> *inlinees = DECL_NAMESPACE_INLINEES (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1092, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1092, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1093 for (unsigned ix = inlinees->length (); ix--;)
1094 queue_namespace (queue, depth, (*inlinees)[ix]);
1095
1096 /* Queue its using targets. */
1097 queue_usings (queue, depth, NAMESPACE_LEVEL (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1097, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1097, __FUNCTION__); &lt->u.ns; })->level)
->using_directives);
1098}
1099
1100/* Add the namespaces in USINGS to the unqualified search queue. */
1101
1102void
1103name_lookup::queue_usings (using_queue& queue, int depth, vec<tree, va_gc> *usings)
1104{
1105 if (usings)
1106 for (unsigned ix = usings->length (); ix--;)
1107 queue_namespace (queue, depth, (*usings)[ix]);
1108}
1109
1110/* Unqualified namespace lookup in SCOPE.
1111 1) add scope+inlins to worklist.
1112 2) recursively add target of every using directive
1113 3) for each worklist item where SCOPE is common ancestor, search it
1114 4) if nothing find, scope=parent, goto 1. */
1115
1116bool
1117name_lookup::search_unqualified (tree scope, cp_binding_level *level)
1118{
1119 using_queue queue;
1120 bool found = false;
1121
1122 /* Queue local using-directives. */
1123 for (; level->kind != sk_namespace; level = level->level_chain)
1124 queue_usings (queue, SCOPE_DEPTH (scope)((tree_check ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1124, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
, level->using_directives);
1125
1126 for (; !found; scope = CP_DECL_CONTEXT (scope)(!(! (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1126, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1126, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((scope
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1126, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
)
1127 {
1128 gcc_assert (!DECL_NAMESPACE_ALIAS (scope))((void)(!(!((contains_struct_check (((tree_check ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1128, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1128, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1128, __FUNCTION__), 0 : 0))
;
1129 int depth = SCOPE_DEPTH (scope)((tree_check ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1129, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
;
1130
1131 /* Queue namespaces reachable from SCOPE. */
1132 queue_namespace (queue, depth, scope);
1133
1134 /* Search every queued namespace where SCOPE is the common
1135 ancestor. Adjust the others. */
1136 unsigned ix = 0;
1137 do
1138 {
1139 using_pair &pair = queue[ix];
1140 while (pair.first == scope)
1141 {
1142 found |= search_namespace_only (pair.second);
1143 pair = queue.pop ();
1144 if (ix == queue.length ())
1145 goto done;
1146 }
1147 /* The depth is the same as SCOPE, find the parent scope. */
1148 if (SCOPE_DEPTH (pair.first)((tree_check ((pair.first), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1148, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
== depth)
1149 pair.first = CP_DECL_CONTEXT (pair.first)(!(! (((contains_struct_check ((pair.first), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((pair.first), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((pair.
first), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1150 ix++;
1151 }
1152 while (ix < queue.length ());
1153 done:;
1154 if (scope == global_namespacecp_global_trees[CPTI_GLOBAL])
1155 break;
1156
1157 /* If looking for hidden friends, we only look in the innermost
1158 namespace scope. [namespace.memdef]/3 If a friend
1159 declaration in a non-local class first declares a class,
1160 function, class template or function template the friend is a
1161 member of the innermost enclosing namespace. See also
1162 [basic.lookup.unqual]/7 */
1163 if (bool (want & LOOK_want::HIDDEN_FRIEND))
1164 break;
1165 }
1166
1167 dedup (false);
1168
1169 return found;
1170}
1171
1172/* FNS is a value binding. If it is a (set of overloaded) functions,
1173 add them into the current value. */
1174
1175void
1176name_lookup::add_fns (tree fns)
1177{
1178 if (!fns)
1179 return;
1180 else if (TREE_CODE (fns)((enum tree_code) (fns)->base.code) == OVERLOAD)
1181 {
1182 if (TREE_TYPE (fns)((contains_struct_check ((fns), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1182, __FUNCTION__))->typed.type)
!= unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE])
1183 fns = OVL_FUNCTION (fns)(((struct tree_overload*)(tree_check ((fns), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1183, __FUNCTION__, (OVERLOAD))))->function)
;
1184 }
1185 else if (!DECL_DECLARES_FUNCTION_P (fns)(((enum tree_code) (fns)->base.code) == FUNCTION_DECL || (
((enum tree_code) (fns)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fns), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1185, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fns)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1185, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
1186 return;
1187
1188 add_overload (fns);
1189}
1190
1191/* Add the overloaded fns of SCOPE. */
1192
1193void
1194name_lookup::adl_namespace_fns (tree scope, bitmap imports)
1195{
1196 if (tree *binding = find_namespace_slot (scope, name))
1197 {
1198 tree val = *binding;
1199 if (TREE_CODE (val)((enum tree_code) (val)->base.code) != BINDING_VECTOR)
1200 add_fns (ovl_skip_hidden (MAYBE_STAT_DECL (val)(((val) && ((enum tree_code) (val)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1200, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1200, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((val),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1200, __FUNCTION__, (OVERLOAD))))->function) : val)
));
1201 else
1202 {
1203 /* I presume the binding list is going to be sparser than
1204 the import bitmap. Hence iterate over the former
1205 checking for bits set in the bitmap. */
1206 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (val)(((tree_binding_vec *)(tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1206, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
1207 int dup_detect = 0;
1208
1209 if (tree bind = cluster->slots[BINDING_SLOT_CURRENT])
1210 {
1211 /* The current TU's bindings must be visible, we don't
1212 need to check the bitmaps. */
1213
1214 if (!deduping)
1215 {
1216 if (named_module_purview_p ())
1217 {
1218 dup_detect |= 2;
1219
1220 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1220, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1220, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1220, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
1221 dup_detect |= 1;
1222 }
1223 else
1224 dup_detect |= 1;
1225 }
1226
1227 add_fns (ovl_skip_hidden (MAYBE_STAT_DECL (bind)(((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1227, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1227, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((bind)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1227, __FUNCTION__, (OVERLOAD))))->function) : bind)
));
1228 }
1229
1230 /* Scan the imported bindings. */
1231 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (val)((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1231, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
1232 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
1233 {
1234 ix--;
1235 cluster++;
1236 }
1237
1238 /* Do this in forward order, so we load modules in an order
1239 the user expects. */
1240 for (; ix--; cluster++)
1241 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
1242 {
1243 /* Functions are never on merged slots. */
1244 if (!cluster->indices[jx].base
1245 || cluster->indices[jx].span != 1)
1246 continue;
1247
1248 /* Is this slot visible? */
1249 if (!bitmap_bit_p (imports, cluster->indices[jx].base))
1250 continue;
1251
1252 /* Is it loaded. */
1253 if (cluster->slots[jx].is_lazy ())
1254 lazy_load_binding (cluster->indices[jx].base,
1255 scope, name, &cluster->slots[jx]);
1256
1257 tree bind = cluster->slots[jx];
1258 if (!bind)
1259 /* Load errors could mean there's nothing here. */
1260 continue;
1261
1262 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1262, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1262, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1263 {
1264 if (!deduping)
1265 {
1266 /* Do we need to engage deduplication? */
1267 int dup = 0;
1268 if (MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1268, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
1269 dup = 1;
1270 else if (MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1270, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
1271 dup = 2;
1272 if (unsigned hit = dup_detect & dup)
1273 if ((hit & 1 && BINDING_VECTOR_GLOBAL_DUPS_P (val)((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1273, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag
)
)
1274 || (hit & 2
1275 && BINDING_VECTOR_PARTITION_DUPS_P (val)((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1275, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
))
1276 dedup (true);
1277 dup_detect |= dup;
1278 }
1279
1280 bind = STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1280, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1281 }
1282
1283 add_fns (bind);
1284 }
1285 }
1286 }
1287}
1288
1289/* Add the hidden friends of SCOPE. */
1290
1291void
1292name_lookup::adl_class_fns (tree type)
1293{
1294 /* Add friends. */
1295 for (tree list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type))(((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1295, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1295, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1295, __FUNCTION__))->common.chain)))), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1295, __FUNCTION__))->decl_common.initial))
;
1296 list; list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1296, __FUNCTION__))->common.chain)
)
1297 if (name == FRIEND_NAME (list)(((tree_check ((list), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1297, __FUNCTION__, (TREE_LIST)))->list.purpose))
)
1298 {
1299 tree context = NULL_TREE(tree) nullptr; /* Lazily computed. */
1300 for (tree friends = FRIEND_DECLS (list)(((tree_check ((list), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1300, __FUNCTION__, (TREE_LIST)))->list.value))
; friends;
1301 friends = TREE_CHAIN (friends)((contains_struct_check ((friends), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1301, __FUNCTION__))->common.chain)
)
1302 {
1303 tree fn = TREE_VALUE (friends)((tree_check ((friends), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1303, __FUNCTION__, (TREE_LIST)))->list.value)
;
1304
1305 /* Only interested in global functions with potentially hidden
1306 (i.e. unqualified) declarations. */
1307 if (!context)
1308 context = decl_namespace_context (type);
1309 if (CP_DECL_CONTEXT (fn)(!(! (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1309, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1309, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((fn), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1309, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
!= context)
1310 continue;
1311
1312 dedup (true);
1313
1314 /* Template specializations are never found by name lookup.
1315 (Templates themselves can be found, but not template
1316 specializations.) */
1317 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL && DECL_USE_TEMPLATE (fn)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1317, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
)
1318 continue;
1319
1320 add_fns (fn);
1321 }
1322 }
1323}
1324
1325/* Find the containing non-inlined namespace, add it and all its
1326 inlinees. */
1327
1328void
1329name_lookup::adl_namespace (tree scope)
1330{
1331 if (see_and_mark (scope))
1332 return;
1333
1334 /* Look down into inline namespaces. */
1335 if (vec<tree, va_gc> *inlinees = DECL_NAMESPACE_INLINEES (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1335, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1335, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1336 for (unsigned ix = inlinees->length (); ix--;)
1337 adl_namespace ((*inlinees)[ix]);
1338
1339 if (DECL_NAMESPACE_INLINE_P (scope)((tree_not_check2 (((tree_check ((scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1339, __FUNCTION__, (NAMESPACE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1339, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
1340 /* Mark parent. */
1341 adl_namespace (CP_DECL_CONTEXT (scope)(!(! (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1341, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1341, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((scope
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1341, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
);
1342}
1343
1344/* Adds the class and its friends to the lookup structure. */
1345
1346void
1347name_lookup::adl_class_only (tree type)
1348{
1349 /* Backend-built structures, such as __builtin_va_list, aren't
1350 affected by all this. */
1351 if (!CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1351, __FUNCTION__))->type_common.lang_flag_5))
)
1352 return;
1353
1354 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1354, __FUNCTION__))->type_common.main_variant)
;
1355
1356 if (see_and_mark (type))
1357 return;
1358
1359 tree context = decl_namespace_context (type);
1360 adl_namespace (context);
1361}
1362
1363/* Adds the class and its bases to the lookup structure.
1364 Returns true on error. */
1365
1366void
1367name_lookup::adl_bases (tree type)
1368{
1369 adl_class_only (type);
1370
1371 /* Process baseclasses. */
1372 if (tree binfo = TYPE_BINFO (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1372, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.maxval)
)
1373 {
1374 tree base_binfo;
1375 int i;
1376
1377 for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1377, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)->
iterate ((i), &(base_binfo)))
; i++)
1378 adl_bases (BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1378, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1378, __FUNCTION__))->typed.type)
);
1379 }
1380}
1381
1382/* Adds everything associated with a class argument type to the lookup
1383 structure.
1384
1385 If T is a class type (including unions), its associated classes are: the
1386 class itself; the class of which it is a member, if any; and its direct
1387 and indirect base classes. Its associated namespaces are the namespaces
1388 of which its associated classes are members. Furthermore, if T is a
1389 class template specialization, its associated namespaces and classes
1390 also include: the namespaces and classes associated with the types of
1391 the template arguments provided for template type parameters (excluding
1392 template template parameters); the namespaces of which any template
1393 template arguments are members; and the classes of which any member
1394 templates used as template template arguments are members. [ Note:
1395 non-type template arguments do not contribute to the set of associated
1396 namespaces. --end note] */
1397
1398void
1399name_lookup::adl_class (tree type)
1400{
1401 /* Backend build structures, such as __builtin_va_list, aren't
1402 affected by all this. */
1403 if (!CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1403, __FUNCTION__))->type_common.lang_flag_5))
)
1404 return;
1405
1406 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1406, __FUNCTION__))->type_common.main_variant)
;
1407
1408 /* We don't set found here because we have to have set seen first,
1409 which is done in the adl_bases walk. */
1410 if (found_p (type))
1411 return;
1412
1413 complete_type (type);
1414 adl_bases (type);
1415 mark_found (type);
1416
1417 if (TYPE_CLASS_SCOPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1417, __FUNCTION__))->type_common.context) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1417, __FUNCTION__))->type_common.context))->base.code
))] == tcc_type))
)
1418 adl_class_only (TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1418, __FUNCTION__))->type_common.context)
);
1419
1420 /* Process template arguments. */
1421 if (CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1421, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1421, __FUNCTION__))->type_non_common.lang_1))
1422 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (type))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((tree_class_check (((tree_check3
((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1422, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
1423 {
1424 tree list = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type))(get_innermost_template_args ((((struct tree_template_info*)(
tree_check (((((tree_class_check (((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1424, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1424, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1424, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
;
1425 for (int i = 0; i < TREE_VEC_LENGTH (list)((tree_check ((list), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1425, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
1426 adl_template_arg (TREE_VEC_ELT (list, i)(*((const_cast<tree *> (tree_vec_elt_check ((list), (i)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1426, __FUNCTION__)))))
);
1427 }
1428}
1429
1430void
1431name_lookup::adl_enum (tree type)
1432{
1433 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1433, __FUNCTION__))->type_common.main_variant)
;
1434 if (see_and_mark (type))
1435 return;
1436
1437 if (TYPE_CLASS_SCOPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1437, __FUNCTION__))->type_common.context) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1437, __FUNCTION__))->type_common.context))->base.code
))] == tcc_type))
)
1438 adl_class_only (TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1438, __FUNCTION__))->type_common.context)
);
1439 else
1440 adl_namespace (decl_namespace_context (type));
1441}
1442
1443void
1444name_lookup::adl_expr (tree expr)
1445{
1446 if (!expr)
1447 return;
1448
1449 gcc_assert (!TYPE_P (expr))((void)(!(!(tree_code_type_tmpl <0>::tree_code_type[(int
) (((enum tree_code) (expr)->base.code))] == tcc_type)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1449, __FUNCTION__), 0 : 0))
;
1450
1451 if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1451, __FUNCTION__))->typed.type)
!= unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE])
1452 {
1453 adl_type (unlowered_expr_type (expr));
1454 return;
1455 }
1456
1457 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == ADDR_EXPR)
1458 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1458, __FUNCTION__)))))
;
1459 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPONENT_REF
1460 || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == OFFSET_REF)
1461 expr = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1461, __FUNCTION__)))))
;
1462 expr = MAYBE_BASELINK_FUNCTIONS (expr)((((enum tree_code) (expr)->base.code) == BASELINK) ? (((struct
tree_baselink*) (tree_check ((expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1462, __FUNCTION__, (BASELINK))))->functions) : expr)
;
1463
1464 if (OVL_P (expr)(((enum tree_code) (expr)->base.code) == FUNCTION_DECL || (
(enum tree_code) (expr)->base.code) == OVERLOAD)
)
1465 for (lkp_iterator iter (expr); iter; ++iter)
1466 adl_type (TREE_TYPE (*iter)((contains_struct_check ((*iter), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1466, __FUNCTION__))->typed.type)
);
1467 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == TEMPLATE_ID_EXPR)
1468 {
1469 /* The working paper doesn't currently say how to handle
1470 template-id arguments. The sensible thing would seem to be
1471 to handle the list of template candidates like a normal
1472 overload set, and handle the template arguments like we do
1473 for class template specializations. */
1474
1475 /* First the templates. */
1476 adl_expr (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1476, __FUNCTION__)))))
);
1477
1478 /* Now the arguments. */
1479 if (tree args = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1479, __FUNCTION__)))))
)
1480 for (int ix = TREE_VEC_LENGTH (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1480, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ix--;)
1481 adl_template_arg (TREE_VEC_ELT (args, ix)(*((const_cast<tree *> (tree_vec_elt_check ((args), (ix
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1481, __FUNCTION__)))))
);
1482 }
1483}
1484
1485void
1486name_lookup::adl_type (tree type)
1487{
1488 if (!type)
1489 return;
1490
1491 if (TYPE_PTRDATAMEM_P (type)(((enum tree_code) (type)->base.code) == OFFSET_TYPE))
1492 {
1493 /* Pointer to member: associate class type and value type. */
1494 adl_type (TYPE_PTRMEM_CLASS_TYPE (type)((((enum tree_code) (type)->base.code) == OFFSET_TYPE) ? (
(tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1494, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type
(((contains_struct_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1494, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1494, __FUNCTION__))->typed.type), cp_type_quals (type))
)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1494, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1494, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
);
1495 adl_type (TYPE_PTRMEM_POINTED_TO_TYPE (type)((((enum tree_code) (type)->base.code) == OFFSET_TYPE) ? (
(contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1495, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type (((contains_struct_check ((((tree_check3
((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1495, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1495, __FUNCTION__))->typed.type), cp_type_quals (type))
)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1495, __FUNCTION__))->typed.type))
);
1496 return;
1497 }
1498
1499 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
1500 {
1501 case RECORD_TYPE:
1502 if (TYPE_PTRMEMFUNC_P (type)(((enum tree_code) (type)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1502, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1502, __FUNCTION__))->type_common.lang_flag_2)))
)
1503 {
1504 adl_type (TYPE_PTRMEMFUNC_FN_TYPE (type)(cp_build_qualified_type (((contains_struct_check ((((tree_check3
((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1504, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1504, __FUNCTION__))->typed.type), cp_type_quals (type))
)
);
1505 return;
1506 }
1507 /* FALLTHRU */
1508 case UNION_TYPE:
1509 adl_class (type);
1510 return;
1511
1512 case METHOD_TYPE:
1513 /* The basetype is referenced in the first arg type, so just
1514 fall through. */
1515 case FUNCTION_TYPE:
1516 /* Associate the parameter types. */
1517 for (tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1517, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
; args; args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1517, __FUNCTION__))->common.chain)
)
1518 adl_type (TREE_VALUE (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1518, __FUNCTION__, (TREE_LIST)))->list.value)
);
1519 /* FALLTHROUGH */
1520
1521 case POINTER_TYPE:
1522 case REFERENCE_TYPE:
1523 case ARRAY_TYPE:
1524 adl_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1524, __FUNCTION__))->typed.type)
);
1525 return;
1526
1527 case ENUMERAL_TYPE:
1528 adl_enum (type);
1529 return;
1530
1531 case LANG_TYPE:
1532 gcc_assert (type == unknown_type_node((void)(!(type == cp_global_trees[CPTI_UNKNOWN_TYPE] || type ==
cp_global_trees[CPTI_INIT_LIST_TYPE]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1533, __FUNCTION__), 0 : 0))
1533 || type == init_list_type_node)((void)(!(type == cp_global_trees[CPTI_UNKNOWN_TYPE] || type ==
cp_global_trees[CPTI_INIT_LIST_TYPE]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1533, __FUNCTION__), 0 : 0))
;
1534 return;
1535
1536 case TYPE_PACK_EXPANSION:
1537 adl_type (PACK_EXPANSION_PATTERN (type)(((enum tree_code) ((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1537, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check
((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1537, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((type), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1537, __FUNCTION__))))))
);
1538 return;
1539
1540 default:
1541 break;
1542 }
1543}
1544
1545/* Adds everything associated with a template argument to the lookup
1546 structure. */
1547
1548void
1549name_lookup::adl_template_arg (tree arg)
1550{
1551 /* [basic.lookup.koenig]
1552
1553 If T is a template-id, its associated namespaces and classes are
1554 ... the namespaces and classes associated with the types of the
1555 template arguments provided for template type parameters
1556 (excluding template template parameters); the namespaces in which
1557 any template template arguments are defined; and the classes in
1558 which any member templates used as template template arguments
1559 are defined. [Note: non-type template arguments do not
1560 contribute to the set of associated namespaces. ] */
1561
1562 /* Consider first template template arguments. */
1563 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_TEMPLATE_PARM
1564 || TREE_CODE (arg)((enum tree_code) (arg)->base.code) == UNBOUND_CLASS_TEMPLATE)
1565 ;
1566 else if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL)
1567 {
1568 tree ctx = CP_DECL_CONTEXT (arg)(!(! (((contains_struct_check ((arg), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1568, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((arg), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1568, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((arg),
(TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1568, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1569
1570 /* It's not a member template. */
1571 if (TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) == NAMESPACE_DECL)
1572 adl_namespace (ctx);
1573 /* Otherwise, it must be member template. */
1574 else
1575 adl_class_only (ctx);
1576 }
1577 /* It's an argument pack; handle it recursively. */
1578 else if (ARGUMENT_PACK_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
|| ((enum tree_code) (arg)->base.code) == NONTYPE_ARGUMENT_PACK
)
)
1579 {
1580 tree args = ARGUMENT_PACK_ARGS (arg)(((enum tree_code) ((tree_check2 ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1580, __FUNCTION__, (TYPE_ARGUMENT_PACK), (NONTYPE_ARGUMENT_PACK
))))->base.code) == TYPE_ARGUMENT_PACK ? ((contains_struct_check
((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1580, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1580, __FUNCTION__))))))
;
1581 int i, len = TREE_VEC_LENGTH (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1581, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
1582 for (i = 0; i < len; ++i)
1583 adl_template_arg (TREE_VEC_ELT (args, i)(*((const_cast<tree *> (tree_vec_elt_check ((args), (i)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1583, __FUNCTION__)))))
);
1584 }
1585 /* It's not a template template argument, but it is a type template
1586 argument. */
1587 else if (TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
)
1588 adl_type (arg);
1589}
1590
1591/* Perform ADL lookup. FNS is the existing lookup result and ARGS are
1592 the call arguments. */
1593
1594tree
1595name_lookup::search_adl (tree fns, vec<tree, va_gc> *args)
1596{
1597 gcc_checking_assert (!vec_safe_length (scopes))((void)(!(!vec_safe_length (scopes)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1597, __FUNCTION__), 0 : 0))
;
1598
1599 /* Gather each associated entity onto the lookup's scope list. */
1600 unsigned ix;
1601 tree arg;
1602
1603 FOR_EACH_VEC_ELT_REVERSE (*args, ix, arg)for (ix = (*args).length () - 1; (*args).iterate ((ix), &
(arg)); (ix)--)
1604 /* OMP reduction operators put an ADL-significant type as the
1605 first arg. */
1606 if (TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
)
1607 adl_type (arg);
1608 else
1609 adl_expr (arg);
1610
1611 if (vec_safe_length (scopes))
1612 {
1613 /* Now do the lookups. */
1614 value = fns;
1615 if (fns)
1616 dedup (true);
1617
1618 /* INST_PATH will be NULL, if this is /not/ 2nd-phase ADL. */
1619 bitmap inst_path = NULLnullptr;
1620 /* VISIBLE is the regular import bitmap. */
1621 bitmap visible = visible_instantiation_path (&inst_path);
1622
1623 for (unsigned ix = scopes->length (); ix--;)
1624 {
1625 tree scope = (*scopes)[ix];
1626 if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) == NAMESPACE_DECL)
1627 adl_namespace_fns (scope, visible);
1628 else
1629 {
1630 if (RECORD_OR_UNION_TYPE_P (scope)(((enum tree_code) (scope)->base.code) == RECORD_TYPE || (
(enum tree_code) (scope)->base.code) == UNION_TYPE || ((enum
tree_code) (scope)->base.code) == QUAL_UNION_TYPE)
)
1631 adl_class_fns (scope);
1632
1633 /* During 2nd phase ADL: Any exported declaration D in N
1634 declared within the purview of a named module M
1635 (10.2) is visible if there is an associated entity
1636 attached to M with the same innermost enclosing
1637 non-inline namespace as D.
1638 [basic.lookup.argdep]/4.4 */
1639
1640 if (!inst_path)
1641 /* Not 2nd phase. */
1642 continue;
1643
1644 tree ctx = CP_DECL_CONTEXT (TYPE_NAME (scope))(!(! (((contains_struct_check ((((tree_class_check ((scope), (
tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1644, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1644, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((((tree_class_check ((scope), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1644, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1644, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((((tree_class_check
((scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1644, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1644, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1645 if (TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) != NAMESPACE_DECL)
1646 /* Not namespace-scope class. */
1647 continue;
1648
1649 tree origin = get_originating_module_decl (TYPE_NAME (scope)((tree_class_check ((scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1649, __FUNCTION__))->type_common.name)
);
1650 tree not_tmpl = STRIP_TEMPLATE (origin)(((enum tree_code) (origin)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((origin), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1650, __FUNCTION__, (TEMPLATE_DECL))))))))->result : origin
)
;
1651 if (!DECL_LANG_SPECIFIC (not_tmpl)((contains_struct_check ((not_tmpl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1651, __FUNCTION__))->decl_common.lang_specific)
1652 || !DECL_MODULE_IMPORT_P (not_tmpl)(((contains_struct_check (((tree_not_check ((not_tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1652, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1652, __FUNCTION__))->decl_common.lang_specific)->u.base
.module_import_p)
)
1653 /* Not imported. */
1654 continue;
1655
1656 unsigned module = get_importing_module (origin);
1657
1658 if (!bitmap_bit_p (inst_path, module))
1659 /* Not on path of instantiation. */
1660 continue;
1661
1662 if (bitmap_bit_p (visible, module))
1663 /* If the module was in the visible set, we'll look at
1664 its namespace partition anyway. */
1665 continue;
1666
1667 if (tree *slot = find_namespace_slot (ctx, name, false))
1668 if (binding_slot *mslot = search_imported_binding_slot (slot, module))
1669 {
1670 if (mslot->is_lazy ())
1671 lazy_load_binding (module, ctx, name, mslot);
1672
1673 if (tree bind = *mslot)
1674 {
1675 /* We must turn on deduping, because some other class
1676 from this module might also be in this namespace. */
1677 dedup (true);
1678
1679 /* Add the exported fns */
1680 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1680, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1680, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1681 add_fns (STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1681, __FUNCTION__, (OVERLOAD))))->common.chain)
);
1682 }
1683 }
1684 }
1685 }
1686
1687 fns = value;
1688 dedup (false);
1689 }
1690
1691 return fns;
1692}
1693
1694static bool qualified_namespace_lookup (tree, name_lookup *);
1695static void consider_binding_level (tree name,
1696 best_match <tree, const char *> &bm,
1697 cp_binding_level *lvl,
1698 bool look_within_fields,
1699 enum lookup_name_fuzzy_kind kind);
1700
1701/* ADL lookup of NAME. FNS is the result of regular lookup, and we
1702 don't add duplicates to it. ARGS is the vector of call
1703 arguments (which will not be empty). */
1704
1705tree
1706lookup_arg_dependent (tree name, tree fns, vec<tree, va_gc> *args)
1707{
1708 auto_cond_timevar tv (TV_NAME_LOOKUP);
1709 name_lookup lookup (name);
1710 return lookup.search_adl (fns, args);
1711}
1712
1713/* FNS is an overload set of conversion functions. Return the
1714 overloads converting to TYPE. */
1715
1716static tree
1717extract_conversion_operator (tree fns, tree type)
1718{
1719 tree convs = NULL_TREE(tree) nullptr;
1720 tree tpls = NULL_TREE(tree) nullptr;
1721
1722 for (ovl_iterator iter (fns); iter; ++iter)
1723 {
1724 if (same_type_p (DECL_CONV_FN_TYPE (*iter), type)comptypes ((((contains_struct_check (((((void)(!(((((tree_not_check2
(((tree_check ((((contains_struct_check ((*iter), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((*iter), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((*iter), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__), 0 : 0)), ((contains_struct_check ((*iter
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__))->decl_minimal.name))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1724, __FUNCTION__))->typed.type)), (type), 0)
)
1725 convs = lookup_add (*iter, convs);
1726
1727 if (TREE_CODE (*iter)((enum tree_code) (*iter)->base.code) == TEMPLATE_DECL)
1728 tpls = lookup_add (*iter, tpls);
1729 }
1730
1731 if (!convs)
1732 convs = tpls;
1733
1734 return convs;
1735}
1736
1737/* Binary search of (ordered) MEMBER_VEC for NAME. */
1738
1739static tree
1740member_vec_binary_search (vec<tree, va_gc> *member_vec, tree name)
1741{
1742 for (unsigned lo = 0, hi = member_vec->length (); lo < hi;)
1743 {
1744 unsigned mid = (lo + hi) / 2;
1745 tree binding = (*member_vec)[mid];
1746 tree binding_name = OVL_NAME (binding)((contains_struct_check ((ovl_first (binding)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1746, __FUNCTION__))->decl_minimal.name)
;
1747
1748 if (binding_name > name)
1749 hi = mid;
1750 else if (binding_name < name)
1751 lo = mid + 1;
1752 else
1753 return binding;
1754 }
1755
1756 return NULL_TREE(tree) nullptr;
1757}
1758
1759/* Linear search of (unordered) MEMBER_VEC for NAME. */
1760
1761static tree
1762member_vec_linear_search (vec<tree, va_gc> *member_vec, tree name)
1763{
1764 for (int ix = member_vec->length (); ix--;)
1765 if (tree binding = (*member_vec)[ix])
1766 if (OVL_NAME (binding)((contains_struct_check ((ovl_first (binding)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1766, __FUNCTION__))->decl_minimal.name)
== name)
1767 return binding;
1768
1769 return NULL_TREE(tree) nullptr;
1770}
1771
1772/* Linear search of (partially ordered) fields of KLASS for NAME. */
1773
1774static tree
1775fields_linear_search (tree klass, tree name, bool want_type)
1776{
1777 for (tree fields = TYPE_FIELDS (klass)((tree_check3 ((klass), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1777, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; fields; fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1777, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1777, __FUNCTION__))->common.chain))
)
1778 {
1779 tree decl = fields;
1780
1781 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL
1782 && ANON_AGGR_TYPE_P (TREE_TYPE (decl))((((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1782, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1782, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((decl
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1782, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1782, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1782, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1782, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
1783 {
1784 if (tree temp = search_anon_aggr (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1784, __FUNCTION__))->typed.type)
, name, want_type))
1785 return temp;
1786 }
1787
1788 if (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1788, __FUNCTION__))->decl_minimal.name)
!= name)
1789 continue;
1790
1791 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == USING_DECL)
1792 {
1793 decl = strip_using_decl (decl);
1794 if (is_overloaded_fn (decl))
1795 continue;
1796 }
1797
1798 if (DECL_DECLARES_FUNCTION_P (decl)(((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1798, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1798, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
1799 /* Functions are found separately. */
1800 continue;
1801
1802 if (!want_type || DECL_DECLARES_TYPE_P (decl)(((enum tree_code) (decl)->base.code) == TYPE_DECL || (((enum
tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1802, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1802, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
1803 return decl;
1804 }
1805
1806 return NULL_TREE(tree) nullptr;
1807}
1808
1809/* Look for NAME member inside of anonymous aggregate ANON. Although
1810 such things should only contain FIELD_DECLs, we check that too
1811 late, and would give very confusing errors if we weren't
1812 permissive here. */
1813
1814tree
1815search_anon_aggr (tree anon, tree name, bool want_type)
1816{
1817 gcc_assert (COMPLETE_TYPE_P (anon))((void)(!((((tree_class_check ((anon), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1817, __FUNCTION__))->type_common.size) != (tree) nullptr
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1817, __FUNCTION__), 0 : 0))
;
1818 tree ret = get_class_binding_direct (anon, name, want_type);
1819 return ret;
1820}
1821
1822/* Look for NAME as an immediate member of KLASS (including
1823 anon-members or unscoped enum member). TYPE_OR_FNS is zero for
1824 regular search. >0 to get a type binding (if there is one) and <0
1825 if you want (just) the member function binding.
1826
1827 Use this if you do not want lazy member creation. */
1828
1829tree
1830get_class_binding_direct (tree klass, tree name, bool want_type)
1831{
1832 gcc_checking_assert (RECORD_OR_UNION_TYPE_P (klass))((void)(!((((enum tree_code) (klass)->base.code) == RECORD_TYPE
|| ((enum tree_code) (klass)->base.code) == UNION_TYPE ||
((enum tree_code) (klass)->base.code) == QUAL_UNION_TYPE)
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1832, __FUNCTION__), 0 : 0))
;
1833
1834 /* Conversion operators can only be found by the marker conversion
1835 operator name. */
1836 bool conv_op = IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1836, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1836, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1836, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1836, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1836, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1836, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
;
1837 tree lookup = conv_op ? conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER] : name;
1838 tree val = NULL_TREE(tree) nullptr;
1839 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1839, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
1840
1841 if (COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1841, __FUNCTION__))->type_common.size) != (tree) nullptr
)
&& member_vec)
1842 {
1843 val = member_vec_binary_search (member_vec, lookup);
1844 if (!val)
1845 ;
1846 else if (STAT_HACK_P (val)((val) && ((enum tree_code) (val)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1846, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1846, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1847 val = want_type ? STAT_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1847, __FUNCTION__))->typed.type)
: STAT_DECL (val)(((struct tree_overload*)(tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1847, __FUNCTION__, (OVERLOAD))))->function)
;
1848 else if (want_type && !DECL_DECLARES_TYPE_P (val)(((enum tree_code) (val)->base.code) == TYPE_DECL || (((enum
tree_code) (val)->base.code) == TEMPLATE_DECL && (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1848, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((val)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1848, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
1849 val = NULL_TREE(tree) nullptr;
1850 }
1851 else
1852 {
1853 if (member_vec && !want_type)
1854 val = member_vec_linear_search (member_vec, lookup);
1855
1856 if (!val || (TREE_CODE (val)((enum tree_code) (val)->base.code) == OVERLOAD && OVL_DEDUP_P (val)((tree_not_check2 (((tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1856, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1856, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
))
1857 /* Dependent using declarations are a 'field', make sure we
1858 return that even if we saw an overload already. */
1859 if (tree field_val = fields_linear_search (klass, lookup, want_type))
1860 {
1861 if (!val)
1862 val = field_val;
1863 else if (TREE_CODE (field_val)((enum tree_code) (field_val)->base.code) == USING_DECL)
1864 val = ovl_make (field_val, val);
1865 }
1866 }
1867
1868 /* Extract the conversion operators asked for, unless the general
1869 conversion operator was requested. */
1870 if (val && conv_op)
1871 {
1872 gcc_checking_assert (OVL_FUNCTION (val) == conv_op_marker)((void)(!((((struct tree_overload*)(tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1872, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1872, __FUNCTION__), 0 : 0))
;
1873 val = OVL_CHAIN (val)(((struct tree_overload*)(tree_check ((val), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1873, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1874 if (tree type = TREE_TYPE (name)((contains_struct_check ((name), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1874, __FUNCTION__))->typed.type)
)
1875 val = extract_conversion_operator (val, type);
1876 }
1877
1878 return val;
1879}
1880
1881/* We're about to lookup NAME in KLASS. Make sure any lazily declared
1882 members are now declared. */
1883
1884static void
1885maybe_lazily_declare (tree klass, tree name)
1886{
1887 /* See big comment anout module_state::write_pendings regarding adding a check
1888 bit. */
1889 if (modules_p ())
1890 lazy_load_pendings (TYPE_NAME (klass)((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1890, __FUNCTION__))->type_common.name)
);
1891
1892 /* Lazily declare functions, if we're going to search these. */
1893 if (IDENTIFIER_CTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1893, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1893, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1893, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1893, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) & (!((tree_not_check2 (((tree_check ((name
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1893, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1893, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1894 {
1895 if (CLASSTYPE_LAZY_DEFAULT_CTOR (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1895, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_default_ctor)
)
1896 lazily_declare_fn (sfk_constructor, klass);
1897 if (CLASSTYPE_LAZY_COPY_CTOR (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1897, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_copy_ctor)
)
1898 lazily_declare_fn (sfk_copy_constructor, klass);
1899 if (CLASSTYPE_LAZY_MOVE_CTOR (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1899, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_move_ctor)
)
1900 lazily_declare_fn (sfk_move_constructor, klass);
1901 }
1902 else if (IDENTIFIER_DTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1902, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1902, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1902, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1902, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1902, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1902, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
1903 {
1904 if (CLASSTYPE_LAZY_DESTRUCTOR (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1904, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_destructor)
)
1905 lazily_declare_fn (sfk_destructor, klass);
1906 }
1907 else if (name == assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier))
1908 {
1909 if (CLASSTYPE_LAZY_COPY_ASSIGN (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1909, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_copy_assign)
)
1910 lazily_declare_fn (sfk_copy_assignment, klass);
1911 if (CLASSTYPE_LAZY_MOVE_ASSIGN (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1911, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_move_assign)
)
1912 lazily_declare_fn (sfk_move_assignment, klass);
1913 }
1914}
1915
1916/* Look for NAME's binding in exactly KLASS. See
1917 get_class_binding_direct for argument description. Does lazy
1918 special function creation as necessary. */
1919
1920tree
1921get_class_binding (tree klass, tree name, bool want_type /*=false*/)
1922{
1923 klass = complete_type (klass);
1924
1925 if (COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1925, __FUNCTION__))->type_common.size) != (tree) nullptr
)
)
1926 maybe_lazily_declare (klass, name);
1927
1928 return get_class_binding_direct (klass, name, want_type);
1929}
1930
1931/* Find the slot containing overloads called 'NAME'. If there is no
1932 such slot and the class is complete, create an empty one, at the
1933 correct point in the sorted member vector. Otherwise return NULL.
1934 Deals with conv_op marker handling. */
1935
1936tree *
1937find_member_slot (tree klass, tree name)
1938{
1939 bool complete_p = COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1939, __FUNCTION__))->type_common.size) != (tree) nullptr
)
;
1940
1941 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1941, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
1942 if (!member_vec)
1943 {
1944 vec_alloc (member_vec, 8);
1945 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1945, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
1946 if (complete_p)
1947 /* If the class is complete but had no member_vec, we need to
1948 add the TYPE_FIELDS into it. We're also most likely to be
1949 adding ctors & dtors, so ask for 6 spare slots (the
1950 abstract cdtors and their clones). */
1951 member_vec = set_class_bindings (klass, 6);
1952 }
1953
1954 if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1954, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1954, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1954, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1954, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1954, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1954, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1955 name = conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER];
1956
1957 unsigned ix, length = member_vec->length ();
1958 for (ix = 0; ix < length; ix++)
1959 {
1960 tree *slot = &(*member_vec)[ix];
1961 tree fn_name = OVL_NAME (*slot)((contains_struct_check ((ovl_first (*slot)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1961, __FUNCTION__))->decl_minimal.name)
;
1962
1963 if (fn_name == name)
1964 {
1965 /* If we found an existing slot, it must be a function set.
1966 Even with insertion after completion, because those only
1967 happen with artificial fns that have unspellable names.
1968 This means we do not have to deal with the stat hack
1969 either. */
1970 gcc_checking_assert (OVL_P (*slot))((void)(!((((enum tree_code) (*slot)->base.code) == FUNCTION_DECL
|| ((enum tree_code) (*slot)->base.code) == OVERLOAD)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1970, __FUNCTION__), 0 : 0))
;
1971 if (name == conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER])
1972 {
1973 gcc_checking_assert (OVL_FUNCTION (*slot) == conv_op_marker)((void)(!((((struct tree_overload*)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1973, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1973, __FUNCTION__), 0 : 0))
;
1974 /* Skip the conv-op marker. */
1975 slot = &OVL_CHAIN (*slot)(((struct tree_overload*)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1975, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1976 }
1977 return slot;
1978 }
1979
1980 if (complete_p && fn_name > name)
1981 break;
1982 }
1983
1984 /* No slot found, add one if the class is complete. */
1985 if (complete_p)
1986 {
1987 /* Do exact allocation, as we don't expect to add many. */
1988 gcc_assert (name != conv_op_identifier)((void)(!(name != cp_global_trees[CPTI_CONV_OP_IDENTIFIER]) ?
fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1988, __FUNCTION__), 0 : 0))
;
1989 vec_safe_reserve_exact (member_vec, 1);
1990 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 1990, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
1991 member_vec->quick_insert (ix, NULL_TREE(tree) nullptr);
1992 return &(*member_vec)[ix];
1993 }
1994
1995 return NULLnullptr;
1996}
1997
1998/* KLASS is an incomplete class to which we're adding a method NAME.
1999 Add a slot and deal with conv_op marker handling. */
2000
2001tree *
2002add_member_slot (tree klass, tree name)
2003{
2004 gcc_assert (!COMPLETE_TYPE_P (klass))((void)(!(!(((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2004, __FUNCTION__))->type_common.size) != (tree) nullptr
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2004, __FUNCTION__), 0 : 0))
;
2005
2006 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2006, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2007 vec_safe_push (member_vec, NULL_TREE(tree) nullptr);
2008 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2008, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2009
2010 tree *slot = &member_vec->last ();
2011 if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2011, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2011, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2011, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2011, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2011, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2011, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2012 {
2013 /* Install the marker prefix. */
2014 *slot = ovl_make (conv_op_markercp_global_trees[CPTI_CONV_OP_MARKER], NULL_TREE(tree) nullptr);
2015 slot = &OVL_CHAIN (*slot)(((struct tree_overload*)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2015, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2016 }
2017
2018 return slot;
2019}
2020
2021/* Comparison function to compare two MEMBER_VEC entries by name.
2022 Because we can have duplicates during insertion of TYPE_FIELDS, we
2023 do extra checking so deduping doesn't have to deal with so many
2024 cases. */
2025
2026static int
2027member_name_cmp (const void *a_p, const void *b_p)
2028{
2029 tree a = *(const tree *)a_p;
2030 tree b = *(const tree *)b_p;
2031 tree name_a = DECL_NAME (TREE_CODE (a) == OVERLOAD ? OVL_FUNCTION (a) : a)((contains_struct_check ((((enum tree_code) (a)->base.code
) == OVERLOAD ? (((struct tree_overload*)(tree_check ((a), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2031, __FUNCTION__, (OVERLOAD))))->function) : a), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2031, __FUNCTION__))->decl_minimal.name)
;
2032 tree name_b = DECL_NAME (TREE_CODE (b) == OVERLOAD ? OVL_FUNCTION (b) : b)((contains_struct_check ((((enum tree_code) (b)->base.code
) == OVERLOAD ? (((struct tree_overload*)(tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2032, __FUNCTION__, (OVERLOAD))))->function) : b), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2032, __FUNCTION__))->decl_minimal.name)
;
2033
2034 gcc_checking_assert (name_a && name_b)((void)(!(name_a && name_b) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2034, __FUNCTION__), 0 : 0))
;
2035 if (name_a != name_b)
2036 return name_a < name_b ? -1 : +1;
2037
2038 if (name_a == conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER])
2039 {
2040 /* Strip the conv-op markers. */
2041 gcc_checking_assert (OVL_FUNCTION (a) == conv_op_marker((void)(!((((struct tree_overload*)(tree_check ((a), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2041, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER] && (((struct tree_overload*)(tree_check
((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2042, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2042, __FUNCTION__), 0 : 0))
2042 && OVL_FUNCTION (b) == conv_op_marker)((void)(!((((struct tree_overload*)(tree_check ((a), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2041, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER] && (((struct tree_overload*)(tree_check
((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2042, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2042, __FUNCTION__), 0 : 0))
;
2043 a = OVL_CHAIN (a)(((struct tree_overload*)(tree_check ((a), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2043, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2044 b = OVL_CHAIN (b)(((struct tree_overload*)(tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2044, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2045 }
2046
2047 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == OVERLOAD)
2048 a = OVL_FUNCTION (a)(((struct tree_overload*)(tree_check ((a), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2048, __FUNCTION__, (OVERLOAD))))->function)
;
2049 if (TREE_CODE (b)((enum tree_code) (b)->base.code) == OVERLOAD)
2050 b = OVL_FUNCTION (b)(((struct tree_overload*)(tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2050, __FUNCTION__, (OVERLOAD))))->function)
;
2051
2052 /* We're in STAT_HACK or USING_DECL territory (or possibly error-land). */
2053 if (TREE_CODE (a)((enum tree_code) (a)->base.code) != TREE_CODE (b)((enum tree_code) (b)->base.code))
2054 {
2055 /* If one of them is a TYPE_DECL, it loses. */
2056 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == TYPE_DECL)
2057 return +1;
2058 else if (TREE_CODE (b)((enum tree_code) (b)->base.code) == TYPE_DECL)
2059 return -1;
2060
2061 /* If one of them is a USING_DECL, it loses. */
2062 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == USING_DECL)
2063 return +1;
2064 else if (TREE_CODE (b)((enum tree_code) (b)->base.code) == USING_DECL)
2065 return -1;
2066
2067 /* There are no other cases with different kinds of decls, as
2068 duplicate detection should have kicked in earlier. However,
2069 some erroneous cases get though. */
2070 gcc_assert (errorcount)((void)(!((global_dc)->diagnostic_count[(int) (DK_ERROR)])
? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2070, __FUNCTION__), 0 : 0))
;
2071 }
2072
2073 /* Using source location would be the best thing here, but we can
2074 get identically-located decls in the following circumstances:
2075
2076 1) duplicate artificial type-decls for the same type.
2077
2078 2) pack expansions of using-decls.
2079
2080 We should not be doing #1, but in either case it doesn't matter
2081 how we order these. Use UID as a proxy for source ordering, so
2082 that identically-located decls still have a well-defined stable
2083 ordering. */
2084 if (DECL_UID (a)((contains_struct_check ((a), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2084, __FUNCTION__))->decl_minimal.uid)
!= DECL_UID (b)((contains_struct_check ((b), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2084, __FUNCTION__))->decl_minimal.uid)
)
2085 return DECL_UID (a)((contains_struct_check ((a), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2085, __FUNCTION__))->decl_minimal.uid)
< DECL_UID (b)((contains_struct_check ((b), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2085, __FUNCTION__))->decl_minimal.uid)
? -1 : +1;
2086 gcc_assert (a == b)((void)(!(a == b) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2086, __FUNCTION__), 0 : 0))
;
2087 return 0;
2088}
2089
2090static struct {
2091 gt_pointer_operator new_value;
2092 void *cookie;
2093} resort_data;
2094
2095/* This routine compares two fields like member_name_cmp but using the
2096 pointer operator in resort_field_decl_data. We don't have to deal
2097 with duplicates here. */
2098
2099static int
2100resort_member_name_cmp (const void *a_p, const void *b_p)
2101{
2102 tree a = *(const tree *)a_p;
2103 tree b = *(const tree *)b_p;
2104 tree name_a = OVL_NAME (a)((contains_struct_check ((ovl_first (a)), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2104, __FUNCTION__))->decl_minimal.name)
;
2105 tree name_b = OVL_NAME (b)((contains_struct_check ((ovl_first (b)), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2105, __FUNCTION__))->decl_minimal.name)
;
2106
2107 resort_data.new_value (&name_a, &name_a, resort_data.cookie);
2108 resort_data.new_value (&name_b, &name_b, resort_data.cookie);
2109
2110 gcc_checking_assert (name_a != name_b)((void)(!(name_a != name_b) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2110, __FUNCTION__), 0 : 0))
;
2111
2112 return name_a < name_b ? -1 : +1;
2113}
2114
2115/* Resort CLASSTYPE_MEMBER_VEC because pointers have been reordered. */
2116
2117void
2118resort_type_member_vec (void *obj, void */*orig_obj*/,
2119 gt_pointer_operator new_value, void* cookie)
2120{
2121 if (vec<tree, va_gc> *member_vec = (vec<tree, va_gc> *) obj)
2122 {
2123 resort_data.new_value = new_value;
2124 resort_data.cookie = cookie;
2125 member_vec->qsort (resort_member_name_cmp)qsort (resort_member_name_cmp);
2126 }
2127}
2128
2129/* Recursively count the number of fields in KLASS, including anonymous
2130 union members. */
2131
2132static unsigned
2133count_class_fields (tree klass)
2134{
2135 unsigned n_fields = 0;
2136
2137 for (tree fields = TYPE_FIELDS (klass)((tree_check3 ((klass), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2137, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; fields; fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2137, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2137, __FUNCTION__))->common.chain))
)
2138 if (DECL_DECLARES_FUNCTION_P (fields)(((enum tree_code) (fields)->base.code) == FUNCTION_DECL ||
(((enum tree_code) (fields)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fields), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2138, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fields
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2138, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2139 /* Functions are dealt with separately. */;
2140 else if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL
2141 && ANON_AGGR_TYPE_P (TREE_TYPE (fields))((((((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2141, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2141, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((fields
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2141, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2141, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((fields), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2141, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2141, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
2142 n_fields += count_class_fields (TREE_TYPE (fields)((contains_struct_check ((fields), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2142, __FUNCTION__))->typed.type)
);
2143 else if (DECL_NAME (fields)((contains_struct_check ((fields), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2143, __FUNCTION__))->decl_minimal.name)
)
2144 n_fields += 1;
2145
2146 return n_fields;
2147}
2148
2149/* Append all the nonfunction members fields of KLASS to MEMBER_VEC.
2150 Recurse for anonymous members. MEMBER_VEC must have space. */
2151
2152static void
2153member_vec_append_class_fields (vec<tree, va_gc> *member_vec, tree klass)
2154{
2155 for (tree fields = TYPE_FIELDS (klass)((tree_check3 ((klass), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2155, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; fields; fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2155, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2155, __FUNCTION__))->common.chain))
)
2156 if (DECL_DECLARES_FUNCTION_P (fields)(((enum tree_code) (fields)->base.code) == FUNCTION_DECL ||
(((enum tree_code) (fields)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fields), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2156, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fields
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2156, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2157 /* Functions are handled separately. */;
2158 else if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL
2159 && ANON_AGGR_TYPE_P (TREE_TYPE (fields))((((((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2159, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2159, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((fields
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2159, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2159, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((fields), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2159, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2159, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
2160 member_vec_append_class_fields (member_vec, TREE_TYPE (fields)((contains_struct_check ((fields), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2160, __FUNCTION__))->typed.type)
);
2161 else if (DECL_NAME (fields)((contains_struct_check ((fields), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2161, __FUNCTION__))->decl_minimal.name)
)
2162 {
2163 tree field = fields;
2164 /* Mark a conv-op USING_DECL with the conv-op-marker. */
2165 if (TREE_CODE (field)((enum tree_code) (field)->base.code) == USING_DECL
2166 && IDENTIFIER_CONV_OP_P (DECL_NAME (field))((((tree_not_check2 (((tree_check ((((contains_struct_check (
(field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2166, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2167 field = ovl_make (conv_op_markercp_global_trees[CPTI_CONV_OP_MARKER], field);
2168 member_vec->quick_push (field);
2169 }
2170}
2171
2172/* Append all of the enum values of ENUMTYPE to MEMBER_VEC.
2173 MEMBER_VEC must have space. */
2174
2175static void
2176member_vec_append_enum_values (vec<tree, va_gc> *member_vec, tree enumtype)
2177{
2178 for (tree values = TYPE_VALUES (enumtype)((tree_check ((enumtype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2178, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
;
25
Calling 'tree_check'
28
Returning from 'tree_check'
29
Loop condition is true. Entering loop body
2179 values; values = TREE_CHAIN (values)((contains_struct_check ((values), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2179, __FUNCTION__))->common.chain)
)
2180 member_vec->quick_push (TREE_VALUE (values)((tree_check ((values), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2180, __FUNCTION__, (TREE_LIST)))->list.value)
);
30
Called C++ object pointer is null
2181}
2182
2183/* MEMBER_VEC has just had new DECLs added to it, but is sorted.
2184 DeDup adjacent DECLS of the same name. We already dealt with
2185 conflict resolution when adding the fields or methods themselves.
2186 There are three cases (which could all be combined):
2187 1) a TYPE_DECL and non TYPE_DECL. Deploy STAT_HACK as appropriate.
2188 2) a USING_DECL and an overload. If the USING_DECL is dependent,
2189 it wins. Otherwise the OVERLOAD does.
2190 3) two USING_DECLS. ...
2191
2192 member_name_cmp will have ordered duplicates as
2193 <fns><using><type> */
2194
2195static void
2196member_vec_dedup (vec<tree, va_gc> *member_vec)
2197{
2198 unsigned len = member_vec->length ();
2199 unsigned store = 0;
2200
2201 if (!len)
2202 return;
2203
2204 tree name = OVL_NAME ((*member_vec)[0])((contains_struct_check ((ovl_first ((*member_vec)[0])), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2204, __FUNCTION__))->decl_minimal.name)
;
2205 for (unsigned jx, ix = 0; ix < len; ix = jx)
2206 {
2207 tree current = NULL_TREE(tree) nullptr;
2208 tree to_type = NULL_TREE(tree) nullptr;
2209 tree to_using = NULL_TREE(tree) nullptr;
2210 tree marker = NULL_TREE(tree) nullptr;
2211
2212 for (jx = ix; jx < len; jx++)
2213 {
2214 tree next = (*member_vec)[jx];
2215 if (jx != ix)
2216 {
2217 tree next_name = OVL_NAME (next)((contains_struct_check ((ovl_first (next)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2217, __FUNCTION__))->decl_minimal.name)
;
2218 if (next_name != name)
2219 {
2220 name = next_name;
2221 break;
2222 }
2223 }
2224
2225 if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2225, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2225, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2225, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2225, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2225, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2225, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2226 {
2227 marker = next;
2228 next = OVL_CHAIN (next)(((struct tree_overload*)(tree_check ((next), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2228, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2229 }
2230
2231 if (TREE_CODE (next)((enum tree_code) (next)->base.code) == USING_DECL)
2232 {
2233 if (IDENTIFIER_CTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2233, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2233, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2233, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2233, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) & (!((tree_not_check2 (((tree_check ((name
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2233, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2233, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2234 /* Dependent inherited ctor. */
2235 continue;
2236
2237 next = strip_using_decl (next);
2238 if (TREE_CODE (next)((enum tree_code) (next)->base.code) == USING_DECL)
2239 {
2240 to_using = next;
2241 continue;
2242 }
2243
2244 if (is_overloaded_fn (next))
2245 continue;
2246 }
2247
2248 if (DECL_DECLARES_TYPE_P (next)(((enum tree_code) (next)->base.code) == TYPE_DECL || (((enum
tree_code) (next)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((next), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2248, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((next
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2248, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
2249 {
2250 to_type = next;
2251 continue;
2252 }
2253
2254 if (!current)
2255 current = next;
2256 }
2257
2258 if (to_using)
2259 {
2260 if (!current)
2261 current = to_using;
2262 else
2263 current = ovl_make (to_using, current);
2264 }
2265
2266 if (to_type)
2267 {
2268 if (!current)
2269 current = to_type;
2270 else
2271 current = stat_hack (current, to_type);
2272 }
2273
2274 if (current)
2275 {
2276 if (marker)
2277 {
2278 OVL_CHAIN (marker)(((struct tree_overload*)(tree_check ((marker), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2278, __FUNCTION__, (OVERLOAD))))->common.chain)
= current;
2279 current = marker;
2280 }
2281 (*member_vec)[store++] = current;
2282 }
2283 }
2284
2285 while (store++ < len)
2286 member_vec->pop ();
2287}
2288
2289/* Add the non-function members to CLASSTYPE_MEMBER_VEC. If there is
2290 no existing MEMBER_VEC and fewer than 8 fields, do nothing. We
2291 know there must be at least 1 field -- the self-reference
2292 TYPE_DECL, except for anon aggregates, which will have at least
2293 one field anyway. If EXTRA < 0, always create the vector. */
2294
2295vec<tree, va_gc> *
2296set_class_bindings (tree klass, int extra)
2297{
2298 unsigned n_fields = count_class_fields (klass);
2299 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2299, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2300
2301 if (member_vec || n_fields >= 8 || extra < 0)
2302 {
2303 /* Append the new fields. */
2304 vec_safe_reserve_exact (member_vec, n_fields + (extra >= 0 ? extra : 0));
2305 member_vec_append_class_fields (member_vec, klass);
2306 }
2307
2308 if (member_vec)
2309 {
2310 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2310, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2311 member_vec->qsort (member_name_cmp)qsort (member_name_cmp);
2312 member_vec_dedup (member_vec);
2313 }
2314
2315 return member_vec;
2316}
2317
2318/* Insert lately defined enum ENUMTYPE into KLASS for the sorted case. */
2319
2320void
2321insert_late_enum_def_bindings (tree klass, tree enumtype)
2322{
2323 int n_fields;
2324 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2324, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2325
2326 /* The enum bindings will already be on the TYPE_FIELDS, so don't
2327 count them twice. */
2328 if (!member_vec)
1
Assuming 'member_vec' is non-null
2
Taking false branch
2329 n_fields = count_class_fields (klass);
2330 else
2331 n_fields = list_length (TYPE_VALUES (enumtype)((tree_check ((enumtype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2331, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
);
3
Calling 'tree_check'
7
Returning from 'tree_check'
2332
2333 if (member_vec
7.1
'member_vec' is non-null
7.1
'member_vec' is non-null
7.1
'member_vec' is non-null
|| n_fields >= 8)
2334 {
2335 vec_safe_reserve_exact (member_vec, n_fields);
8
Calling 'vec_safe_reserve_exact<tree_node *, va_gc>'
21
Returning from 'vec_safe_reserve_exact<tree_node *, va_gc>'
2336 if (CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2336, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
)
22
Taking true branch
2337 member_vec_append_enum_values (member_vec, enumtype);
23
Passing null pointer value via 1st parameter 'member_vec'
24
Calling 'member_vec_append_enum_values'
2338 else
2339 member_vec_append_class_fields (member_vec, klass);
2340 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2340, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2341 member_vec->qsort (member_name_cmp)qsort (member_name_cmp);
2342 member_vec_dedup (member_vec);
2343 }
2344}
2345
2346/* The binding oracle; see cp-tree.h. */
2347
2348cp_binding_oracle_function *cp_binding_oracle;
2349
2350/* If we have a binding oracle, ask it for all namespace-scoped
2351 definitions of NAME. */
2352
2353static inline void
2354query_oracle (tree name)
2355{
2356 if (!cp_binding_oracle)
2357 return;
2358
2359 /* LOOKED_UP holds the set of identifiers that we have already
2360 looked up with the oracle. */
2361 static hash_set<tree> looked_up;
2362 if (looked_up.add (name))
2363 return;
2364
2365 cp_binding_oracle (CP_ORACLE_IDENTIFIER, name);
2366}
2367
2368#ifndef ENABLE_SCOPE_CHECKING0
2369# define ENABLE_SCOPE_CHECKING0 0
2370#else
2371# define ENABLE_SCOPE_CHECKING0 1
2372#endif
2373
2374/* A free list of "cxx_binding"s, connected by their PREVIOUS. */
2375
2376static GTY((deletable)) cxx_binding *free_bindings;
2377
2378/* Initialize VALUE and TYPE field for BINDING, and set the PREVIOUS
2379 field to NULL. */
2380
2381static inline void
2382cxx_binding_init (cxx_binding *binding, tree value, tree type)
2383{
2384 binding->value = value;
2385 binding->type = type;
2386 binding->previous = NULLnullptr;
2387}
2388
2389/* (GC)-allocate a binding object with VALUE and TYPE member initialized. */
2390
2391static cxx_binding *
2392cxx_binding_make (tree value, tree type)
2393{
2394 cxx_binding *binding = free_bindings;
2395
2396 if (binding)
2397 free_bindings = binding->previous;
2398 else
2399 binding = ggc_alloc<cxx_binding> ();
2400
2401 /* Clear flags by default. */
2402 LOCAL_BINDING_P (binding)((binding)->is_local) = false;
2403 INHERITED_VALUE_BINDING_P (binding)((binding)->value_is_inherited) = false;
2404 HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden) = false;
2405
2406 cxx_binding_init (binding, value, type);
2407
2408 return binding;
2409}
2410
2411/* Put BINDING back on the free list. */
2412
2413static inline void
2414cxx_binding_free (cxx_binding *binding)
2415{
2416 binding->scope = NULLnullptr;
2417 binding->previous = free_bindings;
2418 free_bindings = binding;
2419}
2420
2421/* Create a new binding for NAME (with the indicated VALUE and TYPE
2422 bindings) in the class scope indicated by SCOPE. */
2423
2424static cxx_binding *
2425new_class_binding (tree name, tree value, tree type, cp_binding_level *scope)
2426{
2427 cp_class_binding cb = {cxx_binding_make (value, type), name};
2428 cxx_binding *binding = cb.base;
2429 vec_safe_push (scope->class_shadowed, cb);
2430 binding->scope = scope;
2431 return binding;
2432}
2433
2434/* Make DECL the innermost binding for ID. The LEVEL is the binding
2435 level at which this declaration is being bound. */
2436
2437void
2438push_binding (tree id, tree decl, cp_binding_level* level)
2439{
2440 cxx_binding *binding;
2441
2442 if (level != class_binding_levelscope_chain->class_bindings)
2443 {
2444 binding = cxx_binding_make (decl, NULL_TREE(tree) nullptr);
2445 binding->scope = level;
2446 }
2447 else
2448 binding = new_class_binding (id, decl, /*type=*/NULL_TREE(tree) nullptr, level);
2449
2450 /* Now, fill in the binding information. */
2451 binding->previous = IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2451, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
2452 LOCAL_BINDING_P (binding)((binding)->is_local) = (level != class_binding_levelscope_chain->class_bindings);
2453
2454 /* And put it on the front of the list of bindings for ID. */
2455 IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2455, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
= binding;
2456}
2457
2458/* Remove the binding for DECL which should be the innermost binding
2459 for ID. */
2460
2461void
2462pop_local_binding (tree id, tree decl)
2463{
2464 if (!id || IDENTIFIER_ANON_P (id)((tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2464, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
)
2465 /* It's easiest to write the loops that call this function without
2466 checking whether or not the entities involved have names. We
2467 get here for such an entity. */
2468 return;
2469
2470 /* Get the innermost binding for ID. */
2471 cxx_binding *binding = IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2471, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
2472
2473 /* The name should be bound. */
2474 gcc_assert (binding != NULL)((void)(!(binding != nullptr) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2474, __FUNCTION__), 0 : 0))
;
2475
2476 /* The DECL will be either the ordinary binding or the type binding
2477 for this identifier. Remove that binding. We don't have to
2478 clear HIDDEN_TYPE_BINDING_P, as the whole binding will be going
2479 away. */
2480 if (binding->value == decl)
2481 binding->value = NULL_TREE(tree) nullptr;
2482 else
2483 {
2484 gcc_checking_assert (binding->type == decl)((void)(!(binding->type == decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2484, __FUNCTION__), 0 : 0))
;
2485 binding->type = NULL_TREE(tree) nullptr;
2486 }
2487
2488 if (!binding->value && !binding->type)
2489 {
2490 /* We're completely done with the innermost binding for this
2491 identifier. Unhook it from the list of bindings. */
2492 IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2492, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
= binding->previous;
2493
2494 /* Add it to the free list. */
2495 cxx_binding_free (binding);
2496 }
2497}
2498
2499/* Remove the bindings for the decls of the current level and leave
2500 the current scope. */
2501
2502void
2503pop_bindings_and_leave_scope (void)
2504{
2505 for (tree t = get_local_decls (); t; t = DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2505, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2505, __FUNCTION__))->common.chain))
)
2506 {
2507 tree decl = TREE_CODE (t)((enum tree_code) (t)->base.code) == TREE_LIST ? TREE_VALUE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2507, __FUNCTION__, (TREE_LIST)))->list.value)
: t;
2508 tree name = OVL_NAME (decl)((contains_struct_check ((ovl_first (decl)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2508, __FUNCTION__))->decl_minimal.name)
;
2509
2510 pop_local_binding (name, decl);
2511 }
2512
2513 leave_scope ();
2514}
2515
2516/* Strip non dependent using declarations. If DECL is dependent,
2517 surreptitiously create a typename_type and return it. */
2518
2519tree
2520strip_using_decl (tree decl)
2521{
2522 if (decl == NULL_TREE(tree) nullptr)
2523 return NULL_TREE(tree) nullptr;
2524
2525 while (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == USING_DECL && !DECL_DEPENDENT_P (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2525, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2525, __FUNCTION__))->decl_common.lang_flag_0)
)
2526 decl = USING_DECL_DECLS (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2526, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2526, __FUNCTION__))->decl_common.initial)
;
2527
2528 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == USING_DECL && DECL_DEPENDENT_P (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2528, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2528, __FUNCTION__))->decl_common.lang_flag_0)
2529 && USING_DECL_TYPENAME_P (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2529, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2529, __FUNCTION__))->decl_common.lang_flag_1)
)
2530 {
2531 /* We have found a type introduced by a using
2532 declaration at class scope that refers to a dependent
2533 type.
2534
2535 using typename :: [opt] nested-name-specifier unqualified-id ;
2536 */
2537 decl = make_typename_type (USING_DECL_SCOPE (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2537, __FUNCTION__, (USING_DECL)))), (TS_DECL_NON_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2537, __FUNCTION__))->decl_non_common.result)
,
2538 DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2538, __FUNCTION__))->decl_minimal.name)
,
2539 typename_type, tf_error);
2540 if (decl != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2541 decl = TYPE_NAME (decl)((tree_class_check ((decl), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2541, __FUNCTION__))->type_common.name)
;
2542 }
2543
2544 return decl;
2545}
2546
2547/* Return true if OVL is an overload for an anticipated builtin. */
2548
2549static bool
2550anticipated_builtin_p (tree ovl)
2551{
2552 return (TREE_CODE (ovl)((enum tree_code) (ovl)->base.code) == OVERLOAD
2553 && OVL_HIDDEN_P (ovl)((tree_not_check2 (((tree_check ((ovl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2553, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2553, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
2554 && DECL_IS_UNDECLARED_BUILTIN (OVL_FUNCTION (ovl))(((contains_struct_check (((((struct tree_overload*)(tree_check
((ovl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2554, __FUNCTION__, (OVERLOAD))))->function)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2554, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
);
2555}
2556
2557/* BINDING records an existing declaration for a name in the current scope.
2558 But, DECL is another declaration for that same identifier in the
2559 same scope. This is the `struct stat' hack whereby a non-typedef
2560 class name or enum-name can be bound at the same level as some other
2561 kind of entity.
2562 3.3.7/1
2563
2564 A class name (9.1) or enumeration name (7.2) can be hidden by the
2565 name of an object, function, or enumerator declared in the same scope.
2566 If a class or enumeration name and an object, function, or enumerator
2567 are declared in the same scope (in any order) with the same name, the
2568 class or enumeration name is hidden wherever the object, function, or
2569 enumerator name is visible.
2570
2571 It's the responsibility of the caller to check that
2572 inserting this name is valid here. Returns nonzero if the new binding
2573 was successful. */
2574
2575static bool
2576supplement_binding (cxx_binding *binding, tree decl)
2577{
2578 auto_cond_timevar tv (TV_NAME_LOOKUP);
2579
2580 tree bval = binding->value;
2581 bool ok = true;
2582 tree target_bval = strip_using_decl (bval);
2583 tree target_decl = strip_using_decl (decl);
2584
2585 if (TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) == TYPE_DECL && DECL_ARTIFICIAL (target_decl)((contains_struct_check ((target_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2585, __FUNCTION__))->decl_common.artificial_flag)
2586 && target_decl != target_bval
2587 && (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) != TYPE_DECL
2588 /* We allow pushing an enum multiple times in a class
2589 template in order to handle late matching of underlying
2590 type on an opaque-enum-declaration followed by an
2591 enum-specifier. */
2592 || (processing_template_declscope_chain->x_processing_template_decl
2593 && TREE_CODE (TREE_TYPE (target_decl))((enum tree_code) (((contains_struct_check ((target_decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2593, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
2594 && TREE_CODE (TREE_TYPE (target_bval))((enum tree_code) (((contains_struct_check ((target_bval), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2594, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
2595 && (dependent_type_p (ENUM_UNDERLYING_TYPE((contains_struct_check (((tree_check ((((contains_struct_check
((target_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2596, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2596, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2596, __FUNCTION__))->typed.type)
2596 (TREE_TYPE (target_decl))((contains_struct_check (((tree_check ((((contains_struct_check
((target_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2596, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2596, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2596, __FUNCTION__))->typed.type)
)
2597 || dependent_type_p (ENUM_UNDERLYING_TYPE((contains_struct_check (((tree_check ((((contains_struct_check
((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2598, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2598, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2598, __FUNCTION__))->typed.type)
2598 (TREE_TYPE (target_bval))((contains_struct_check (((tree_check ((((contains_struct_check
((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2598, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2598, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2598, __FUNCTION__))->typed.type)
)))))
2599 /* The new name is the type name. */
2600 binding->type = decl;
2601 else if (/* TARGET_BVAL is null when push_class_level_binding moves
2602 an inherited type-binding out of the way to make room
2603 for a new value binding. */
2604 !target_bval
2605 /* TARGET_BVAL is error_mark_node when TARGET_DECL's name
2606 has been used in a non-class scope prior declaration.
2607 In that case, we should have already issued a
2608 diagnostic; for graceful error recovery purpose, pretend
2609 this was the intended declaration for that name. */
2610 || target_bval == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2611 /* If TARGET_BVAL is anticipated but has not yet been
2612 declared, pretend it is not there at all. */
2613 || anticipated_builtin_p (target_bval))
2614 binding->value = decl;
2615 else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL
2616 && DECL_ARTIFICIAL (target_bval)((contains_struct_check ((target_bval), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2616, __FUNCTION__))->decl_common.artificial_flag)
2617 && target_decl != target_bval
2618 && (TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) != TYPE_DECL
2619 || same_type_p (TREE_TYPE (target_decl),comptypes ((((contains_struct_check ((target_decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2619, __FUNCTION__))->typed.type)), (((contains_struct_check
((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2620, __FUNCTION__))->typed.type)), 0)
2620 TREE_TYPE (target_bval))comptypes ((((contains_struct_check ((target_decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2619, __FUNCTION__))->typed.type)), (((contains_struct_check
((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2620, __FUNCTION__))->typed.type)), 0)
))
2621 {
2622 /* The old binding was a type name. It was placed in
2623 VALUE field because it was thought, at the point it was
2624 declared, to be the only entity with such a name. Move the
2625 type name into the type slot; it is now hidden by the new
2626 binding. */
2627 binding->type = bval;
2628 binding->value = decl;
2629 binding->value_is_inherited = false;
2630 }
2631 else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL
2632 && TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) == TYPE_DECL
2633 && DECL_NAME (target_decl)((contains_struct_check ((target_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2633, __FUNCTION__))->decl_minimal.name)
== DECL_NAME (target_bval)((contains_struct_check ((target_bval), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2633, __FUNCTION__))->decl_minimal.name)
2634 && binding->scope->kind != sk_class
2635 && (same_type_p (TREE_TYPE (target_decl), TREE_TYPE (target_bval))comptypes ((((contains_struct_check ((target_decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2635, __FUNCTION__))->typed.type)), (((contains_struct_check
((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2635, __FUNCTION__))->typed.type)), 0)
2636 /* If either type involves template parameters, we must
2637 wait until instantiation. */
2638 || uses_template_parms (TREE_TYPE (target_decl)((contains_struct_check ((target_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2638, __FUNCTION__))->typed.type)
)
2639 || uses_template_parms (TREE_TYPE (target_bval)((contains_struct_check ((target_bval), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2639, __FUNCTION__))->typed.type)
)))
2640 /* We have two typedef-names, both naming the same type to have
2641 the same name. In general, this is OK because of:
2642
2643 [dcl.typedef]
2644
2645 In a given scope, a typedef specifier can be used to redefine
2646 the name of any type declared in that scope to refer to the
2647 type to which it already refers.
2648
2649 However, in class scopes, this rule does not apply due to the
2650 stricter language in [class.mem] prohibiting redeclarations of
2651 members. */
2652 ok = false;
2653 /* There can be two block-scope declarations of the same variable,
2654 so long as they are `extern' declarations. However, there cannot
2655 be two declarations of the same static data member:
2656
2657 [class.mem]
2658
2659 A member shall not be declared twice in the
2660 member-specification. */
2661 else if (VAR_P (target_decl)(((enum tree_code) (target_decl)->base.code) == VAR_DECL)
2662 && VAR_P (target_bval)(((enum tree_code) (target_bval)->base.code) == VAR_DECL)
2663 && DECL_EXTERNAL (target_decl)((contains_struct_check ((target_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2663, __FUNCTION__))->decl_common.decl_flag_1)
&& DECL_EXTERNAL (target_bval)((contains_struct_check ((target_bval), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2663, __FUNCTION__))->decl_common.decl_flag_1)
2664 && !DECL_CLASS_SCOPE_P (target_decl)(((contains_struct_check ((target_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2664, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((target_decl), (TS_DECL_MINIMAL),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2664, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
2665 {
2666 duplicate_decls (decl, binding->value);
2667 ok = false;
2668 }
2669 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
2670 && TREE_CODE (bval)((enum tree_code) (bval)->base.code) == NAMESPACE_DECL
2671 && DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2671, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2671, __FUNCTION__))->decl_common.abstract_origin)
2672 && DECL_NAMESPACE_ALIAS (bval)((contains_struct_check (((tree_check ((bval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2672, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2672, __FUNCTION__))->decl_common.abstract_origin)
2673 && ORIGINAL_NAMESPACE (bval)(((contains_struct_check (((tree_check ((bval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((bval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__))->decl_common.abstract_origin) : (bval
))
== ORIGINAL_NAMESPACE (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2673, __FUNCTION__))->decl_common.abstract_origin) : (decl
))
)
2674 /* [namespace.alias]
2675
2676 In a declarative region, a namespace-alias-definition can be
2677 used to redefine a namespace-alias declared in that declarative
2678 region to refer only to the namespace to which it already
2679 refers. */
2680 ok = false;
2681 else if (TREE_CODE (bval)((enum tree_code) (bval)->base.code) == USING_DECL
2682 && CONST_DECL_USING_P (decl)(((enum tree_code) (decl)->base.code) == CONST_DECL &&
((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2682, __FUNCTION__))->typed.type) && ((enum tree_code
) (((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2682, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
&& ((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2682, __FUNCTION__))->decl_minimal.context) != ((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2682, __FUNCTION__))->typed.type))
)
2683 /* Let the clone hide the using-decl that introduced it. */
2684 binding->value = decl;
2685 else
2686 {
2687 if (!error_operand_p (bval))
2688 diagnose_name_conflict (decl, bval);
2689 ok = false;
2690 }
2691
2692 return ok;
2693}
2694
2695/* Diagnose a name conflict between DECL and BVAL.
2696
2697 This is non-static so maybe_push_used_methods can use it and avoid changing
2698 the diagnostic for inherit/using4.C; otherwise it should not be used from
2699 outside this file. */
2700
2701void
2702diagnose_name_conflict (tree decl, tree bval)
2703{
2704 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_CODE (bval)((enum tree_code) (bval)->base.code)
2705 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != NAMESPACE_DECL
2706 && !DECL_DECLARES_FUNCTION_P (decl)(((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2706, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2706, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
2707 && (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL
2708 || DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2708, __FUNCTION__))->decl_common.artificial_flag)
== DECL_ARTIFICIAL (bval)((contains_struct_check ((bval), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2708, __FUNCTION__))->decl_common.artificial_flag)
)
2709 && CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2709, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2709, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2709, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
== CP_DECL_CONTEXT (bval)(!(! (((contains_struct_check ((bval), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2709, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((bval), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2709, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((bval)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2709, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
)
2710 {
2711 if (concept_definition_p (decl))
2712 error ("redeclaration of %q#D with different template parameters",
2713 decl);
2714 else
2715 error ("redeclaration of %q#D", decl);
2716 }
2717 else
2718 error ("%q#D conflicts with a previous declaration", decl);
2719
2720 inform (location_of (bval), "previous declaration %q#D", bval);
2721}
2722
2723/* Replace BINDING's current value on its scope's name list with
2724 NEWVAL. */
2725
2726static void
2727update_local_overload (cxx_binding *binding, tree newval)
2728{
2729 tree *d;
2730
2731 for (d = &binding->scope->names; ; d = &TREE_CHAIN (*d)((contains_struct_check ((*d), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2731, __FUNCTION__))->common.chain)
)
2732 if (*d == binding->value)
2733 {
2734 /* Stitch new list node in. */
2735 *d = tree_cons (DECL_NAME (*d)((contains_struct_check ((*d), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2735, __FUNCTION__))->decl_minimal.name)
, NULL_TREE(tree) nullptr, TREE_CHAIN (*d)((contains_struct_check ((*d), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2735, __FUNCTION__))->common.chain)
);
2736 break;
2737 }
2738 else if (TREE_CODE (*d)((enum tree_code) (*d)->base.code) == TREE_LIST && TREE_VALUE (*d)((tree_check ((*d), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2738, __FUNCTION__, (TREE_LIST)))->list.value)
== binding->value)
2739 break;
2740
2741 TREE_VALUE (*d)((tree_check ((*d), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2741, __FUNCTION__, (TREE_LIST)))->list.value)
= newval;
2742}
2743
2744/* Compares the parameter-type-lists of ONE and TWO and
2745 returns false if they are different. If the DECLs are template
2746 functions, the return types and the template parameter lists are
2747 compared too (DR 565). */
2748
2749static bool
2750matching_fn_p (tree one, tree two)
2751{
2752 if (TREE_CODE (one)((enum tree_code) (one)->base.code) != TREE_CODE (two)((enum tree_code) (two)->base.code))
2753 return false;
2754
2755 if (!compparms (TYPE_ARG_TYPES (TREE_TYPE (one))((tree_check2 ((((contains_struct_check ((one), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2755, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2755, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
,
2756 TYPE_ARG_TYPES (TREE_TYPE (two))((tree_check2 ((((contains_struct_check ((two), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2756, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2756, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
))
2757 return false;
2758
2759 if (TREE_CODE (one)((enum tree_code) (one)->base.code) == TEMPLATE_DECL)
2760 {
2761 /* Compare template parms. */
2762 if (!comp_template_parms (DECL_TEMPLATE_PARMS (one)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((one), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2762, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
2763 DECL_TEMPLATE_PARMS (two)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((two), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2763, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
))
2764 return false;
2765
2766 /* And return type. */
2767 if (!same_type_p (TREE_TYPE (TREE_TYPE (one)),comptypes ((((contains_struct_check ((((contains_struct_check
((one), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2767, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2767, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((two), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2768, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2768, __FUNCTION__))->typed.type)), 0)
2768 TREE_TYPE (TREE_TYPE (two)))comptypes ((((contains_struct_check ((((contains_struct_check
((one), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2767, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2767, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((two), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2768, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2768, __FUNCTION__))->typed.type)), 0)
)
2769 return false;
2770 }
2771
2772 if (!equivalently_constrained (one, two))
2773 return false;
2774
2775 return true;
2776}
2777
2778/* Push DECL into nonclass LEVEL BINDING or SLOT. OLD is the current
2779 binding value (possibly with anticipated builtins stripped).
2780 Diagnose conflicts and return updated decl. */
2781
2782static tree
2783update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
2784 tree old, tree decl, bool hiding = false)
2785{
2786 tree old_type = NULL_TREE(tree) nullptr;
2787 bool hide_type = false;
2788 bool hide_value = false;
2789
2790 if (!slot)
2791 {
2792 old_type = binding->type;
2793 hide_type = HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden);
2794 if (!old_type)
2795 hide_value = hide_type, hide_type = false;
2796 }
2797 else if (STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2797, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2797, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
2798 {
2799 old_type = STAT_TYPE (*slot)((contains_struct_check ((*slot), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2799, __FUNCTION__))->typed.type)
;
2800 hide_type = STAT_TYPE_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2800, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2800, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
;
2801 hide_value = STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2801, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2801, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
2802 }
2803
2804 tree to_val = decl;
2805 tree to_type = old_type;
2806 bool local_overload = false;
2807
2808 gcc_assert (!level || level->kind == sk_namespace ? !binding((void)(!(!level || level->kind == sk_namespace ? !binding
: level->kind != sk_class && !slot) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2809, __FUNCTION__), 0 : 0))
2809 : level->kind != sk_class && !slot)((void)(!(!level || level->kind == sk_namespace ? !binding
: level->kind != sk_class && !slot) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2809, __FUNCTION__), 0 : 0))
;
2810
2811 if (old == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2812 old = NULL_TREE(tree) nullptr;
2813
2814 if (DECL_IMPLICIT_TYPEDEF_P (decl)(((enum tree_code) (decl)->base.code) == TYPE_DECL &&
((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2814, __FUNCTION__))->decl_common.lang_flag_2))
)
2815 {
2816 /* Pushing an artificial decl. We should not find another
2817 artificial decl here already -- lookup_elaborated_type will
2818 have already found it. */
2819 gcc_checking_assert (!to_type((void)(!(!to_type && !(old && (((enum tree_code
) (old)->base.code) == TYPE_DECL && ((contains_struct_check
((old), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2820, __FUNCTION__))->decl_common.lang_flag_2)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2820, __FUNCTION__), 0 : 0))
2820 && !(old && DECL_IMPLICIT_TYPEDEF_P (old)))((void)(!(!to_type && !(old && (((enum tree_code
) (old)->base.code) == TYPE_DECL && ((contains_struct_check
((old), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2820, __FUNCTION__))->decl_common.lang_flag_2)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2820, __FUNCTION__), 0 : 0))
;
2821
2822 if (old)
2823 {
2824 /* Put DECL into the type slot. */
2825 gcc_checking_assert (!to_type)((void)(!(!to_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2825, __FUNCTION__), 0 : 0))
;
2826 hide_type = hiding;
2827 to_type = decl;
2828 to_val = old;
2829 }
2830 else
2831 hide_value = hiding;
2832
2833 goto done;
2834 }
2835
2836 if (old && DECL_IMPLICIT_TYPEDEF_P (old)(((enum tree_code) (old)->base.code) == TYPE_DECL &&
((contains_struct_check ((old), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2836, __FUNCTION__))->decl_common.lang_flag_2))
)
2837 {
2838 /* OLD is an implicit typedef. Move it to to_type. */
2839 gcc_checking_assert (!to_type)((void)(!(!to_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2839, __FUNCTION__), 0 : 0))
;
2840
2841 to_type = old;
2842 hide_type = hide_value;
2843 old = NULL_TREE(tree) nullptr;
2844 hide_value = false;
2845 }
2846
2847 if (DECL_DECLARES_FUNCTION_P (decl)(((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2847, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2847, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2848 {
2849 if (!old)
2850 ;
2851 else if (OVL_P (old)(((enum tree_code) (old)->base.code) == FUNCTION_DECL || (
(enum tree_code) (old)->base.code) == OVERLOAD)
)
2852 {
2853 for (ovl_iterator iter (old); iter; ++iter)
2854 {
2855 tree fn = *iter;
2856
2857 if (iter.using_p () && matching_fn_p (fn, decl))
2858 {
2859 gcc_checking_assert (!iter.hidden_p ())((void)(!(!iter.hidden_p ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2859, __FUNCTION__), 0 : 0))
;
2860 /* If a function declaration in namespace scope or
2861 block scope has the same name and the same
2862 parameter-type- list (8.3.5) as a function
2863 introduced by a using-declaration, and the
2864 declarations do not declare the same function,
2865 the program is ill-formed. [namespace.udecl]/14 */
2866 if (tree match = duplicate_decls (decl, fn, hiding))
2867 return match;
2868 else
2869 /* FIXME: To preserve existing error behavior, we
2870 still push the decl. This might change. */
2871 diagnose_name_conflict (decl, fn);
2872 }
2873 }
2874 }
2875 else
2876 goto conflict;
2877
2878 if (to_type != old_type
2879 && warn_shadowglobal_options.x_warn_shadow
2880 && MAYBE_CLASS_TYPE_P (TREE_TYPE (to_type))((((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code) == TYPENAME_TYPE
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code) == TYPEOF_TYPE
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code) == DECLTYPE_TYPE
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code) == TRAIT_TYPE
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code) == DEPENDENT_OPERATOR_TYPE
) || (((((enum tree_code) (((contains_struct_check ((to_type)
, (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((to_type), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((to_type
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2880, __FUNCTION__))->type_common.lang_flag_5)))
2881 && !(DECL_IN_SYSTEM_HEADER (decl)(in_system_header_at (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2881, __FUNCTION__))->decl_minimal.locus)))
2882 && DECL_IN_SYSTEM_HEADER (to_type)(in_system_header_at (((contains_struct_check ((to_type), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2882, __FUNCTION__))->decl_minimal.locus)))
))
2883 warning (OPT_Wshadow, "%q#D hides constructor for %q#D",
2884 decl, to_type);
2885
2886 local_overload = old && level && level->kind != sk_namespace;
2887 to_val = ovl_insert (decl, old, -int (hiding));
2888 }
2889 else if (old)
2890 {
2891 if (TREE_CODE (old)((enum tree_code) (old)->base.code) != TREE_CODE (decl)((enum tree_code) (decl)->base.code))
2892 /* Different kinds of decls conflict. */
2893 goto conflict;
2894 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL)
2895 {
2896 if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl))comptypes ((((contains_struct_check ((old), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2896, __FUNCTION__))->typed.type)), (((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2896, __FUNCTION__))->typed.type)), 0)
)
2897 /* Two type decls to the same type. Do nothing. */
2898 return old;
2899 else
2900 goto conflict;
2901 }
2902 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == NAMESPACE_DECL)
2903 {
2904 /* Two maybe-aliased namespaces. If they're to the same target
2905 namespace, that's ok. */
2906 if (ORIGINAL_NAMESPACE (old)(((contains_struct_check (((tree_check ((old), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((old), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__))->decl_common.abstract_origin) : (old
))
!= ORIGINAL_NAMESPACE (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2906, __FUNCTION__))->decl_common.abstract_origin) : (decl
))
)
2907 goto conflict;
2908
2909 /* The new one must be an alias at this point. */
2910 gcc_assert (DECL_NAMESPACE_ALIAS (decl))((void)(!(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2910, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2910, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2910, __FUNCTION__), 0 : 0))
;
2911 return old;
2912 }
2913 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == VAR_DECL)
2914 {
2915 /* There can be two block-scope declarations of the same
2916 variable, so long as they are `extern' declarations. */
2917 if (!DECL_EXTERNAL (old)((contains_struct_check ((old), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2917, __FUNCTION__))->decl_common.decl_flag_1)
|| !DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2917, __FUNCTION__))->decl_common.decl_flag_1)
)
2918 goto conflict;
2919 else if (tree match = duplicate_decls (decl, old))
2920 {
2921 gcc_checking_assert (!hide_value && !hiding)((void)(!(!hide_value && !hiding) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2921, __FUNCTION__), 0 : 0))
;
2922 return match;
2923 }
2924 else
2925 goto conflict;
2926 }
2927 else
2928 {
2929 conflict:
2930 diagnose_name_conflict (decl, old);
2931 to_val = NULL_TREE(tree) nullptr;
2932 }
2933 }
2934 else if (hiding)
2935 hide_value = true;
2936
2937 done:
2938 if (to_val)
2939 {
2940 if (local_overload)
2941 {
2942 gcc_checking_assert (binding->value && OVL_P (binding->value))((void)(!(binding->value && (((enum tree_code) (binding
->value)->base.code) == FUNCTION_DECL || ((enum tree_code
) (binding->value)->base.code) == OVERLOAD)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2942, __FUNCTION__), 0 : 0))
;
2943 update_local_overload (binding, to_val);
2944 }
2945 else if (level
2946 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
2947 && !DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2947, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2947, __FUNCTION__))->decl_common.abstract_origin)
))
2948 /* Don't add namespaces here. They're done in
2949 push_namespace. */
2950 add_decl_to_level (level, decl);
2951
2952 if (slot)
2953 {
2954 if (STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2954, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2954, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
2955 {
2956 STAT_TYPE (*slot)((contains_struct_check ((*slot), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2956, __FUNCTION__))->typed.type)
= to_type;
2957 STAT_DECL (*slot)(((struct tree_overload*)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2957, __FUNCTION__, (OVERLOAD))))->function)
= to_val;
2958 STAT_TYPE_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2958, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2958, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
= hide_type;
2959 STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2959, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2959, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= hide_value;
2960 }
2961 else if (to_type || hide_value)
2962 {
2963 *slot = stat_hack (to_val, to_type);
2964 STAT_TYPE_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2964, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2964, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
= hide_type;
2965 STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2965, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2965, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= hide_value;
2966 }
2967 else
2968 {
2969 gcc_checking_assert (!hide_type)((void)(!(!hide_type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2969, __FUNCTION__), 0 : 0))
;
2970 *slot = to_val;
2971 }
2972 }
2973 else
2974 {
2975 binding->type = to_type;
2976 binding->value = to_val;
2977 HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden) = hide_type || hide_value;
2978 }
2979 }
2980
2981 return decl;
2982}
2983
2984/* Table of identifiers to extern C declarations (or LISTS thereof). */
2985
2986static GTY(()) hash_table<named_decl_hash> *extern_c_decls;
2987
2988/* DECL has C linkage. If we have an existing instance, make sure the
2989 new one is compatible. Make sure it has the same exception
2990 specification [7.5, 7.6]. Add DECL to the map. */
2991
2992static void
2993check_extern_c_conflict (tree decl)
2994{
2995 /* Ignore artificial or system header decls. */
2996 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2996, __FUNCTION__))->decl_common.artificial_flag)
|| DECL_IN_SYSTEM_HEADER (decl)(in_system_header_at (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 2996, __FUNCTION__))->decl_minimal.locus)))
)
2997 return;
2998
2999 /* This only applies to decls at namespace scope. */
3000 if (!DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3000, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3000, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3000, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3000, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
3001 return;
3002
3003 if (!extern_c_decls)
3004 extern_c_decls = hash_table<named_decl_hash>::create_ggc (127);
3005
3006 tree *slot = extern_c_decls
3007 ->find_slot_with_hash (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3007, __FUNCTION__))->decl_minimal.name)
,
3008 IDENTIFIER_HASH_VALUE (DECL_NAME (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3008, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3008, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
, INSERT);
3009 if (tree old = *slot)
3010 {
3011 if (TREE_CODE (old)((enum tree_code) (old)->base.code) == OVERLOAD)
3012 old = OVL_FUNCTION (old)(((struct tree_overload*)(tree_check ((old), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3012, __FUNCTION__, (OVERLOAD))))->function)
;
3013
3014 int mismatch = 0;
3015 if (DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3015, __FUNCTION__))->decl_minimal.context)
== DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3015, __FUNCTION__))->decl_minimal.context)
)
3016 ; /* If they're in the same context, we'll have already complained
3017 about a (possible) mismatch, when inserting the decl. */
3018 else if (!decls_match (decl, old))
3019 mismatch = 1;
3020 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3021 && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (old))((tree_class_check (((tree_check2 ((((contains_struct_check (
(old), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3021, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3021, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3021, __FUNCTION__))->type_non_common.lang_1)
,
3022 TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl))((tree_class_check (((tree_check2 ((((contains_struct_check (
(decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3022, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3022, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3022, __FUNCTION__))->type_non_common.lang_1)
,
3023 ce_normal))
3024 mismatch = -1;
3025 else if (DECL_ASSEMBLER_NAME_SET_P (old)(((contains_struct_check ((old), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3025, __FUNCTION__))->decl_with_vis.assembler_name) != (
tree) nullptr)
)
3026 SET_DECL_ASSEMBLER_NAME (decl, DECL_ASSEMBLER_NAME (old))overwrite_decl_assembler_name (decl, decl_assembler_name (old
))
;
3027
3028 if (mismatch)
3029 {
3030 auto_diagnostic_group d;
3031 pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3031, __FUNCTION__))->decl_minimal.locus)
, 0,
3032 "conflicting C language linkage declaration %q#D", decl);
3033 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3033, __FUNCTION__))->decl_minimal.locus)
,
3034 "previous declaration %q#D", old);
3035 if (mismatch < 0)
3036 inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3036, __FUNCTION__))->decl_minimal.locus)
,
3037 "due to different exception specifications");
3038 }
3039 else
3040 {
3041 if (old == *slot)
3042 /* The hash table expects OVERLOADS, so construct one with
3043 OLD as both the function and the chain. This allocate
3044 an excess OVERLOAD node, but it's rare to have multiple
3045 extern "C" decls of the same name. And we save
3046 complicating the hash table logic (which is used
3047 elsewhere). */
3048 *slot = ovl_make (old, old);
3049
3050 slot = &OVL_CHAIN (*slot)(((struct tree_overload*)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3050, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3051
3052 /* Chain it on for c_linkage_binding's use. */
3053 *slot = tree_cons (NULL_TREE(tree) nullptr, decl, *slot);
3054 }
3055 }
3056 else
3057 *slot = decl;
3058}
3059
3060/* Returns a list of C-linkage decls with the name NAME. Used in
3061 c-family/c-pragma.cc to implement redefine_extname pragma. */
3062
3063tree
3064c_linkage_bindings (tree name)
3065{
3066 if (extern_c_decls)
3067 if (tree *slot = extern_c_decls
3068 ->find_slot_with_hash (name, IDENTIFIER_HASH_VALUE (name)((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3068, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
, NO_INSERT))
3069 {
3070 tree result = *slot;
3071 if (TREE_CODE (result)((enum tree_code) (result)->base.code) == OVERLOAD)
3072 result = OVL_CHAIN (result)(((struct tree_overload*)(tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3072, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3073 return result;
3074 }
3075
3076 return NULL_TREE(tree) nullptr;
3077}
3078
3079/* Subroutine of check_local_shadow. */
3080
3081static void
3082inform_shadowed (tree shadowed)
3083{
3084 inform (DECL_SOURCE_LOCATION (shadowed)((contains_struct_check ((shadowed), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3084, __FUNCTION__))->decl_minimal.locus)
,
3085 "shadowed declaration is here");
3086}
3087
3088/* DECL is being declared at a local scope. Emit suitable shadow
3089 warnings. */
3090
3091static void
3092check_local_shadow (tree decl)
3093{
3094 /* Don't complain about the parms we push and then pop
3095 while tentatively parsing a function declarator. */
3096 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL && !DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3096, __FUNCTION__))->decl_minimal.context)
)
3097 return;
3098
3099 /* External decls are something else. */
3100 if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3100, __FUNCTION__))->decl_common.decl_flag_1)
)
3101 return;
3102
3103 tree old = NULL_TREE(tree) nullptr;
3104 cp_binding_level *old_scope = NULLnullptr;
3105 if (cxx_binding *binding = outer_binding (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3105, __FUNCTION__))->decl_minimal.name)
, NULLnullptr, true))
3106 {
3107 old = binding->value;
3108 old_scope = binding->scope;
3109 }
3110
3111 if (old
3112 && (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3113 || VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3114 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3115 && (!DECL_ARTIFICIAL (old)((contains_struct_check ((old), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3115, __FUNCTION__))->decl_common.artificial_flag)
3116 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)))
3117 && DECL_FUNCTION_SCOPE_P (old)(((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3117, __FUNCTION__))->decl_minimal.context) && (
(enum tree_code) (((contains_struct_check ((old), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3117, __FUNCTION__))->decl_minimal.context))->base.code
) == FUNCTION_DECL)
3118 && (!DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3118, __FUNCTION__))->decl_common.artificial_flag)
3119 || is_capture_proxy (decl)
3120 || DECL_IMPLICIT_TYPEDEF_P (decl)(((enum tree_code) (decl)->base.code) == TYPE_DECL &&
((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3120, __FUNCTION__))->decl_common.lang_flag_2))
3121 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_ANON_UNION_VAR_P (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3121, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3121, __FUNCTION__))->decl_common.lang_flag_4))
)))
3122 {
3123 /* DECL shadows a local thing possibly of interest. */
3124
3125 /* DR 2211: check that captures and parameters
3126 do not have the same name. */
3127 if (is_capture_proxy (decl))
3128 {
3129 if (current_lambda_expr ()
3130 && DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3130, __FUNCTION__))->decl_minimal.context)
== lambda_function (current_lambda_expr ())
3131 && TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3132 && DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3132, __FUNCTION__))->decl_minimal.name)
!= this_identifiercp_global_trees[CPTI_THIS_IDENTIFIER])
3133 {
3134 error_at (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3134, __FUNCTION__))->decl_minimal.locus)
,
3135 "lambda parameter %qD "
3136 "previously declared as a capture", old);
3137 }
3138 return;
3139 }
3140 /* Don't complain if it's from an enclosing function. */
3141 else if (DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3141, __FUNCTION__))->decl_minimal.context)
== current_function_decl
3142 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
3143 && TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL)
3144 {
3145 /* Go to where the parms should be and see if we find
3146 them there. */
3147 cp_binding_level *b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain;
3148
3149 if (FUNCTION_NEEDS_BODY_BLOCK (current_function_decl)(((tree_check (((((enum tree_code) (current_function_decl)->
base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) || ((tree_check (((((enum tree_code) (current_function_decl
)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
) || ((((enum tree_code) (current_function_decl)->base.code
) == FUNCTION_DECL || (((enum tree_code) (current_function_decl
)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) && (((tree_not_check2 (
((tree_check ((((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) && ((__extension__ ({ struct lang_decl
*lt = ((contains_struct_check (((((enum tree_code) (current_function_decl
)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL
|| (((enum tree_code) (current_function_decl)->base.code)
== TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__); &lt->u.fn; })->ovl_op_code) ==
OVL_OP_CALL_EXPR) && (((enum tree_code) ((!(! (((contains_struct_check
((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == RECORD_TYPE && ((((
tree_class_check ((((tree_class_check (((!(! (((contains_struct_check
((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check
((current_function_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3149, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))))
)
3150 /* Skip the ctor/dtor cleanup level. */
3151 b = b->level_chain;
3152
3153 /* [basic.scope.param] A parameter name shall not be redeclared
3154 in the outermost block of the function definition. */
3155 if (b->kind == sk_function_parms)
3156 {
3157 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3157, __FUNCTION__))->decl_minimal.locus)
,
3158 "declaration of %q#D shadows a parameter", decl);
3159 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3159, __FUNCTION__))->decl_minimal.locus)
,
3160 "%q#D previously declared here", old);
3161 return;
3162 }
3163 }
3164
3165 /* The local structure or class can't use parameters of
3166 the containing function anyway. */
3167 if (DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3167, __FUNCTION__))->decl_minimal.context)
!= current_function_decl)
3168 {
3169 for (cp_binding_level *scope = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
3170 scope != old_scope; scope = scope->level_chain)
3171 if (scope->kind == sk_class
3172 && !LAMBDA_TYPE_P (scope->this_entity)(((enum tree_code) (scope->this_entity)->base.code) == RECORD_TYPE
&& ((((tree_class_check ((((tree_class_check ((scope
->this_entity), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check ((scope->this_entity
), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3172, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))
)
3173 return;
3174 }
3175 /* Error if redeclaring a local declared in a
3176 init-statement or in the condition of an if or
3177 switch statement when the new declaration is in the
3178 outermost block of the controlled statement.
3179 Redeclaring a variable from a for or while condition is
3180 detected elsewhere. */
3181 else if (VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3182 && old_scope == current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain
3183 && (old_scope->kind == sk_cond || old_scope->kind == sk_for))
3184 {
3185 auto_diagnostic_group d;
3186 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3186, __FUNCTION__))->decl_minimal.locus)
,
3187 "redeclaration of %q#D", decl);
3188 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3188, __FUNCTION__))->decl_minimal.locus)
,
3189 "%q#D previously declared here", old);
3190 return;
3191 }
3192 /* C++11:
3193 3.3.3/3: The name declared in an exception-declaration (...)
3194 shall not be redeclared in the outermost block of the handler.
3195 3.3.3/2: A parameter name shall not be redeclared (...) in
3196 the outermost block of any handler associated with a
3197 function-try-block.
3198 3.4.1/15: The function parameter names shall not be redeclared
3199 in the exception-declaration nor in the outermost block of a
3200 handler for the function-try-block. */
3201 else if ((TREE_CODE (old)((enum tree_code) (old)->base.code) == VAR_DECL
3202 && old_scope == current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain
3203 && old_scope->kind == sk_catch)
3204 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3205 && (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_catch
3206 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain->kind == sk_catch)
3207 && in_function_try_handler((cfun + 0)->language)->x_in_function_try_handler))
3208 {
3209 auto_diagnostic_group d;
3210 if (permerror (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3210, __FUNCTION__))->decl_minimal.locus)
,
3211 "redeclaration of %q#D", decl))
3212 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3212, __FUNCTION__))->decl_minimal.locus)
,
3213 "%q#D previously declared here", old);
3214 return;
3215 }
3216
3217 /* If '-Wshadow=compatible-local' is specified without other
3218 -Wshadow= flags, we will warn only when the type of the
3219 shadowing variable (DECL) can be converted to that of the
3220 shadowed parameter (OLD_LOCAL). The reason why we only check
3221 if DECL's type can be converted to OLD_LOCAL's type (but not the
3222 other way around) is because when users accidentally shadow a
3223 parameter, more than often they would use the variable
3224 thinking (mistakenly) it's still the parameter. It would be
3225 rare that users would use the variable in the place that
3226 expects the parameter but thinking it's a new decl.
3227 If either object is a TYPE_DECL, '-Wshadow=compatible-local'
3228 warns regardless of whether one of the types involved
3229 is a subclass of the other, since that is never okay. */
3230
3231 enum opt_code warning_code;
3232 if (warn_shadowglobal_options.x_warn_shadow)
3233 warning_code = OPT_Wshadow;
3234 else if ((TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)
3235 ^ (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL))
3236 /* If exactly one is a type, they aren't compatible. */
3237 warning_code = OPT_Wshadow_local;
3238 else if ((TREE_TYPE (old)((contains_struct_check ((old), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3238, __FUNCTION__))->typed.type)
3239 && TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3239, __FUNCTION__))->typed.type)
3240 && same_type_p (TREE_TYPE (old), TREE_TYPE (decl))comptypes ((((contains_struct_check ((old), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3240, __FUNCTION__))->typed.type)), (((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3240, __FUNCTION__))->typed.type)), 0)
)
3241 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
3242 || TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3243 || (!dependent_type_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3243, __FUNCTION__))->typed.type)
)
3244 && !dependent_type_p (TREE_TYPE (old)((contains_struct_check ((old), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3244, __FUNCTION__))->typed.type)
)
3245 /* If the new decl uses auto, we don't yet know
3246 its type (the old type cannot be using auto
3247 at this point, without also being
3248 dependent). This is an indication we're
3249 (now) doing the shadow checking too
3250 early. */
3251 && !type_uses_auto (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3251, __FUNCTION__))->typed.type)
)
3252 && can_convert_arg (TREE_TYPE (old)((contains_struct_check ((old), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3252, __FUNCTION__))->typed.type)
, TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3252, __FUNCTION__))->typed.type)
,
3253 decl, LOOKUP_IMPLICIT(((1 << 0)) | (1 << 2)), tf_none)))
3254 warning_code = OPT_Wshadow_compatible_local;
3255 else
3256 warning_code = OPT_Wshadow_local;
3257
3258 const char *msg;
3259 if (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL)
3260 msg = "declaration of %q#D shadows a parameter";
3261 else if (is_capture_proxy (old))
3262 msg = "declaration of %qD shadows a lambda capture";
3263 else
3264 msg = "declaration of %qD shadows a previous local";
3265
3266 auto_diagnostic_group d;
3267 if (warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3267, __FUNCTION__))->decl_minimal.locus)
, warning_code, msg, decl))
3268 inform_shadowed (old);
3269 return;
3270 }
3271
3272 if (!warn_shadowglobal_options.x_warn_shadow)
3273 return;
3274
3275 /* Don't warn for artificial things that are not implicit typedefs. */
3276 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3276, __FUNCTION__))->decl_common.artificial_flag)
&& !DECL_IMPLICIT_TYPEDEF_P (decl)(((enum tree_code) (decl)->base.code) == TYPE_DECL &&
((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3276, __FUNCTION__))->decl_common.lang_flag_2))
)
3277 return;
3278
3279 if (nonlambda_method_basetype ())
3280 if (tree member = lookup_member (current_nonlambda_class_type (),
3281 DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3281, __FUNCTION__))->decl_minimal.name)
, /*protect=*/0,
3282 /*want_type=*/false, tf_warning_or_error))
3283 {
3284 member = MAYBE_BASELINK_FUNCTIONS (member)((((enum tree_code) (member)->base.code) == BASELINK) ? ((
(struct tree_baselink*) (tree_check ((member), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3284, __FUNCTION__, (BASELINK))))->functions) : member)
;
3285
3286 /* Warn if a variable shadows a non-function, or the variable
3287 is a function or a pointer-to-function. */
3288 if ((!OVL_P (member)(((enum tree_code) (member)->base.code) == FUNCTION_DECL ||
((enum tree_code) (member)->base.code) == OVERLOAD)
3289 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3290 || (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3290, __FUNCTION__))->typed.type)
3291 && (TYPE_PTRFN_P (TREE_TYPE (decl))((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3291, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
) && ((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3291, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3291, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
)
3292 || TYPE_PTRMEMFUNC_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3292, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
&& (((tree_class_check (((tree_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3292, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3292, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3292, __FUNCTION__))->type_common.lang_flag_2)))
)))
3293 && !warning_suppressed_p (decl, OPT_Wshadow))
3294 {
3295 auto_diagnostic_group d;
3296 if (warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3296, __FUNCTION__))->decl_minimal.locus)
, OPT_Wshadow,
3297 "declaration of %qD shadows a member of %qT",
3298 decl, current_nonlambda_class_type ())
3299 && DECL_P (member)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (member)->base.code))] == tcc_declaration)
)
3300 {
3301 inform_shadowed (member);
3302 suppress_warning (decl, OPT_Wshadow);
3303 }
3304 }
3305 return;
3306 }
3307
3308 /* Now look for a namespace shadow. */
3309 old = find_namespace_value (current_namespacescope_chain->old_namespace, DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3309, __FUNCTION__))->decl_minimal.name)
);
3310 if (old
3311 && (VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3312 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3313 && (!DECL_ARTIFICIAL (old)((contains_struct_check ((old), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3313, __FUNCTION__))->decl_common.artificial_flag)
3314 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)))
3315 && !instantiating_current_function_p ()
3316 && !warning_suppressed_p (decl, OPT_Wshadow))
3317 /* XXX shadow warnings in outer-more namespaces */
3318 {
3319 auto_diagnostic_group d;
3320 if (warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3320, __FUNCTION__))->decl_minimal.locus)
, OPT_Wshadow,
3321 "declaration of %qD shadows a global declaration",
3322 decl))
3323 {
3324 inform_shadowed (old);
3325 suppress_warning (decl, OPT_Wshadow);
3326 }
3327 return;
3328 }
3329
3330 return;
3331}
3332
3333/* DECL is being pushed inside function CTX. Set its context, if
3334 needed. */
3335
3336static void
3337set_decl_context_in_fn (tree ctx, tree decl)
3338{
3339 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3340 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3340, __FUNCTION__))->decl_common.decl_flag_1)
))
3341 /* Make sure local externs are marked as such. OMP UDRs really
3342 are nested functions. */
3343 gcc_checking_assert (DECL_LOCAL_DECL_P (decl)((void)(!(((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL) || (((enum tree_code
) (decl)->base.code) == FUNCTION_DECL && (__extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__), 0 : 0))
3344 && (DECL_NAMESPACE_SCOPE_P (decl)((void)(!(((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL) || (((enum tree_code
) (decl)->base.code) == FUNCTION_DECL && (__extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__), 0 : 0))
3345 || (TREE_CODE (decl) == FUNCTION_DECL((void)(!(((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL) || (((enum tree_code
) (decl)->base.code) == FUNCTION_DECL && (__extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__), 0 : 0))
3346 && DECL_OMP_DECLARE_REDUCTION_P (decl))))((void)(!(((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3343, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3344, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL) || (((enum tree_code
) (decl)->base.code) == FUNCTION_DECL && (__extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check (((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3346, __FUNCTION__), 0 : 0))
;
3347
3348 if (!DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3348, __FUNCTION__))->decl_minimal.context)
3349 /* When parsing the parameter list of a function declarator,
3350 don't set DECL_CONTEXT to an enclosing function. */
3351 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
3352 && parsing_function_declarator ()))
3353 DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3353, __FUNCTION__))->decl_minimal.context)
= ctx;
3354}
3355
3356/* DECL is a local extern decl. Find or create the namespace-scope
3357 decl that it aliases. Also, determines the linkage of DECL. */
3358
3359void
3360push_local_extern_decl_alias (tree decl)
3361{
3362 if (dependent_type_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3362, __FUNCTION__))->typed.type)
)
3363 || (processing_template_declscope_chain->x_processing_template_decl
3364 && VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
3365 && CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3365, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3365, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
))
3366 return;
3367 /* EH specs were not part of the function type prior to c++17, but
3368 we still can't go pushing dependent eh specs into the namespace. */
3369 if (cxx_dialect < cxx17
3370 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3371 && (value_dependent_expression_p
3372 (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl))((tree_class_check (((tree_check2 ((((contains_struct_check (
(decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3372, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3372, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3372, __FUNCTION__))->type_non_common.lang_1)
)))
3373 return;
3374
3375 gcc_checking_assert (!DECL_LANG_SPECIFIC (decl)((void)(!(!((contains_struct_check ((decl), (TS_DECL_COMMON),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3375, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3376, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3376, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3376, __FUNCTION__), 0 : 0))
3376 || !DECL_TEMPLATE_INFO (decl))((void)(!(!((contains_struct_check ((decl), (TS_DECL_COMMON),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3375, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3376, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3376, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3376, __FUNCTION__), 0 : 0))
;
3377 if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_specific)
&& DECL_LOCAL_DECL_ALIAS (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((void)(!(((contains_struct_check (((tree_check2 ((decl),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_specific); if (!(
(((enum tree_code) ((((void)(!(((contains_struct_check (((tree_check2
((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == VAR_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == FUNCTION_DECL
) || ((enum tree_code) ((((void)(!(((contains_struct_check ((
(tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == FIELD_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == CONST_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == TYPE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == TEMPLATE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == USING_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__), 0 : 0)), decl))->base.code) == CONCEPT_DECL
)) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3377, __FUNCTION__); &lt->u.min; })->access)
)
3378 /* We're instantiating a non-dependent local decl, it already
3379 knows the alias. */
3380 return;
3381
3382 tree alias = NULL_TREE(tree) nullptr;
3383
3384 if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3384, __FUNCTION__))->decl_common.size)
&& !TREE_CONSTANT (DECL_SIZE (decl))((non_type_check ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3384, __FUNCTION__))->decl_common.size)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3384, __FUNCTION__))->base.constant_flag)
)
3385 /* Do not let a VLA creep into a namespace. Diagnostic will be
3386 emitted in layout_var_decl later. */
3387 alias = error_mark_nodeglobal_trees[TI_ERROR_MARK];
3388 else
3389 {
3390 /* First look for a decl that matches. */
3391 tree ns = CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3391, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3391, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3391, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
3392 tree binding = find_namespace_value (ns, DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3392, __FUNCTION__))->decl_minimal.name)
);
3393
3394 if (binding && TREE_CODE (binding)((enum tree_code) (binding)->base.code) != TREE_LIST)
3395 for (ovl_iterator iter (binding); iter; ++iter)
3396 if (decls_match (decl, *iter, /*record_versions*/false))
3397 {
3398 alias = *iter;
3399 break;
3400 }
3401
3402 if (!alias)
3403 {
3404 /* No existing namespace-scope decl. Make one. */
3405 alias = copy_decl (decl);
3406 if (TREE_CODE (alias)((enum tree_code) (alias)->base.code) == FUNCTION_DECL)
3407 {
3408 /* Recontextualize the parms. */
3409 for (tree *chain = &DECL_ARGUMENTS (alias)((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3409, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
;
3410 *chain; chain = &DECL_CHAIN (*chain)(((contains_struct_check (((contains_struct_check ((*chain), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3410, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3410, __FUNCTION__))->common.chain))
)
3411 {
3412 *chain = copy_decl (*chain);
3413 DECL_CONTEXT (*chain)((contains_struct_check ((*chain), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3413, __FUNCTION__))->decl_minimal.context)
= alias;
3414 }
3415
3416 tree type = TREE_TYPE (alias)((contains_struct_check ((alias), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3416, __FUNCTION__))->typed.type)
;
3417 for (tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3417, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
3418 args; args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3418, __FUNCTION__))->common.chain)
)
3419 if (TREE_PURPOSE (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3419, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
3420 {
3421 /* There are default args. Lose them. */
3422 tree nargs = NULL_TREE(tree) nullptr;
3423 tree *chain = &nargs;
3424 for (args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3424, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
3425 args; args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3425, __FUNCTION__))->common.chain)
)
3426 if (args == void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
3427 {
3428 *chain = args;
3429 break;
3430 }
3431 else
3432 {
3433 *chain
3434 = build_tree_list (NULL_TREE(tree) nullptr, TREE_VALUE (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3434, __FUNCTION__, (TREE_LIST)))->list.value)
);
3435 chain = &TREE_CHAIN (*chain)((contains_struct_check ((*chain), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3435, __FUNCTION__))->common.chain)
;
3436 }
3437
3438 tree fn_type = build_function_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3438, __FUNCTION__))->typed.type)
, nargs);
3439
3440 fn_type = apply_memfn_quals
3441 (fn_type, type_memfn_quals (type));
3442
3443 fn_type = build_cp_fntype_variant
3444 (fn_type, type_memfn_rqual (type),
3445 TYPE_RAISES_EXCEPTIONS (type)((tree_class_check (((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3445, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3445, __FUNCTION__))->type_non_common.lang_1)
,
3446 TYPE_HAS_LATE_RETURN_TYPE (type)(((tree_class_check (((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3446, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3446, __FUNCTION__))->type_common.lang_flag_2))
);
3447
3448 TREE_TYPE (alias)((contains_struct_check ((alias), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3448, __FUNCTION__))->typed.type)
= fn_type;
3449 break;
3450 }
3451 }
3452
3453 /* This is the real thing. */
3454 DECL_LOCAL_DECL_P (alias)((contains_struct_check (((tree_check2 ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3454, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3454, __FUNCTION__))->decl_common.lang_flag_0)
= false;
3455
3456 /* Expected default linkage is from the namespace. */
3457 TREE_PUBLIC (alias)((alias)->base.public_flag) = TREE_PUBLIC (ns)((ns)->base.public_flag);
3458 push_nested_namespace (ns);
3459 alias = pushdecl (alias, /* hiding= */true);
3460 pop_nested_namespace (ns);
3461 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
3462 && CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3462, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3462, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
3463 && alias != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3464 set_decl_tls_model (alias, DECL_TLS_MODEL (decl)decl_tls_model (decl));
3465
3466 /* Adjust visibility. */
3467 determine_visibility (alias);
3468 }
3469 }
3470
3471 retrofit_lang_decl (decl);
3472 DECL_LOCAL_DECL_ALIAS (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((void)(!(((contains_struct_check (((tree_check2 ((decl),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_specific); if (!(
(((enum tree_code) ((((void)(!(((contains_struct_check (((tree_check2
((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == VAR_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == FUNCTION_DECL
) || ((enum tree_code) ((((void)(!(((contains_struct_check ((
(tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == FIELD_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == CONST_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == TYPE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == TEMPLATE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == USING_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__), 0 : 0)), decl))->base.code) == CONCEPT_DECL
)) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3472, __FUNCTION__); &lt->u.min; })->access)
= alias;
3473}
3474
3475/* If DECL has non-internal linkage, and we have a module vector,
3476 record it in the appropriate slot. We have already checked for
3477 duplicates. */
3478
3479static void
3480maybe_record_mergeable_decl (tree *slot, tree name, tree decl)
3481{
3482 if (TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
3483 return;
3484
3485 if (!TREE_PUBLIC (CP_DECL_CONTEXT (decl))(((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3485, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3485, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3485, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.public_flag)
)
3486 /* Member of internal namespace. */
3487 return;
3488
3489 tree not_tmpl = STRIP_TEMPLATE (decl)(((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3489, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)
;
3490 if ((TREE_CODE (not_tmpl)((enum tree_code) (not_tmpl)->base.code) == FUNCTION_DECL
3491 || TREE_CODE (not_tmpl)((enum tree_code) (not_tmpl)->base.code) == VAR_DECL)
3492 && DECL_THIS_STATIC (not_tmpl)((contains_struct_check (((tree_check3 ((not_tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3492, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL
)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3492, __FUNCTION__))->decl_common.lang_flag_6)
)
3493 /* Internal linkage. */
3494 return;
3495
3496 bool is_attached = (DECL_LANG_SPECIFIC (not_tmpl)((contains_struct_check ((not_tmpl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3496, __FUNCTION__))->decl_common.lang_specific)
3497 && DECL_MODULE_ATTACH_P (not_tmpl)(((contains_struct_check (((tree_not_check ((not_tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3497, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3497, __FUNCTION__))->decl_common.lang_specific)->u.base
.module_attach_p)
);
3498 tree *gslot = get_fixed_binding_slot
3499 (slot, name, is_attached ? BINDING_SLOT_PARTITION : BINDING_SLOT_GLOBAL,
3500 true);
3501
3502 if (!is_attached)
3503 {
3504 binding_slot &orig
3505 = BINDING_VECTOR_CLUSTER (*slot, 0)(((tree_binding_vec *)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3505, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_CURRENT];
3506
3507 if (!STAT_HACK_P (tree (orig))((tree (orig)) && ((enum tree_code) (tree (orig))->
base.code) == OVERLOAD && ((tree_not_check2 (((tree_check
((tree (orig)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3507, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3507, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3508 orig = stat_hack (tree (orig));
3509
3510 MODULE_BINDING_GLOBAL_P (tree (orig))((tree_check ((tree (orig)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3510, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
3511 }
3512
3513 add_mergeable_namespace_entity (gslot, decl);
3514}
3515
3516/* DECL is being pushed. Check whether it hides or ambiguates
3517 something seen as an import. This include decls seen in our own
3518 interface, which is OK. Also, check for merging a
3519 global/partition decl. */
3520
3521static tree
3522check_module_override (tree decl, tree mvec, bool hiding,
3523 tree scope, tree name)
3524{
3525 tree match = NULL_TREE(tree) nullptr;
3526 bitmap imports = get_import_bitmap ();
3527 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (mvec)(((tree_binding_vec *)(tree_check ((mvec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3527, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
3528 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (mvec)((tree_check ((mvec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3528, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
3529
3530 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
3531 {
3532 cluster++;
3533 ix--;
3534 }
3535
3536 for (; ix--; cluster++)
3537 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
3538 {
3539 /* Are we importing this module? */
3540 if (cluster->indices[jx].span != 1)
3541 continue;
3542 if (!cluster->indices[jx].base)
3543 continue;
3544 if (!bitmap_bit_p (imports, cluster->indices[jx].base))
3545 continue;
3546 /* Is it loaded? */
3547 if (cluster->slots[jx].is_lazy ())
3548 {
3549 gcc_assert (cluster->indices[jx].span == 1)((void)(!(cluster->indices[jx].span == 1) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3549, __FUNCTION__), 0 : 0))
;
3550 lazy_load_binding (cluster->indices[jx].base,
3551 scope, name, &cluster->slots[jx]);
3552 }
3553 tree bind = cluster->slots[jx];
3554 if (!bind)
3555 /* Errors could cause there to be nothing. */
3556 continue;
3557
3558 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3558, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3558, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3559 /* We do not have to check STAT_TYPE here, the xref_tag
3560 machinery deals with that problem. */
3561 bind = STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3561, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3562
3563 for (ovl_iterator iter (bind); iter; ++iter)
3564 if (!iter.using_p ())
3565 {
3566 match = duplicate_decls (decl, *iter, hiding);
3567 if (match)
3568 goto matched;
3569 }
3570 }
3571
3572 if (TREE_PUBLIC (scope)((scope)->base.public_flag) && TREE_PUBLIC (STRIP_TEMPLATE (decl))(((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3572, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
))->base.public_flag)
3573 /* Namespaces are dealt with specially in
3574 make_namespace_finish. */
3575 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL && !DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3575, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3575, __FUNCTION__))->decl_common.abstract_origin)
))
3576 {
3577 /* Look in the appropriate mergeable decl slot. */
3578 tree mergeable = NULL_TREE(tree) nullptr;
3579 if (named_module_p ())
3580 mergeable = BINDING_VECTOR_CLUSTER (mvec, BINDING_SLOT_PARTITION(((tree_binding_vec *)(tree_check ((mvec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3581, __FUNCTION__, (BINDING_VECTOR))))->vec[BINDING_SLOT_PARTITION
/ 2])
3581 / BINDING_VECTOR_SLOTS_PER_CLUSTER)(((tree_binding_vec *)(tree_check ((mvec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3581, __FUNCTION__, (BINDING_VECTOR))))->vec[BINDING_SLOT_PARTITION
/ 2])
3582 .slots[BINDING_SLOT_PARTITION % BINDING_VECTOR_SLOTS_PER_CLUSTER2];
3583 else
3584 mergeable = BINDING_VECTOR_CLUSTER (mvec, 0)(((tree_binding_vec *)(tree_check ((mvec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3584, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_GLOBAL];
3585
3586 for (ovl_iterator iter (mergeable); iter; ++iter)
3587 {
3588 match = duplicate_decls (decl, *iter, hiding);
3589 if (match)
3590 goto matched;
3591 }
3592 }
3593
3594 return NULL_TREE(tree) nullptr;
3595
3596 matched:
3597 if (match != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3598 {
3599 if (named_module_p ())
3600 BINDING_VECTOR_PARTITION_DUPS_P (mvec)((tree_check ((mvec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3600, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
= true;
3601 else
3602 BINDING_VECTOR_GLOBAL_DUPS_P (mvec)((tree_check ((mvec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3602, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag
)
= true;
3603 }
3604
3605 return match;
3606
3607
3608}
3609
3610/* Record DECL as belonging to the current lexical scope. Check for
3611 errors (such as an incompatible declaration for the same name
3612 already seen in the same scope).
3613
3614 The new binding is hidden if HIDING is true (an anticipated builtin
3615 or hidden friend).
3616
3617 Returns either DECL or an old decl for the same name. If an old
3618 decl is returned, it may have been smashed to agree with what DECL
3619 says. */
3620
3621tree
3622pushdecl (tree decl, bool hiding)
3623{
3624 auto_cond_timevar tv (TV_NAME_LOOKUP);
3625
3626 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3627 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3628
3629 if (!DECL_TEMPLATE_PARM_P (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3629, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL))
&& current_function_decl && !hiding)
3630 set_decl_context_in_fn (current_function_decl, decl);
3631
3632 /* The binding level we will be pushing into. During local class
3633 pushing, we want to push to the containing scope. */
3634 cp_binding_level *level = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
3635 while (level->kind == sk_class
3636 || level->kind == sk_cleanup)
3637 level = level->level_chain;
3638
3639 /* An anonymous namespace has a NULL DECL_NAME, but we still want to
3640 insert it. Other NULL-named decls, not so much. */
3641 tree name = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3641, __FUNCTION__))->decl_minimal.name)
;
3642 if (name ? !IDENTIFIER_ANON_P (name)((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3642, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
: TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL)
3643 {
3644 cxx_binding *binding = NULLnullptr; /* Local scope binding. */
3645 tree ns = NULL_TREE(tree) nullptr; /* Searched namespace. */
3646 tree *slot = NULLnullptr; /* Binding slot in namespace. */
3647 tree *mslot = NULLnullptr; /* Current module slot in namespace. */
3648 tree old = NULL_TREE(tree) nullptr;
3649
3650 if (level->kind == sk_namespace)
3651 {
3652 /* We look in the decl's namespace for an existing
3653 declaration, even though we push into the current
3654 namespace. */
3655 ns = (DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3655, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3655, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3655, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3655, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
3656 ? CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3656, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3656, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3656, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
: current_namespacescope_chain->old_namespace);
3657 /* Create the binding, if this is current namespace, because
3658 that's where we'll be pushing anyway. */
3659 slot = find_namespace_slot (ns, name, ns == current_namespacescope_chain->old_namespace);
3660 if (slot)
3661 {
3662 mslot = get_fixed_binding_slot (slot, name, BINDING_SLOT_CURRENT,
3663 ns == current_namespacescope_chain->old_namespace);
3664 old = MAYBE_STAT_DECL (*mslot)(((*mslot) && ((enum tree_code) (*mslot)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((*mslot
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3664, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3664, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((*mslot
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3664, __FUNCTION__, (OVERLOAD))))->function) : *mslot)
;
3665 }
3666 }
3667 else
3668 {
3669 binding = find_local_binding (level, name);
3670 if (binding)
3671 old = binding->value;
3672 }
3673
3674 if (old == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3675 old = NULL_TREE(tree) nullptr;
3676
3677 for (ovl_iterator iter (old); iter; ++iter)
3678 if (iter.using_p ())
3679 ; /* Ignore using decls here. */
3680 else if (iter.hidden_p ()
3681 && TREE_CODE (*iter)((enum tree_code) (*iter)->base.code) == FUNCTION_DECL
3682 && DECL_LANG_SPECIFIC (*iter)((contains_struct_check ((*iter), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3682, __FUNCTION__))->decl_common.lang_specific)
3683 && DECL_MODULE_IMPORT_P (*iter)(((contains_struct_check (((tree_not_check ((*iter), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3683, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3683, __FUNCTION__))->decl_common.lang_specific)->u.base
.module_import_p)
)
3684 ; /* An undeclared builtin imported from elsewhere. */
3685 else if (tree match
3686 = duplicate_decls (decl, *iter, hiding, iter.hidden_p ()))
3687 {
3688 if (match == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3689 ;
3690 else if (TREE_CODE (match)((enum tree_code) (match)->base.code) == TYPE_DECL)
3691 gcc_checking_assert (REAL_IDENTIFIER_TYPE_VALUE (name)((void)(!(((contains_struct_check ((name), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3691, __FUNCTION__))->typed.type) == (level->kind == sk_namespace
? (tree) nullptr : ((contains_struct_check ((match), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3693, __FUNCTION__))->typed.type))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3693, __FUNCTION__), 0 : 0))
3692 == (level->kind == sk_namespace((void)(!(((contains_struct_check ((name), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3691, __FUNCTION__))->typed.type) == (level->kind == sk_namespace
? (tree) nullptr : ((contains_struct_check ((match), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3693, __FUNCTION__))->typed.type))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3693, __FUNCTION__), 0 : 0))
3693 ? NULL_TREE : TREE_TYPE (match)))((void)(!(((contains_struct_check ((name), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3691, __FUNCTION__))->typed.type) == (level->kind == sk_namespace
? (tree) nullptr : ((contains_struct_check ((match), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3693, __FUNCTION__))->typed.type))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3693, __FUNCTION__), 0 : 0))
;
3694 else if (iter.hidden_p () && !hiding)
3695 {
3696 /* Unhiding a previously hidden decl. */
3697 tree head = iter.reveal_node (old);
3698 if (head != old)
3699 {
3700 gcc_checking_assert (ns)((void)(!(ns) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3700, __FUNCTION__), 0 : 0))
;
3701 if (STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3701, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3701, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3702 STAT_DECL (*slot)(((struct tree_overload*)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3702, __FUNCTION__, (OVERLOAD))))->function)
= head;
3703 else
3704 *slot = head;
3705 }
3706 if (DECL_EXTERN_C_P (match)((((contains_struct_check ((match), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3706, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((match), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3706, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (match)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
3707 /* We need to check and register the decl now. */
3708 check_extern_c_conflict (match);
3709 }
3710 else if (slot && !hiding
3711 && STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3711, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3711, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3711, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3711, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
3712 {
3713 /* Unhide the non-function. */
3714 gcc_checking_assert (old == match)((void)(!(old == match) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3714, __FUNCTION__), 0 : 0))
;
3715 if (!STAT_TYPE (*slot)((contains_struct_check ((*slot), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3715, __FUNCTION__))->typed.type)
)
3716 *slot = match;
3717 else
3718 STAT_DECL (*slot)(((struct tree_overload*)(tree_check ((*slot), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3718, __FUNCTION__, (OVERLOAD))))->function)
= match;
3719 }
3720 return match;
3721 }
3722
3723 /* Check for redeclaring an import. */
3724 if (slot && *slot && TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) == BINDING_VECTOR)
3725 if (tree match
3726 = check_module_override (decl, *slot, hiding, ns, name))
3727 {
3728 if (match == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3729 return match;
3730
3731 /* We found a decl in an interface, push it into this
3732 binding. */
3733 decl = update_binding (NULLnullptr, binding, mslot, old,
3734 match, hiding);
3735
3736 return decl;
3737 }
3738
3739 /* We are pushing a new decl. */
3740
3741 /* Skip a hidden builtin we failed to match already. There can
3742 only be one. */
3743 if (old && anticipated_builtin_p (old))
3744 old = OVL_CHAIN (old)(((struct tree_overload*)(tree_check ((old), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3744, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3745
3746 check_template_shadow (decl);
3747
3748 if (DECL_DECLARES_FUNCTION_P (decl)(((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3748, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3748, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
3749 {
3750 check_default_args (decl);
3751
3752 if (hiding)
3753 {
3754 if (level->kind != sk_namespace)
3755 {
3756 /* In a local class, a friend function declaration must
3757 find a matching decl in the innermost non-class scope.
3758 [class.friend/11] */
3759 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3759, __FUNCTION__))->decl_minimal.locus)
,
3760 "friend declaration %qD in local class without "
3761 "prior local declaration", decl);
3762 /* Don't attempt to push it. */
3763 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3764 }
3765 }
3766 }
3767
3768 if (level->kind != sk_namespace)
3769 {
3770 check_local_shadow (decl);
3771
3772 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL)
3773 /* A local namespace alias. */
3774 set_identifier_type_value_with_scope (name, NULL_TREE(tree) nullptr, level);
3775
3776 if (!binding)
3777 binding = create_local_binding (level, name);
3778 }
3779 else if (!slot)
3780 {
3781 ns = current_namespacescope_chain->old_namespace;
3782 slot = find_namespace_slot (ns, name, true);
3783 mslot = get_fixed_binding_slot (slot, name, BINDING_SLOT_CURRENT, true);
3784 /* Update OLD to reflect the namespace we're going to be
3785 pushing into. */
3786 old = MAYBE_STAT_DECL (*mslot)(((*mslot) && ((enum tree_code) (*mslot)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((*mslot
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3786, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3786, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((*mslot
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3786, __FUNCTION__, (OVERLOAD))))->function) : *mslot)
;
3787 }
3788
3789 old = update_binding (level, binding, mslot, old, decl, hiding);
3790
3791 if (old != decl)
3792 /* An existing decl matched, use it. */
3793 decl = old;
3794 else
3795 {
3796 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)
3797 {
3798 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3798, __FUNCTION__))->typed.type)
;
3799
3800 if (type != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3801 {
3802 if (TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3802, __FUNCTION__))->type_common.name)
!= decl)
3803 set_underlying_type (decl);
3804
3805 set_identifier_type_value_with_scope (name, decl, level);
3806
3807 if (level->kind != sk_namespace
3808 && !instantiating_current_function_p ())
3809 /* This is a locally defined typedef in a function that
3810 is not a template instantation, record it to implement
3811 -Wunused-local-typedefs. */
3812 record_locally_defined_typedef (decl);
3813 }
3814 }
3815 else if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
)
3816 {
3817 if (DECL_EXTERN_C_P (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3817, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3817, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (decl)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
3818 check_extern_c_conflict (decl);
3819
3820 if (!DECL_LOCAL_DECL_P (decl)((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3820, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3820, __FUNCTION__))->decl_common.lang_flag_0)
3821 && VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
3822 maybe_register_incomplete_var (decl);
3823
3824 if (DECL_LOCAL_DECL_P (decl)((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3824, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3824, __FUNCTION__))->decl_common.lang_flag_0)
3825 && NAMESPACE_SCOPE_P (decl)(((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (decl)->base.code))] == tcc_declaration) &&
(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3825, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3825, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3825, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3825, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)) || ((tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (decl)->
base.code))] == tcc_type) && (((enum tree_code) ((!(!
(((tree_class_check ((decl), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3825, __FUNCTION__))->type_common.context)) || ((enum tree_code
) (((tree_class_check ((decl), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3825, __FUNCTION__))->type_common.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((decl), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3825, __FUNCTION__))->type_common.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)))
)
3826 push_local_extern_decl_alias (decl);
3827 }
3828
3829 if (level->kind == sk_namespace
3830 && TREE_PUBLIC (level->this_entity)((level->this_entity)->base.public_flag)
3831 && module_p ())
3832 maybe_record_mergeable_decl (slot, name, decl);
3833 }
3834 }
3835 else
3836 add_decl_to_level (level, decl);
3837
3838 return decl;
3839}
3840
3841/* A mergeable entity is being loaded into namespace NS slot NAME.
3842 Create and return the appropriate vector slot for that. Either a
3843 GMF slot or a module-specific one. */
3844
3845tree *
3846mergeable_namespace_slots (tree ns, tree name, bool is_attached, tree *vec)
3847{
3848 tree *mslot = find_namespace_slot (ns, name, true);
3849 tree *vslot = get_fixed_binding_slot
3850 (mslot, name, is_attached ? BINDING_SLOT_PARTITION : BINDING_SLOT_GLOBAL,
3851 true);
3852
3853 gcc_checking_assert (TREE_CODE (*mslot) == BINDING_VECTOR)((void)(!(((enum tree_code) (*mslot)->base.code) == BINDING_VECTOR
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3853, __FUNCTION__), 0 : 0))
;
3854 *vec = *mslot;
3855
3856 return vslot;
3857}
3858
3859/* DECL is a new mergeable namespace-scope decl. Add it to the
3860 mergeable entities on GSLOT. */
3861
3862void
3863add_mergeable_namespace_entity (tree *gslot, tree decl)
3864{
3865 *gslot = ovl_make (decl, *gslot);
3866}
3867
3868/* A mergeable entity of KLASS called NAME is being loaded. Return
3869 the set of things it could be. All such non-as_base classes have
3870 been given a member vec. */
3871
3872tree
3873lookup_class_binding (tree klass, tree name)
3874{
3875 tree found = NULL_TREE(tree) nullptr;
3876
3877 if (!COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3877, __FUNCTION__))->type_common.size) != (tree) nullptr
)
)
3878 ;
3879 else if (TYPE_LANG_SPECIFIC (klass)((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3879, __FUNCTION__))->type_with_lang_specific.lang_specific
)
)
3880 {
3881 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3881, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
3882
3883 found = member_vec_binary_search (member_vec, name);
3884 if (!found)
3885 ;
3886 else if (STAT_HACK_P (found)((found) && ((enum tree_code) (found)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((found)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3886, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3886, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3887 /* Rearrange the stat hack so that we don't need to expose that
3888 internal detail. */
3889 found = ovl_make (STAT_TYPE (found)((contains_struct_check ((found), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3889, __FUNCTION__))->typed.type)
, STAT_DECL (found)(((struct tree_overload*)(tree_check ((found), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3889, __FUNCTION__, (OVERLOAD))))->function)
);
3890 else if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3890, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3890, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3890, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3890, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3890, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3890, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
3891 {
3892 gcc_checking_assert (name == conv_op_identifier)((void)(!(name == cp_global_trees[CPTI_CONV_OP_IDENTIFIER]) ?
fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3892, __FUNCTION__), 0 : 0))
;
3893 found = OVL_CHAIN (found)(((struct tree_overload*)(tree_check ((found), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3893, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3894 }
3895 }
3896 else
3897 {
3898 gcc_checking_assert (IS_FAKE_BASE_TYPE (klass)((void)(!((((enum tree_code) (klass)->base.code) == RECORD_TYPE
&& ((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context) && ((
(((enum tree_code) (((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context))->base.code
)) == RECORD_TYPE || (((enum tree_code) (((tree_class_check (
(klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context))->base.code
)) == UNION_TYPE) && ((tree_class_check ((((tree_class_check
((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context)), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.lang_flag_5)) &&
((((tree_class_check ((((tree_class_check ((klass), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context)), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_with_lang_specific.lang_specific
))->as_base) == (klass)) || (((enum tree_code) (klass)->
base.code) == RECORD_TYPE && (((tree_class_check (((tree_check
((klass), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3899, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3899, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3899, __FUNCTION__), 0 : 0))
3899 || TYPE_PTRMEMFUNC_P (klass))((void)(!((((enum tree_code) (klass)->base.code) == RECORD_TYPE
&& ((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context) && ((
(((enum tree_code) (((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context))->base.code
)) == RECORD_TYPE || (((enum tree_code) (((tree_class_check (
(klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context))->base.code
)) == UNION_TYPE) && ((tree_class_check ((((tree_class_check
((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context)), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.lang_flag_5)) &&
((((tree_class_check ((((tree_class_check ((klass), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_common.context)), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3898, __FUNCTION__))->type_with_lang_specific.lang_specific
))->as_base) == (klass)) || (((enum tree_code) (klass)->
base.code) == RECORD_TYPE && (((tree_class_check (((tree_check
((klass), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3899, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3899, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3899, __FUNCTION__), 0 : 0))
;
3900 found = fields_linear_search (klass, name, false);
3901 }
3902
3903 return found;
3904}
3905
3906/* Given a namespace-level binding BINDING, walk it, calling CALLBACK
3907 for all decls of the current module. When partitions are involved,
3908 decls might be mentioned more than once. Return the accumulation of
3909 CALLBACK results. */
3910
3911unsigned
3912walk_module_binding (tree binding, bitmap partitions,
3913 bool (*callback) (tree decl, WMB_Flags, void *data),
3914 void *data)
3915{
3916 // FIXME: We don't quite deal with using decls naming stat hack
3917 // type. Also using decls exporting something from the same scope.
3918 tree current = binding;
3919 unsigned count = 0;
3920
3921 if (TREE_CODE (binding)((enum tree_code) (binding)->base.code) == BINDING_VECTOR)
3922 current = BINDING_VECTOR_CLUSTER (binding, 0)(((tree_binding_vec *)(tree_check ((binding), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3922, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_CURRENT];
3923
3924 bool decl_hidden = false;
3925 if (tree type = MAYBE_STAT_TYPE (current)(((current) && ((enum tree_code) (current)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((current
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3925, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3925, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? ((contains_struct_check ((current), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3925, __FUNCTION__))->typed.type) : (tree) nullptr)
)
3926 {
3927 WMB_Flags flags = WMB_None;
3928 if (STAT_TYPE_HIDDEN_P (current)((tree_not_check2 (((tree_check ((current), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3928, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3928, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
3929 flags = WMB_Flags (flags | WMB_Hidden);
3930 count += callback (type, flags, data);
3931 decl_hidden = STAT_DECL_HIDDEN_P (current)((tree_not_check2 (((tree_check ((current), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3931, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3931, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
3932 }
3933
3934 for (ovl_iterator iter (MAYBE_STAT_DECL (current)(((current) && ((enum tree_code) (current)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((current
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3934, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3934, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((current
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3934, __FUNCTION__, (OVERLOAD))))->function) : current)
); iter; ++iter)
3935 {
3936 if (iter.hidden_p ())
3937 decl_hidden = true;
3938 if (!(decl_hidden && DECL_IS_UNDECLARED_BUILTIN (*iter)(((contains_struct_check ((*iter), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3938, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
))
3939 {
3940 WMB_Flags flags = WMB_None;
3941 if (decl_hidden)
3942 flags = WMB_Flags (flags | WMB_Hidden);
3943 if (iter.using_p ())
3944 {
3945 flags = WMB_Flags (flags | WMB_Using);
3946 if (iter.exporting_p ())
3947 flags = WMB_Flags (flags | WMB_Export);
3948 }
3949 count += callback (*iter, flags, data);
3950 }
3951 decl_hidden = false;
3952 }
3953
3954 if (partitions && TREE_CODE (binding)((enum tree_code) (binding)->base.code) == BINDING_VECTOR)
3955 {
3956 /* Process partition slots. */
3957 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (binding)(((tree_binding_vec *)(tree_check ((binding), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3957, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
3958 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (binding)((tree_check ((binding), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3958, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
3959 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
3960 {
3961 ix--;
3962 cluster++;
3963 }
3964
3965 bool maybe_dups = BINDING_VECTOR_PARTITION_DUPS_P (binding)((tree_check ((binding), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3965, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
;
3966
3967 for (; ix--; cluster++)
3968 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
3969 if (!cluster->slots[jx].is_lazy ())
3970 if (tree bind = cluster->slots[jx])
3971 {
3972 if (TREE_CODE (bind)((enum tree_code) (bind)->base.code) == NAMESPACE_DECL
3973 && !DECL_NAMESPACE_ALIAS (bind)((contains_struct_check (((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3973, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3973, __FUNCTION__))->decl_common.abstract_origin)
)
3974 {
3975 if (unsigned base = cluster->indices[jx].base)
3976 if (unsigned span = cluster->indices[jx].span)
3977 do
3978 if (bitmap_bit_p (partitions, base))
3979 goto found;
3980 while (++base, --span);
3981 /* Not a partition's namespace. */
3982 continue;
3983 found:
3984
3985 WMB_Flags flags = WMB_None;
3986 if (maybe_dups)
3987 flags = WMB_Flags (flags | WMB_Dups);
3988 count += callback (bind, flags, data);
3989 }
3990 else if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3990, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3990, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3990, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
3991 {
3992 if (tree btype = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3992, __FUNCTION__))->typed.type)
)
3993 {
3994 WMB_Flags flags = WMB_None;
3995 if (maybe_dups)
3996 flags = WMB_Flags (flags | WMB_Dups);
3997 if (STAT_TYPE_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3997, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 3997, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
3998 flags = WMB_Flags (flags | WMB_Hidden);
3999
4000 count += callback (btype, flags, data);
4001 }
4002 bool hidden = STAT_DECL_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4002, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4002, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
4003 for (ovl_iterator iter (MAYBE_STAT_DECL (STAT_DECL (bind))((((((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (OVERLOAD))))->function)) &&
((enum tree_code) ((((struct tree_overload*)(tree_check ((bind
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (OVERLOAD))))->function))->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((((
(struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (OVERLOAD))))->function)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (OVERLOAD)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check (((((struct
tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (OVERLOAD))))->function)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (OVERLOAD))))->function) : (((struct
tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4003, __FUNCTION__, (OVERLOAD))))->function))
);
4004 iter; ++iter)
4005 {
4006 if (iter.hidden_p ())
4007 hidden = true;
4008 gcc_checking_assert((void)(!(!(hidden && (((contains_struct_check ((*iter
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4009, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4009, __FUNCTION__), 0 : 0))
4009 (!(hidden && DECL_IS_UNDECLARED_BUILTIN (*iter)))((void)(!(!(hidden && (((contains_struct_check ((*iter
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4009, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4009, __FUNCTION__), 0 : 0))
;
4010
4011 WMB_Flags flags = WMB_None;
4012 if (maybe_dups)
4013 flags = WMB_Flags (flags | WMB_Dups);
4014 if (decl_hidden)
4015 flags = WMB_Flags (flags | WMB_Hidden);
4016 if (iter.using_p ())
4017 {
4018 flags = WMB_Flags (flags | WMB_Using);
4019 if (iter.exporting_p ())
4020 flags = WMB_Flags (flags | WMB_Export);
4021 }
4022 count += callback (*iter, flags, data);
4023 hidden = false;
4024 }
4025 }
4026 }
4027 }
4028
4029 return count;
4030}
4031
4032/* Imported module MOD has a binding to NS::NAME, stored in section
4033 SNUM. */
4034
4035bool
4036import_module_binding (tree ns, tree name, unsigned mod, unsigned snum)
4037{
4038 tree *slot = find_namespace_slot (ns, name, true);
4039 binding_slot *mslot = append_imported_binding_slot (slot, name, mod);
4040
4041 if (mslot->is_lazy () || *mslot)
4042 /* Oops, something was already there. */
4043 return false;
4044
4045 mslot->set_lazy (snum);
4046 return true;
4047}
4048
4049/* An import of MODULE is binding NS::NAME. There should be no
4050 existing binding for >= MODULE. MOD_GLOB indicates whether MODULE
4051 is a header_unit (-1) or part of the current module (+1). VALUE
4052 and TYPE are the value and type bindings. VISIBLE are the value
4053 bindings being exported. */
4054
4055bool
4056set_module_binding (tree ns, tree name, unsigned mod, int mod_glob,
4057 tree value, tree type, tree visible)
4058{
4059 if (!value)
4060 /* Bogus BMIs could give rise to nothing to bind. */
4061 return false;
4062
4063 gcc_assert (TREE_CODE (value) != NAMESPACE_DECL((void)(!(((enum tree_code) (value)->base.code) != NAMESPACE_DECL
|| ((contains_struct_check (((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4064, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4064, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4064, __FUNCTION__), 0 : 0))
4064 || DECL_NAMESPACE_ALIAS (value))((void)(!(((enum tree_code) (value)->base.code) != NAMESPACE_DECL
|| ((contains_struct_check (((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4064, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4064, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4064, __FUNCTION__), 0 : 0))
;
4065 gcc_checking_assert (mod)((void)(!(mod) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4065, __FUNCTION__), 0 : 0))
;
4066
4067 tree *slot = find_namespace_slot (ns, name, true);
4068 binding_slot *mslot = search_imported_binding_slot (slot, mod);
4069
4070 if (!mslot || !mslot->is_lazy ())
4071 /* Again, bogus BMI could give find to missing or already loaded slot. */
4072 return false;
4073
4074 tree bind = value;
4075 if (type || visible != bind || mod_glob)
4076 {
4077 bind = stat_hack (bind, type);
4078 STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4078, __FUNCTION__, (OVERLOAD))))->common.chain)
= visible;
4079 if ((mod_glob > 0 && TREE_PUBLIC (ns)((ns)->base.public_flag))
4080 || (type && DECL_MODULE_EXPORT_P (type)((tree_not_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4080, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
))
4081 STAT_TYPE_VISIBLE_P (bind)(((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4081, __FUNCTION__, (OVERLOAD))))->base.used_flag)
= true;
4082 }
4083
4084 /* Note if this is this-module or global binding. */
4085 if (mod_glob > 0)
4086 MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4086, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
= true;
4087 else if (mod_glob < 0)
4088 MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4088, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
4089
4090 *mslot = bind;
4091
4092 return true;
4093}
4094
4095void
4096add_module_namespace_decl (tree ns, tree decl)
4097{
4098 gcc_assert (!DECL_CHAIN (decl))((void)(!(!(((contains_struct_check (((contains_struct_check (
(decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4098, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4098, __FUNCTION__))->common.chain))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4098, __FUNCTION__), 0 : 0))
;
4099 gcc_checking_assert (!(VAR_OR_FUNCTION_DECL_P (decl)((void)(!(!((((enum tree_code) (decl)->base.code) == VAR_DECL
|| ((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
&& ((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4100, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4100, __FUNCTION__))->decl_common.lang_flag_0))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4100, __FUNCTION__), 0 : 0))
4100 && DECL_LOCAL_DECL_P (decl)))((void)(!(!((((enum tree_code) (decl)->base.code) == VAR_DECL
|| ((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
&& ((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4100, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4100, __FUNCTION__))->decl_common.lang_flag_0))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4100, __FUNCTION__), 0 : 0))
;
4101 if (CHECKING_P1)
4102 /* Expensive already-there? check. */
4103 for (auto probe = NAMESPACE_LEVEL (ns)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((ns), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4103, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (ns)->base.code) != NAMESPACE_DECL || lt->
u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4103, __FUNCTION__); &lt->u.ns; })->level)
->names; probe;
4104 probe = DECL_CHAIN (probe)(((contains_struct_check (((contains_struct_check ((probe), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4104, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4104, __FUNCTION__))->common.chain))
)
4105 gcc_assert (decl != probe)((void)(!(decl != probe) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4105, __FUNCTION__), 0 : 0))
;
4106
4107 add_decl_to_level (NAMESPACE_LEVEL (ns)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((ns), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4107, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (ns)->base.code) != NAMESPACE_DECL || lt->
u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4107, __FUNCTION__); &lt->u.ns; })->level)
, decl);
4108
4109 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
4110 maybe_register_incomplete_var (decl);
4111
4112 if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
4113 && DECL_EXTERN_C_P (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4113, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4113, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (decl)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
4114 check_extern_c_conflict (decl);
4115}
4116
4117/* Enter DECL into the symbol table, if that's appropriate. Returns
4118 DECL, or a modified version thereof. */
4119
4120tree
4121maybe_push_decl (tree decl)
4122{
4123 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4123, __FUNCTION__))->typed.type)
;
4124
4125 /* Add this decl to the current binding level, but not if it comes
4126 from another scope, e.g. a static member variable. TEM may equal
4127 DECL or it may be a previous decl of the same name. */
4128 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]
4129 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
4130 && DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4130, __FUNCTION__))->decl_minimal.context)
!= NULL_TREE(tree) nullptr
4131 /* Definitions of namespace members outside their namespace are
4132 possible. */
4133 && !DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4133, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4133, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4133, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4133, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
4134 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && !namespace_bindings_p ())
4135 || type == unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE]
4136 /* The declaration of a template specialization does not affect
4137 the functions available for overload resolution, so we do not
4138 call pushdecl. */
4139 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
4140 && DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4140, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
))
4141 return decl;
4142 else
4143 return pushdecl (decl);
4144}
4145
4146/* Bind DECL to ID in the current_binding_level, assumed to be a local
4147 binding level. If IS_USING is true, DECL got here through a
4148 using-declaration. */
4149
4150static void
4151push_local_binding (tree id, tree decl, bool is_using)
4152{
4153 /* Skip over any local classes. This makes sense if we call
4154 push_local_binding with a friend decl of a local class. */
4155 cp_binding_level *b = innermost_nonclass_level ();
4156
4157 gcc_assert (b->kind != sk_namespace)((void)(!(b->kind != sk_namespace) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4157, __FUNCTION__), 0 : 0))
;
4158 if (find_local_binding (b, id))
4159 {
4160 /* Supplement the existing binding. */
4161 if (!supplement_binding (IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4161, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
, decl))
4162 /* It didn't work. Something else must be bound at this
4163 level. Do not add DECL to the list of things to pop
4164 later. */
4165 return;
4166 }
4167 else
4168 /* Create a new binding. */
4169 push_binding (id, decl, b);
4170
4171 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == OVERLOAD || is_using)
4172 /* We must put the OVERLOAD or using into a TREE_LIST since we
4173 cannot use the decl's chain itself. */
4174 decl = build_tree_list (id, decl);
4175
4176 /* And put DECL on the list of things declared by the current
4177 binding level. */
4178 add_decl_to_level (b, decl);
4179}
4180
4181
4182/* true means unconditionally make a BLOCK for the next level pushed. */
4183
4184static bool keep_next_level_flag;
4185
4186static int binding_depth = 0;
4187
4188static void
4189indent (int depth)
4190{
4191 int i;
4192
4193 for (i = 0; i < depth * 2; i++)
4194 putc (' ', stderrstderr);
4195}
4196
4197/* Return a string describing the kind of SCOPE we have. */
4198static const char *
4199cp_binding_level_descriptor (cp_binding_level *scope)
4200{
4201 /* The order of this table must match the "scope_kind"
4202 enumerators. */
4203 static const char* scope_kind_names[] = {
4204 "block-scope",
4205 "cleanup-scope",
4206 "try-scope",
4207 "catch-scope",
4208 "for-scope",
4209 "function-parameter-scope",
4210 "class-scope",
4211 "namespace-scope",
4212 "template-parameter-scope",
4213 "template-explicit-spec-scope"
4214 };
4215 const scope_kind kind = scope->explicit_spec_p
4216 ? sk_template_spec : scope->kind;
4217
4218 return scope_kind_names[kind];
4219}
4220
4221/* Output a debugging information about SCOPE when performing
4222 ACTION at LINE. */
4223static void
4224cp_binding_level_debug (cp_binding_level *scope, int line, const char *action)
4225{
4226 const char *desc = cp_binding_level_descriptor (scope);
4227 if (scope->this_entity)
4228 verbatim ("%s %<%s(%E)%> %p %d", action, desc,
4229 scope->this_entity, (void *) scope, line);
4230 else
4231 verbatim ("%s %s %p %d", action, desc, (void *) scope, line);
4232}
4233
4234/* A chain of binding_level structures awaiting reuse. */
4235
4236static GTY((deletable)) cp_binding_level *free_binding_level;
4237
4238/* Insert SCOPE as the innermost binding level. */
4239
4240void
4241push_binding_level (cp_binding_level *scope)
4242{
4243 /* Add it to the front of currently active scopes stack. */
4244 scope->level_chain = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4245 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= scope;
4246 keep_next_level_flag = false;
4247
4248 if (ENABLE_SCOPE_CHECKING0)
4249 {
4250 scope->binding_depth = binding_depth;
4251 indent (binding_depth);
4252 cp_binding_level_debug (scope, LOCATION_LINE (input_location)((expand_location (input_location)).line),
4253 "push");
4254 binding_depth++;
4255 }
4256}
4257
4258/* Create a new KIND scope and make it the top of the active scopes stack.
4259 ENTITY is the scope of the associated C++ entity (namespace, class,
4260 function, C++0x enumeration); it is NULL otherwise. */
4261
4262cp_binding_level *
4263begin_scope (scope_kind kind, tree entity)
4264{
4265 cp_binding_level *scope;
4266
4267 /* Reuse or create a struct for this binding level. */
4268 if (!ENABLE_SCOPE_CHECKING0 && free_binding_level)
4269 {
4270 scope = free_binding_level;
4271 free_binding_level = scope->level_chain;
4272 memset (scope, 0, sizeof (cp_binding_level));
4273 }
4274 else
4275 scope = ggc_cleared_alloc<cp_binding_level> ();
4276
4277 scope->this_entity = entity;
4278 scope->more_cleanups_ok = true;
4279 switch (kind)
4280 {
4281 case sk_cleanup:
4282 scope->keep = true;
4283 break;
4284
4285 case sk_template_spec:
4286 scope->explicit_spec_p = true;
4287 kind = sk_template_parms;
4288 /* Fall through. */
4289 case sk_template_parms:
4290 case sk_block:
4291 case sk_try:
4292 case sk_catch:
4293 case sk_for:
4294 case sk_cond:
4295 case sk_class:
4296 case sk_scoped_enum:
4297 case sk_transaction:
4298 case sk_omp:
4299 case sk_stmt_expr:
4300 scope->keep = keep_next_level_flag;
4301 break;
4302
4303 case sk_function_parms:
4304 scope->keep = keep_next_level_flag;
4305 break;
4306
4307 case sk_namespace:
4308 NAMESPACE_LEVEL (entity)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((entity), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4308, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (entity)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4308, __FUNCTION__); &lt->u.ns; })->level)
= scope;
4309 break;
4310
4311 default:
4312 /* Should not happen. */
4313 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4313, __FUNCTION__))
;
4314 break;
4315 }
4316 scope->kind = kind;
4317
4318 push_binding_level (scope);
4319
4320 return scope;
4321}
4322
4323/* We're about to leave current scope. Pop the top of the stack of
4324 currently active scopes. Return the enclosing scope, now active. */
4325
4326cp_binding_level *
4327leave_scope (void)
4328{
4329 cp_binding_level *scope = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4330
4331 if (scope->kind == sk_namespace && class_binding_levelscope_chain->class_bindings)
4332 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= class_binding_levelscope_chain->class_bindings;
4333
4334 /* We cannot leave a scope, if there are none left. */
4335 if (NAMESPACE_LEVEL (global_namespace)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((cp_global_trees[CPTI_GLOBAL]), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4335, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (cp_global_trees[CPTI_GLOBAL])->base.code)
!= NAMESPACE_DECL || lt->u.base.selector != lds_ns) lang_check_failed
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4335, __FUNCTION__); &lt->u.ns; })->level)
)
4336 gcc_assert (!global_scope_p (scope))((void)(!(!((scope) == (__extension__ ({ struct lang_decl *lt
= ((contains_struct_check ((cp_global_trees[CPTI_GLOBAL]), (
TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4336, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (cp_global_trees[CPTI_GLOBAL])->base.code)
!= NAMESPACE_DECL || lt->u.base.selector != lds_ns) lang_check_failed
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4336, __FUNCTION__); &lt->u.ns; })->level))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4336, __FUNCTION__), 0 : 0))
;
4337
4338 if (ENABLE_SCOPE_CHECKING0)
4339 {
4340 indent (--binding_depth);
4341 cp_binding_level_debug (scope, LOCATION_LINE (input_location)((expand_location (input_location)).line),
4342 "leave");
4343 }
4344
4345 /* Move one nesting level up. */
4346 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= scope->level_chain;
4347
4348 /* Namespace-scopes are left most probably temporarily, not
4349 completely; they can be reopened later, e.g. in namespace-extension
4350 or any name binding activity that requires us to resume a
4351 namespace. For classes, we cache some binding levels. For other
4352 scopes, we just make the structure available for reuse. */
4353 if (scope->kind != sk_namespace
4354 && scope != previous_class_levelscope_chain->x_previous_class_level)
4355 {
4356 scope->level_chain = free_binding_level;
4357 gcc_assert (!ENABLE_SCOPE_CHECKING((void)(!(!0 || scope->binding_depth == binding_depth) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4358, __FUNCTION__), 0 : 0))
4358 || scope->binding_depth == binding_depth)((void)(!(!0 || scope->binding_depth == binding_depth) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4358, __FUNCTION__), 0 : 0))
;
4359 free_binding_level = scope;
4360 }
4361
4362 if (scope->kind == sk_class)
4363 {
4364 /* Reset DEFINING_CLASS_P to allow for reuse of a
4365 class-defining scope in a non-defining context. */
4366 scope->defining_class_p = 0;
4367
4368 /* Find the innermost enclosing class scope, and reset
4369 CLASS_BINDING_LEVEL appropriately. */
4370 class_binding_levelscope_chain->class_bindings = NULLnullptr;
4371 for (scope = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
; scope; scope = scope->level_chain)
4372 if (scope->kind == sk_class)
4373 {
4374 class_binding_levelscope_chain->class_bindings = scope;
4375 break;
4376 }
4377 }
4378
4379 return current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4380}
4381
4382/* When we exit a toplevel class scope, we save its binding level so
4383 that we can restore it quickly. Here, we've entered some other
4384 class, so we must invalidate our cache. */
4385
4386void
4387invalidate_class_lookup_cache (void)
4388{
4389 previous_class_levelscope_chain->x_previous_class_level->level_chain = free_binding_level;
4390 free_binding_level = previous_class_levelscope_chain->x_previous_class_level;
4391 previous_class_levelscope_chain->x_previous_class_level = NULLnullptr;
4392}
4393
4394static void
4395resume_scope (cp_binding_level* b)
4396{
4397 /* Resuming binding levels is meant only for namespaces,
4398 and those cannot nest into classes. */
4399 gcc_assert (!class_binding_level)((void)(!(!scope_chain->class_bindings) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4399, __FUNCTION__), 0 : 0))
;
4400 /* Also, resuming a non-directly nested namespace is a no-no. */
4401 gcc_assert (b->level_chain == current_binding_level)((void)(!(b->level_chain == (*((cfun + 0) && ((cfun
+ 0)->language) && ((cfun + 0)->language)->
bindings ? &((cfun + 0)->language)->bindings : &
scope_chain->bindings))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4401, __FUNCTION__), 0 : 0))
;
4402 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= b;
4403 if (ENABLE_SCOPE_CHECKING0)
4404 {
4405 b->binding_depth = binding_depth;
4406 indent (binding_depth);
4407 cp_binding_level_debug (b, LOCATION_LINE (input_location)((expand_location (input_location)).line), "resume");
4408 binding_depth++;
4409 }
4410}
4411
4412/* Return the innermost binding level that is not for a class scope. */
4413
4414static cp_binding_level *
4415innermost_nonclass_level (void)
4416{
4417 cp_binding_level *b;
4418
4419 b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4420 while (b->kind == sk_class)
4421 b = b->level_chain;
4422
4423 return b;
4424}
4425
4426/* We're defining an object of type TYPE. If it needs a cleanup, but
4427 we're not allowed to add any more objects with cleanups to the current
4428 scope, create a new binding level. */
4429
4430void
4431maybe_push_cleanup_level (tree type)
4432{
4433 if (type != error_mark_nodeglobal_trees[TI_ERROR_MARK]
4434 && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4434, __FUNCTION__))->type_common.lang_flag_4))
4435 && current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->more_cleanups_ok == 0)
4436 {
4437 begin_scope (sk_cleanup, NULLnullptr);
4438 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->statement_list = push_stmt_list ();
4439 }
4440}
4441
4442/* Return true if we are in the global binding level. */
4443
4444bool
4445global_bindings_p (void)
4446{
4447 return global_scope_p (current_binding_level)(((*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))) == (
__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((cp_global_trees[CPTI_GLOBAL]), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4447, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (cp_global_trees[CPTI_GLOBAL])->base.code)
!= NAMESPACE_DECL || lt->u.base.selector != lds_ns) lang_check_failed
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4447, __FUNCTION__); &lt->u.ns; })->level))
;
4448}
4449
4450/* True if we are currently in a toplevel binding level. This
4451 means either the global binding level or a namespace in a toplevel
4452 binding level. Since there are no non-toplevel namespace levels,
4453 this really means any namespace or template parameter level. We
4454 also include a class whose context is toplevel. */
4455
4456bool
4457toplevel_bindings_p (void)
4458{
4459 cp_binding_level *b = innermost_nonclass_level ();
4460
4461 return b->kind == sk_namespace || b->kind == sk_template_parms;
4462}
4463
4464/* True if this is a namespace scope, or if we are defining a class
4465 which is itself at namespace scope, or whose enclosing class is
4466 such a class, etc. */
4467
4468bool
4469namespace_bindings_p (void)
4470{
4471 cp_binding_level *b = innermost_nonclass_level ();
4472
4473 return b->kind == sk_namespace;
4474}
4475
4476/* True if the innermost non-class scope is a block scope. */
4477
4478bool
4479local_bindings_p (void)
4480{
4481 cp_binding_level *b = innermost_nonclass_level ();
4482 return b->kind < sk_function_parms || b->kind == sk_omp;
4483}
4484
4485/* True if the current level needs to have a BLOCK made. */
4486
4487bool
4488kept_level_p (void)
4489{
4490 return (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->blocks != NULL_TREE(tree) nullptr
4491 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->keep
4492 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_cleanup
4493 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->names != NULL_TREE(tree) nullptr
4494 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->using_directives);
4495}
4496
4497/* Returns the kind of the innermost scope. */
4498
4499scope_kind
4500innermost_scope_kind (void)
4501{
4502 return current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind;
4503}
4504
4505/* Returns true if this scope was created to store template parameters. */
4506
4507bool
4508template_parm_scope_p (void)
4509{
4510 return innermost_scope_kind () == sk_template_parms;
4511}
4512
4513/* If KEEP is true, make a BLOCK node for the next binding level,
4514 unconditionally. Otherwise, use the normal logic to decide whether
4515 or not to create a BLOCK. */
4516
4517void
4518keep_next_level (bool keep)
4519{
4520 keep_next_level_flag = keep;
4521}
4522
4523/* Return the list of declarations of the current local scope. */
4524
4525tree
4526get_local_decls (void)
4527{
4528 gcc_assert (current_binding_level->kind != sk_namespace((void)(!((*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))->
kind != sk_namespace && (*((cfun + 0) && ((cfun
+ 0)->language) && ((cfun + 0)->language)->
bindings ? &((cfun + 0)->language)->bindings : &
scope_chain->bindings))->kind != sk_class) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4529, __FUNCTION__), 0 : 0))
4529 && current_binding_level->kind != sk_class)((void)(!((*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))->
kind != sk_namespace && (*((cfun + 0) && ((cfun
+ 0)->language) && ((cfun + 0)->language)->
bindings ? &((cfun + 0)->language)->bindings : &
scope_chain->bindings))->kind != sk_class) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4529, __FUNCTION__), 0 : 0))
;
4530 return current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->names;
4531}
4532
4533/* Return how many function prototypes we are currently nested inside. */
4534
4535int
4536function_parm_depth (void)
4537{
4538 int level = 0;
4539 cp_binding_level *b;
4540
4541 for (b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4542 b->kind == sk_function_parms;
4543 b = b->level_chain)
4544 ++level;
4545
4546 return level;
4547}
4548
4549/* For debugging. */
4550static int no_print_functions = 0;
4551static int no_print_builtins = 0;
4552
4553static void
4554print_binding_level (cp_binding_level* lvl)
4555{
4556 tree t;
4557 int i = 0, len;
4558 if (lvl->this_entity)
4559 print_node_brief (stderrstderr, "entity=", lvl->this_entity, 1);
4560 fprintf (stderrstderr, " blocks=%p", (void *) lvl->blocks);
4561 if (lvl->more_cleanups_ok)
4562 fprintf (stderrstderr, " more-cleanups-ok");
4563 if (lvl->have_cleanups)
4564 fprintf (stderrstderr, " have-cleanups");
4565 fprintf (stderrstderr, "\n");
4566 if (lvl->names)
4567 {
4568 fprintf (stderrstderr, " names:\t");
4569 /* We can probably fit 3 names to a line? */
4570 for (t = lvl->names; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4570, __FUNCTION__))->common.chain)
)
4571 {
4572 if (no_print_functions && (TREE_CODE (t)((enum tree_code) (t)->base.code) == FUNCTION_DECL))
4573 continue;
4574 if (no_print_builtins
4575 && (TREE_CODE (t)((enum tree_code) (t)->base.code) == TYPE_DECL)
4576 && DECL_IS_UNDECLARED_BUILTIN (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.cc"
, 4576, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
)
4577 continue;
4578
4579 /* Function decls tend to have longer names. */
4580 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FUNCTION_DECL)
4581 len = 3;
4582 else
4583 len = 2;
4584 i += len;
4585 if (i > 6)
4586 {
4587 fprintf (stderrstderr, "\n\t");
4588 i = len;
4589 }
4590 print_node_brief (stderrstderr, "", t, 0);
4591 if (t == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4592 break;
4593 }
4594 if (i)
4595 fprintf (stderrstderr, "\n");
4596 }
4597 if (vec_safe_length (lvl->class_shadowed))
4598 {
4599 size_t i;
4600 cp_class_binding *b;
4601 fprintf (stderrstderr, " class-shadowed:");
4602 FOR_EACH_VEC_ELT (*lvl->c