Bug Summary

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

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name name-lookup.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -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 -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/11.0.0 -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I cp -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-error=format-diag -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir /home/marxin/BIG/buildbot/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 -o /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2021-01-16-135054-17580-1/report-XlitTI.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c

/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c

1/* Definitions for C++ name lookup routines.
2 Copyright (C) 2003-2021 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_UNIQUE_PTR
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 tree do_pushdecl (tree decl, bool hiding);
43static void set_identifier_type_value_with_scope (tree id, tree decl,
44 cp_binding_level *b);
45static name_hint maybe_suggest_missing_std_header (location_t location,
46 tree name);
47static name_hint suggest_alternatives_for_1 (location_t location, tree name,
48 bool suggest_misspellings);
49
50/* Slots in BINDING_VECTOR. */
51enum binding_slots
52{
53 BINDING_SLOT_CURRENT, /* Slot for current TU. */
54 BINDING_SLOT_GLOBAL, /* Slot for merged global module. */
55 BINDING_SLOT_PARTITION, /* Slot for merged partition entities
56 (optional). */
57
58 /* Number of always-allocated slots. */
59 BINDING_SLOTS_FIXED = BINDING_SLOT_GLOBAL + 1
60};
61
62/* Create an overload suitable for recording an artificial TYPE_DECL
63 and another decl. We use this machanism to implement the struct
64 stat hack. */
65
66#define STAT_HACK_P(N)((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 66, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 66, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 66, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 66, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)
)
67#define STAT_TYPE_VISIBLE_P(N)(((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 67, __FUNCTION__, (OVERLOAD))))->base.used_flag)
TREE_USED (OVERLOAD_CHECK (N))(((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 67, __FUNCTION__, (OVERLOAD))))->base.used_flag)
68#define STAT_TYPE(N)((contains_struct_check ((N), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 68, __FUNCTION__))->typed.type)
TREE_TYPE (N)((contains_struct_check ((N), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 68, __FUNCTION__))->typed.type)
69#define STAT_DECL(N)(((struct tree_overload*)(tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 69, __FUNCTION__, (OVERLOAD))))->function)
OVL_FUNCTION (N)(((struct tree_overload*)(tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 69, __FUNCTION__, (OVERLOAD))))->function)
70#define STAT_VISIBLE(N)(((struct tree_overload*)(tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 70, __FUNCTION__, (OVERLOAD))))->common.chain)
OVL_CHAIN (N)(((struct tree_overload*)(tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 70, __FUNCTION__, (OVERLOAD))))->common.chain)
71#define MAYBE_STAT_DECL(N)(((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 71, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 71, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)) ? (((struct tree_overload*)(tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 71, __FUNCTION__, (OVERLOAD))))->function) : N)
(STAT_HACK_P (N)((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 71, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 71, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4))
? STAT_DECL (N)(((struct tree_overload*)(tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 71, __FUNCTION__, (OVERLOAD))))->function)
: N)
72#define MAYBE_STAT_TYPE(N)(((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 72, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 72, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)) ? ((contains_struct_check ((N), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 72, __FUNCTION__))->typed.type) : (tree) nullptr)
(STAT_HACK_P (N)((N) && ((enum tree_code) (N)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 72, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 72, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4))
? STAT_TYPE (N)((contains_struct_check ((N), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 72, __FUNCTION__))->typed.type)
: NULL_TREE(tree) nullptr)
73
74/* When a STAT_HACK_P is true, OVL_USING_P and OVL_EXPORT_P are valid
75 and apply to the hacked type. */
76
77/* For regular (maybe) overloaded functions, we have OVL_HIDDEN_P.
78 But we also need to indicate hiddenness on implicit type decls
79 (injected friend classes), and (coming soon) decls injected from
80 block-scope externs. It is too awkward to press the existing
81 overload marking for that. If we have a hidden non-function, we
82 always create a STAT_HACK, and use these two markers as needed. */
83#define STAT_TYPE_HIDDEN_P(N)((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 83, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 83, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_2)
OVL_HIDDEN_P (N)((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 83, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 83, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_2)
84#define STAT_DECL_HIDDEN_P(N)((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 84, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 84, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_0)
OVL_DEDUP_P (N)((tree_not_check2 (((tree_check ((N), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 84, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 84, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_0)
85
86/* Create a STAT_HACK node with DECL as the value binding and TYPE as
87 the type binding. */
88
89static tree
90stat_hack (tree decl = NULL_TREE(tree) nullptr, tree type = NULL_TREE(tree) nullptr)
91{
92 tree result = make_node (OVERLOAD);
93
94 /* Mark this as a lookup, so we can tell this is a stat hack. */
95 OVL_LOOKUP_P (result)((tree_not_check2 (((tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 95, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 95, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits.
lang_flag_4)
= true;
96 STAT_DECL (result)(((struct tree_overload*)(tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 96, __FUNCTION__, (OVERLOAD))))->function)
= decl;
97 STAT_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 97, __FUNCTION__))->typed.type)
= type;
98 return result;
99}
100
101/* Create a local binding level for NAME. */
102
103static cxx_binding *
104create_local_binding (cp_binding_level *level, tree name)
105{
106 cxx_binding *binding = cxx_binding_make (NULLnullptr, NULLnullptr);
107
108 LOCAL_BINDING_P (binding)((binding)->is_local) = true;
109 binding->scope = level;
110 binding->previous = IDENTIFIER_BINDING (name)(((struct lang_identifier*)(tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 110, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
111
112 IDENTIFIER_BINDING (name)(((struct lang_identifier*)(tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 112, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
= binding;
113
114 return binding;
115}
116
117/* Find the binding for NAME in namespace NS. If CREATE_P is true,
118 make an empty binding if there wasn't one. */
119
120static tree *
121find_namespace_slot (tree ns, tree name, bool create_p = false)
122{
123 tree *slot = DECL_NAMESPACE_BINDINGS (ns)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((ns), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 123, __FUNCTION__))->decl_common.lang_specific); if (((enum
tree_code) (ns)->base.code) != NAMESPACE_DECL || lt->u
.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 123, __FUNCTION__); &lt->u.ns; })->bindings)
124 ->find_slot_with_hash (name, name ? IDENTIFIER_HASH_VALUE (name)((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 124, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
: 0,
125 create_p ? INSERT : NO_INSERT);
126 return slot;
127}
128
129static tree
130find_namespace_value (tree ns, tree name)
131{
132 tree *b = find_namespace_slot (ns, name);
133
134 return b ? MAYBE_STAT_DECL (*b)(((*b) && ((enum tree_code) (*b)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((*b), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 134, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 134, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((*b), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 134, __FUNCTION__, (OVERLOAD))))->function) : *b)
: NULL_TREE(tree) nullptr;
135}
136
137/* Look in *SLOT for a the binding of NAME in imported module IX.
138 Returns pointer to binding's slot, or NULL if not found. Does a
139 binary search, as this is mainly used for random access during
140 importing. Do not use for the fixed slots. */
141
142static binding_slot *
143search_imported_binding_slot (tree *slot, unsigned ix)
144{
145 gcc_assert (ix)((void)(!(ix) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 145, __FUNCTION__), 0 : 0))
;
146
147 if (!*slot)
148 return NULLnullptr;
149
150 if (TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
151 return NULLnullptr;
152
153 unsigned clusters = BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 153, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
154 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (*slot)(((tree_binding_vec *)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 154, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
155
156 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
157 {
158 clusters--;
159 cluster++;
160 }
161
162 while (clusters > 1)
163 {
164 unsigned half = clusters / 2;
165 gcc_checking_assert (cluster[half].indices[0].span)((void)(!(cluster[half].indices[0].span) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 165, __FUNCTION__), 0 : 0))
;
166 if (cluster[half].indices[0].base > ix)
167 clusters = half;
168 else
169 {
170 clusters -= half;
171 cluster += half;
172 }
173 }
174
175 if (clusters)
176 /* Is it in this cluster? */
177 for (unsigned off = 0; off != BINDING_VECTOR_SLOTS_PER_CLUSTER2; off++)
178 {
179 if (!cluster->indices[off].span)
180 break;
181 if (cluster->indices[off].base > ix)
182 break;
183
184 if (cluster->indices[off].base + cluster->indices[off].span > ix)
185 return &cluster->slots[off];
186 }
187
188 return NULLnullptr;
189}
190
191static void
192init_global_partition (binding_cluster *cluster, tree decl)
193{
194 bool purview = true;
195
196 if (header_module_p ())
197 purview = false;
198 else if (TREE_PUBLIC (decl)((decl)->base.public_flag)
199 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
200 && !DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 200, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 200, __FUNCTION__))->decl_common.abstract_origin)
)
201 purview = false;
202 else if (!get_originating_module (decl))
203 purview = false;
204
205 binding_slot *mslot;
206 if (!purview)
207 mslot = &cluster[0].slots[BINDING_SLOT_GLOBAL];
208 else
209 mslot = &cluster[BINDING_SLOT_PARTITION
210 / BINDING_VECTOR_SLOTS_PER_CLUSTER2]
211 .slots[BINDING_SLOT_PARTITION
212 % BINDING_VECTOR_SLOTS_PER_CLUSTER2];
213
214 if (*mslot)
215 decl = ovl_make (decl, *mslot);
216 *mslot = decl;
217
218 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == CONST_DECL)
219 {
220 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 220, __FUNCTION__))->typed.type)
;
221 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE
222 && IDENTIFIER_ANON_P (DECL_NAME (TYPE_NAME (type)))((tree_check ((((contains_struct_check ((((tree_class_check (
(type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 222, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 222, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 222, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
223 && decl == TREE_VALUE (TYPE_VALUES (type))((tree_check ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 223, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 223, __FUNCTION__, (TREE_LIST)))->list.value)
)
224 /* Anonymous enums are keyed by their first enumerator, put
225 the TYPE_DECL here too. */
226 *mslot = ovl_make (TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 226, __FUNCTION__))->type_common.name)
, *mslot);
227 }
228}
229
230/* Get the fixed binding slot IX. Creating the vector if CREATE is
231 non-zero. If CREATE is < 0, make sure there is at least 1 spare
232 slot for an import. (It is an error for CREATE < 0 and the slot to
233 already exist.) */
234
235static tree *
236get_fixed_binding_slot (tree *slot, tree name, unsigned ix, int create)
237{
238 gcc_checking_assert (ix <= BINDING_SLOT_PARTITION)((void)(!(ix <= BINDING_SLOT_PARTITION) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 238, __FUNCTION__), 0 : 0))
;
239
240 /* An assumption is that the fixed slots all reside in one cluster. */
241 gcc_checking_assert (BINDING_VECTOR_SLOTS_PER_CLUSTER >= BINDING_SLOTS_FIXED)((void)(!(2 >= BINDING_SLOTS_FIXED) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 241, __FUNCTION__), 0 : 0))
;
242
243 if (!*slot || TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
244 {
245 if (ix == BINDING_SLOT_CURRENT)
246 /* The current TU can just use slot directly. */
247 return slot;
248
249 if (!create)
250 return NULLnullptr;
251
252 /* The partition slot is only needed when we know we're a named
253 module. */
254 bool partition_slot = named_module_p ();
255 unsigned want = ((BINDING_SLOTS_FIXED + partition_slot + (create < 0)
256 + BINDING_VECTOR_SLOTS_PER_CLUSTER2 - 1)
257 / BINDING_VECTOR_SLOTS_PER_CLUSTER2);
258 tree new_vec = make_binding_vec (name, want);
259 BINDING_VECTOR_NUM_CLUSTERS (new_vec)((tree_check ((new_vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 259, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
= want;
260 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (new_vec)(((tree_binding_vec *)(tree_check ((new_vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 260, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
261
262 /* Initialize the fixed slots. */
263 for (unsigned jx = BINDING_SLOTS_FIXED; jx--;)
264 {
265 cluster[0].indices[jx].base = 0;
266 cluster[0].indices[jx].span = 1;
267 cluster[0].slots[jx] = NULL_TREE(tree) nullptr;
268 }
269
270 if (partition_slot)
271 {
272 unsigned off = BINDING_SLOT_PARTITION % BINDING_VECTOR_SLOTS_PER_CLUSTER2;
273 unsigned ind = BINDING_SLOT_PARTITION / BINDING_VECTOR_SLOTS_PER_CLUSTER2;
274 cluster[ind].indices[off].base = 0;
275 cluster[ind].indices[off].span = 1;
276 cluster[ind].slots[off] = NULL_TREE(tree) nullptr;
277 }
278
279 if (tree orig = *slot)
280 {
281 /* Propagate existing value to current slot. */
282
283 /* Propagate global & module entities to the global and
284 partition slots. */
285 if (tree type = MAYBE_STAT_TYPE (orig)(((orig) && ((enum tree_code) (orig)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((orig),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 285, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 285, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? ((contains_struct_check ((orig), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 285, __FUNCTION__))->typed.type) : (tree) nullptr)
)
286 init_global_partition (cluster, type);
287
288 for (ovl_iterator iter (MAYBE_STAT_DECL (orig)(((orig) && ((enum tree_code) (orig)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((orig),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 288, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 288, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((orig)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 288, __FUNCTION__, (OVERLOAD))))->function) : orig)
); iter; ++iter)
289 {
290 tree decl = *iter;
291
292 /* Internal linkage entities are in deduplicateable. */
293 init_global_partition (cluster, decl);
294 }
295
296 if (cluster[0].slots[BINDING_SLOT_GLOBAL]
297 && !(TREE_CODE (orig)((enum tree_code) (orig)->base.code) == NAMESPACE_DECL
298 && !DECL_NAMESPACE_ALIAS (orig)((contains_struct_check (((tree_check ((orig), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 298, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 298, __FUNCTION__))->decl_common.abstract_origin)
))
299 {
300 /* Note that we had some GMF entries. */
301 if (!STAT_HACK_P (orig)((orig) && ((enum tree_code) (orig)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((orig),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 301, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 301, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
302 orig = stat_hack (orig);
303
304 MODULE_BINDING_GLOBAL_P (orig)((tree_check ((orig), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 304, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
305 }
306
307 cluster[0].slots[BINDING_SLOT_CURRENT] = orig;
308 }
309
310 *slot = new_vec;
311 }
312 else
313 gcc_checking_assert (create >= 0)((void)(!(create >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 313, __FUNCTION__), 0 : 0))
;
314
315 unsigned off = ix % BINDING_VECTOR_SLOTS_PER_CLUSTER2;
316 binding_cluster &cluster
317 = BINDING_VECTOR_CLUSTER (*slot, ix / BINDING_VECTOR_SLOTS_PER_CLUSTER)(((tree_binding_vec *)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 317, __FUNCTION__, (BINDING_VECTOR))))->vec[ix / 2])
;
318
319 /* There must always be slots for these indices */
320 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 322, __FUNCTION__), 0 : 0))
321 && !cluster.indices[off].base((void)(!(cluster.indices[off].span == 1 && !cluster.
indices[off].base && !cluster.slots[off].is_lazy ()) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 322, __FUNCTION__), 0 : 0))
322 && !cluster.slots[off].is_lazy ())((void)(!(cluster.indices[off].span == 1 && !cluster.
indices[off].base && !cluster.slots[off].is_lazy ()) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 322, __FUNCTION__), 0 : 0))
;
323
324 return reinterpret_cast<tree *> (&cluster.slots[off]);
325}
326
327/* *SLOT is a namespace binding slot. Append a slot for imported
328 module IX. */
329
330static binding_slot *
331append_imported_binding_slot (tree *slot, tree name, unsigned ix)
332{
333 gcc_checking_assert (ix)((void)(!(ix) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 333, __FUNCTION__), 0 : 0))
;
334
335 if (!*slot || TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
336 /* Make an initial module vector. */
337 get_fixed_binding_slot (slot, name, BINDING_SLOT_GLOBAL, -1);
338 else if (!BINDING_VECTOR_CLUSTER_LAST (*slot)(&(((tree_binding_vec *)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 338, __FUNCTION__, (BINDING_VECTOR))))->vec[((tree_check
((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 338, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base) - 1]))
339 ->indices[BINDING_VECTOR_SLOTS_PER_CLUSTER2 - 1].span)
340 /* There is space in the last cluster. */;
341 else if (BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 341, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
342 != BINDING_VECTOR_ALLOC_CLUSTERS (*slot)((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 342, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.clique)
)
343 /* There is space in the vector. */
344 BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 344, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
++;
345 else
346 {
347 /* Extend the vector. */
348 unsigned have = BINDING_VECTOR_NUM_CLUSTERS (*slot)((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 348, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
349 unsigned want = (have * 3 + 1) / 2;
350
351 if (want > (unsigned short)~0)
352 want = (unsigned short)~0;
353
354 tree new_vec = make_binding_vec (name, want);
355 BINDING_VECTOR_NUM_CLUSTERS (new_vec)((tree_check ((new_vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 355, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
= have + 1;
356 memcpy (BINDING_VECTOR_CLUSTER_BASE (new_vec)(((tree_binding_vec *)(tree_check ((new_vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 356, __FUNCTION__, (BINDING_VECTOR))))->vec)
,
357 BINDING_VECTOR_CLUSTER_BASE (*slot)(((tree_binding_vec *)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 357, __FUNCTION__, (BINDING_VECTOR))))->vec)
,
358 have * sizeof (binding_cluster));
359 *slot = new_vec;
360 }
361
362 binding_cluster *last = BINDING_VECTOR_CLUSTER_LAST (*slot)(&(((tree_binding_vec *)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 362, __FUNCTION__, (BINDING_VECTOR))))->vec[((tree_check
((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 362, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base) - 1]))
;
363 for (unsigned off = 0; off != BINDING_VECTOR_SLOTS_PER_CLUSTER2; off++)
364 if (!last->indices[off].span)
365 {
366 /* Fill the free slot of the cluster. */
367 last->indices[off].base = ix;
368 last->indices[off].span = 1;
369 last->slots[off] = NULL_TREE(tree) nullptr;
370 return &last->slots[off];
371 }
372
373 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 373, __FUNCTION__))
;
374}
375
376/* Add DECL to the list of things declared in binding level B. */
377
378static void
379add_decl_to_level (cp_binding_level *b, tree decl)
380{
381 gcc_assert (b->kind != sk_class)((void)(!(b->kind != sk_class) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 381, __FUNCTION__), 0 : 0))
;
382
383 /* Make sure we don't create a circular list. xref_tag can end
384 up pushing the same artificial decl more than once. We
385 should have already detected that in update_binding. */
386 gcc_assert (b->names != decl)((void)(!(b->names != decl) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 386, __FUNCTION__), 0 : 0))
;
387
388 /* We build up the list in reverse order, and reverse it later if
389 necessary. */
390 TREE_CHAIN (decl)((contains_struct_check ((decl), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 390, __FUNCTION__))->common.chain)
= b->names;
391 b->names = decl;
392
393 /* If appropriate, add decl to separate list of statics. We include
394 extern variables because they might turn out to be static later.
395 It's OK for this list to contain a few false positives. */
396 if (b->kind == sk_namespace
397 && ((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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 397, __FUNCTION__))->decl_common.decl_flag_1)
))
398 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
399 && (!TREE_PUBLIC (decl)((decl)->base.public_flag)
400 || decl_anon_ns_mem_p (decl)
401 || DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 401, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
))))
402 vec_safe_push (static_decls, decl);
403}
404
405/* Find the binding for NAME in the local binding level B. */
406
407static cxx_binding *
408find_local_binding (cp_binding_level *b, tree name)
409{
410 if (cxx_binding *binding = IDENTIFIER_BINDING (name)(((struct lang_identifier*)(tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 410, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
)
411 for (;; b = b->level_chain)
412 {
413 if (binding->scope == b)
414 return binding;
415
416 /* Cleanup contours are transparent to the language. */
417 if (b->kind != sk_cleanup)
418 break;
419 }
420 return NULLnullptr;
421}
422
423class name_lookup
424{
425public:
426 typedef std::pair<tree, tree> using_pair;
427 typedef vec<using_pair, va_heap, vl_embed> using_queue;
428
429public:
430 tree name; /* The identifier being looked for. */
431
432 /* Usually we just add things to the VALUE binding, but we record
433 (hidden) IMPLICIT_TYPEDEFs on the type binding, which is used for
434 using-decl resolution. */
435 tree value; /* A (possibly ambiguous) set of things found. */
436 tree type; /* A type that has been found. */
437
438 LOOK_want want; /* What kind of entity we want. */
439
440 bool deduping; /* Full deduping is needed because using declarations
441 are in play. */
442 vec<tree, va_heap, vl_embed> *scopes;
443 name_lookup *previous; /* Previously active lookup. */
444
445protected:
446 /* Marked scope stack for outermost name lookup. */
447 static vec<tree, va_heap, vl_embed> *shared_scopes;
448 /* Currently active lookup. */
449 static name_lookup *active;
450
451public:
452 name_lookup (tree n, LOOK_want w = LOOK_want::NORMAL)
453 : name (n), value (NULL_TREE(tree) nullptr), type (NULL_TREE(tree) nullptr),
454 want (w),
455 deduping (false), scopes (NULLnullptr), previous (NULLnullptr)
456 {
457 preserve_state ();
458 }
459 ~name_lookup ()
460 {
461 restore_state ();
462 }
463
464private: /* Uncopyable, unmovable, unassignable. I am a rock. */
465 name_lookup (const name_lookup &);
466 name_lookup &operator= (const name_lookup &);
467
468protected:
469 static bool seen_p (tree scope)
470 {
471 return LOOKUP_SEEN_P (scope)((scope)->base.visited);
472 }
473 static bool found_p (tree scope)
474 {
475 return LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 475, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 475, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
;
476 }
477
478 void mark_seen (tree scope); /* Mark and add to scope vector. */
479 static void mark_found (tree scope)
480 {
481 gcc_checking_assert (seen_p (scope))((void)(!(seen_p (scope)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 481, __FUNCTION__), 0 : 0))
;
482 LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 482, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 482, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
483 }
484 bool see_and_mark (tree scope)
485 {
486 bool ret = seen_p (scope);
487 if (!ret)
488 mark_seen (scope);
489 return ret;
490 }
491 bool find_and_mark (tree scope);
492
493private:
494 void preserve_state ();
495 void restore_state ();
496
497private:
498 static tree ambiguous (tree thing, tree current);
499 void add_overload (tree fns);
500 void add_value (tree new_val);
501 void add_type (tree new_type);
502 bool process_binding (tree val_bind, tree type_bind);
503 unsigned process_module_binding (tree val_bind, tree type_bind, unsigned);
504 /* Look in only namespace. */
505 bool search_namespace_only (tree scope);
506 /* Look in namespace and its (recursive) inlines. Ignore using
507 directives. Return true if something found (inc dups). */
508 bool search_namespace (tree scope);
509 /* Look in the using directives of namespace + inlines using
510 qualified lookup rules. */
511 bool search_usings (tree scope);
512
513private:
514 using_queue *queue_namespace (using_queue *queue, int depth, tree scope);
515 using_queue *do_queue_usings (using_queue *queue, int depth,
516 vec<tree, va_gc> *usings);
517 using_queue *queue_usings (using_queue *queue, int depth,
518 vec<tree, va_gc> *usings)
519 {
520 if (usings)
521 queue = do_queue_usings (queue, depth, usings);
522 return queue;
523 }
524
525private:
526 void add_fns (tree);
527
528 private:
529 void adl_expr (tree);
530 void adl_type (tree);
531 void adl_template_arg (tree);
532 void adl_class (tree);
533 void adl_enum (tree);
534 void adl_bases (tree);
535 void adl_class_only (tree);
536 void adl_namespace (tree);
537 void adl_class_fns (tree);
538 void adl_namespace_fns (tree, bitmap);
539
540public:
541 /* Search namespace + inlines + maybe usings as qualified lookup. */
542 bool search_qualified (tree scope, bool usings = true);
543
544 /* Search namespace + inlines + usings as unqualified lookup. */
545 bool search_unqualified (tree scope, cp_binding_level *);
546
547 /* ADL lookup of ARGS. */
548 tree search_adl (tree fns, vec<tree, va_gc> *args);
549};
550
551/* Scope stack shared by all outermost lookups. This avoids us
552 allocating and freeing on every single lookup. */
553vec<tree, va_heap, vl_embed> *name_lookup::shared_scopes;
554
555/* Currently active lookup. */
556name_lookup *name_lookup::active;
557
558/* Name lookup is recursive, becase ADL can cause template
559 instatiation. This is of course a rare event, so we optimize for
560 it not happening. When we discover an active name-lookup, which
561 must be an ADL lookup, we need to unmark the marked scopes and also
562 unmark the lookup we might have been accumulating. */
563
564void
565name_lookup::preserve_state ()
566{
567 previous = active;
568 if (previous)
569 {
570 unsigned length = vec_safe_length (previous->scopes);
571 vec_safe_reserve (previous->scopes, length * 2);
572 for (unsigned ix = length; ix--;)
573 {
574 tree decl = (*previous->scopes)[ix];
575
576 gcc_checking_assert (LOOKUP_SEEN_P (decl))((void)(!(((decl)->base.visited)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 576, __FUNCTION__), 0 : 0))
;
577 LOOKUP_SEEN_P (decl)((decl)->base.visited) = false;
578
579 /* Preserve the FOUND_P state on the interrupted lookup's
580 stack. */
581 if (LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 581, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 581, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
)
582 {
583 LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 583, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 583, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= false;
584 previous->scopes->quick_push (decl);
585 }
586 }
587
588 /* Unmark the outer partial lookup. */
589 if (previous->deduping)
590 lookup_mark (previous->value, false);
591 }
592 else
593 scopes = shared_scopes;
594 active = this;
595}
596
597/* Restore the marking state of a lookup we interrupted. */
598
599void
600name_lookup::restore_state ()
601{
602 if (deduping)
603 lookup_mark (value, false);
604
605 /* Unmark and empty this lookup's scope stack. */
606 for (unsigned ix = vec_safe_length (scopes); ix--;)
607 {
608 tree decl = scopes->pop ();
609 gcc_checking_assert (LOOKUP_SEEN_P (decl))((void)(!(((decl)->base.visited)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 609, __FUNCTION__), 0 : 0))
;
610 LOOKUP_SEEN_P (decl)((decl)->base.visited) = false;
611 LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 611, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 611, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= false;
612 }
613
614 active = previous;
615 if (previous)
616 {
617 free (scopes);
618
619 unsigned length = vec_safe_length (previous->scopes);
620 for (unsigned ix = 0; ix != length; ix++)
621 {
622 tree decl = (*previous->scopes)[ix];
623 if (LOOKUP_SEEN_P (decl)((decl)->base.visited))
624 {
625 /* The remainder of the scope stack must be recording
626 FOUND_P decls, which we want to pop off. */
627 do
628 {
629 tree decl = previous->scopes->pop ();
630 gcc_checking_assert (LOOKUP_SEEN_P (decl)((void)(!(((decl)->base.visited) && !((tree_not_check2
(((tree_check4 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 631, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 631, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 631, __FUNCTION__), 0 : 0))
631 && !LOOKUP_FOUND_P (decl))((void)(!(((decl)->base.visited) && !((tree_not_check2
(((tree_check4 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 631, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 631, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 631, __FUNCTION__), 0 : 0))
;
632 LOOKUP_FOUND_P (decl)((tree_not_check2 (((tree_check4 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 632, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 632, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
633 }
634 while (++ix != length);
635 break;
636 }
637
638 gcc_checking_assert (!LOOKUP_FOUND_P (decl))((void)(!(!((tree_not_check2 (((tree_check4 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 638, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 638, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 638, __FUNCTION__), 0 : 0))
;
639 LOOKUP_SEEN_P (decl)((decl)->base.visited) = true;
640 }
641
642 /* Remark the outer partial lookup. */
643 if (previous->deduping)
644 lookup_mark (previous->value, true);
645 }
646 else
647 shared_scopes = scopes;
648}
649
650void
651name_lookup::mark_seen (tree scope)
652{
653 gcc_checking_assert (!seen_p (scope))((void)(!(!seen_p (scope)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 653, __FUNCTION__), 0 : 0))
;
654 LOOKUP_SEEN_P (scope)((scope)->base.visited) = true;
655 vec_safe_push (scopes, scope);
656}
657
658bool
659name_lookup::find_and_mark (tree scope)
660{
661 bool result = LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 661, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 661, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
;
662 if (!result)
663 {
664 LOOKUP_FOUND_P (scope)((tree_not_check2 (((tree_check4 ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 664, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (ENUMERAL_TYPE
), (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 664, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
665 if (!LOOKUP_SEEN_P (scope)((scope)->base.visited))
666 vec_safe_push (scopes, scope);
667 }
668
669 return result;
670}
671
672/* THING and CURRENT are ambiguous, concatenate them. */
673
674tree
675name_lookup::ambiguous (tree thing, tree current)
676{
677 if (TREE_CODE (current)((enum tree_code) (current)->base.code) != TREE_LIST)
678 {
679 current = build_tree_list (NULL_TREE(tree) nullptr, current);
680 TREE_TYPE (current)((contains_struct_check ((current), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 680, __FUNCTION__))->typed.type)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
681 }
682 current = tree_cons (NULL_TREE(tree) nullptr, thing, current);
683 TREE_TYPE (current)((contains_struct_check ((current), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 683, __FUNCTION__))->typed.type)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
684
685 return current;
686}
687
688/* FNS is a new overload set to add to the exising set. */
689
690void
691name_lookup::add_overload (tree fns)
692{
693 if (!deduping && TREE_CODE (fns)((enum tree_code) (fns)->base.code) == OVERLOAD)
694 {
695 tree probe = fns;
696 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
697 probe = ovl_skip_hidden (probe);
698 if (probe && TREE_CODE (probe)((enum tree_code) (probe)->base.code) == OVERLOAD
699 && OVL_DEDUP_P (probe)((tree_not_check2 (((tree_check ((probe), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 699, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 699, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
700 {
701 /* We're about to add something found by multiple paths, so
702 need to engage deduping mode. */
703 lookup_mark (value, true);
704 deduping = true;
705 }
706 }
707
708 value = lookup_maybe_add (fns, value, deduping);
709}
710
711/* Add a NEW_VAL, a found value binding into the current value binding. */
712
713void
714name_lookup::add_value (tree new_val)
715{
716 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)
))
717 add_overload (new_val);
718 else if (!value)
719 value = new_val;
720 else if (value == new_val)
721 ;
722 else if ((TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL
723 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == TYPE_DECL
724 && same_type_p (TREE_TYPE (value), TREE_TYPE (new_val))comptypes ((((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 724, __FUNCTION__))->typed.type)), (((contains_struct_check
((new_val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 724, __FUNCTION__))->typed.type)), 0)
))
725 /* Typedefs to the same type. */;
726 else if (TREE_CODE (value)((enum tree_code) (value)->base.code) == NAMESPACE_DECL
727 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == NAMESPACE_DECL
728 && ORIGINAL_NAMESPACE (value)(((contains_struct_check (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__))->decl_common.abstract_origin) : (value
))
== ORIGINAL_NAMESPACE (new_val)(((contains_struct_check (((tree_check ((new_val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((new_val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 728, __FUNCTION__))->decl_common.abstract_origin) : (new_val
))
)
729 /* Namespace (possibly aliased) to the same namespace. Locate
730 the namespace*/
731 value = ORIGINAL_NAMESPACE (value)(((contains_struct_check (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 731, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 731, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 731, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 731, __FUNCTION__))->decl_common.abstract_origin) : (value
))
;
732 else
733 {
734 if (deduping)
735 {
736 /* Disengage deduping mode. */
737 lookup_mark (value, false);
738 deduping = false;
739 }
740 value = ambiguous (new_val, value);
741 }
742}
743
744/* Add a NEW_TYPE, a found type binding into the current type binding. */
745
746void
747name_lookup::add_type (tree new_type)
748{
749 if (!type)
750 type = new_type;
751 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == TREE_LIST
752 || !same_type_p (TREE_TYPE (type), TREE_TYPE (new_type))comptypes ((((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 752, __FUNCTION__))->typed.type)), (((contains_struct_check
((new_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 752, __FUNCTION__))->typed.type)), 0)
)
753 type = ambiguous (new_type, type);
754}
755
756/* Process a found binding containing NEW_VAL and NEW_TYPE. Returns
757 true if we actually found something noteworthy. Hiddenness has
758 already been handled in the caller. */
759
760bool
761name_lookup::process_binding (tree new_val, tree new_type)
762{
763 /* Did we really see a type? */
764 if (new_type
765 && (want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::NAMESPACE)
766 new_type = NULL_TREE(tree) nullptr;
767
768 /* Do we really see a value? */
769 if (new_val)
770 switch (TREE_CODE (new_val)((enum tree_code) (new_val)->base.code))
771 {
772 case TEMPLATE_DECL:
773 /* If we expect types or namespaces, and not templates,
774 or this is not a template class. */
775 if (bool (want & LOOK_want::TYPE_NAMESPACE)
776 && !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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 776, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((new_val
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 776, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == TYPE_DECL)
)
777 new_val = NULL_TREE(tree) nullptr;
778 break;
779 case TYPE_DECL:
780 if ((want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::NAMESPACE
781 || (new_type && bool (want & LOOK_want::TYPE)))
782 new_val = NULL_TREE(tree) nullptr;
783 break;
784 case NAMESPACE_DECL:
785 if ((want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::TYPE)
786 new_val = NULL_TREE(tree) nullptr;
787 break;
788 default:
789 if (bool (want & LOOK_want::TYPE_NAMESPACE))
790 new_val = NULL_TREE(tree) nullptr;
791 }
792
793 if (!new_val)
794 {
795 new_val = new_type;
796 new_type = NULL_TREE(tree) nullptr;
797 }
798
799 /* Merge into the lookup */
800 if (new_val)
801 add_value (new_val);
802 if (new_type)
803 add_type (new_type);
804
805 return new_val != NULL_TREE(tree) nullptr;
806}
807
808/* If we're importing a module containing this binding, add it to the
809 lookup set. The trickiness is with namespaces, we only want to
810 find it once. */
811
812unsigned
813name_lookup::process_module_binding (tree new_val, tree new_type,
814 unsigned marker)
815{
816 /* Optimize for (re-)finding a public namespace. We only need to
817 look once. */
818 if (new_val && !new_type
819 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == NAMESPACE_DECL
820 && TREE_PUBLIC (new_val)((new_val)->base.public_flag)
821 && !DECL_NAMESPACE_ALIAS (new_val)((contains_struct_check (((tree_check ((new_val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 821, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 821, __FUNCTION__))->decl_common.abstract_origin)
)
822 {
823 if (marker & 2)
824 return marker;
825 marker |= 2;
826 }
827
828 if (new_type || new_val)
829 marker |= process_binding (new_val, new_type);
830
831 return marker;
832}
833
834/* Look in exactly namespace SCOPE. */
835
836bool
837name_lookup::search_namespace_only (tree scope)
838{
839 bool found = false;
840 if (tree *binding = find_namespace_slot (scope, name))
841 {
842 tree val = *binding;
843 if (TREE_CODE (val)((enum tree_code) (val)->base.code) == BINDING_VECTOR)
844 {
845 /* I presume the binding list is going to be sparser than
846 the import bitmap. Hence iterate over the former
847 checking for bits set in the bitmap. */
848 bitmap imports = get_import_bitmap ();
849 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (val)(((tree_binding_vec *)(tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 849, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
850 int marker = 0;
851 int dup_detect = 0;
852
853 if (tree bind = cluster->slots[BINDING_SLOT_CURRENT])
854 {
855 if (!deduping)
856 {
857 if (named_module_purview_p ())
858 {
859 dup_detect |= 2;
860
861 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 861, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 861, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 861, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
862 dup_detect |= 1;
863 }
864 else
865 dup_detect |= 1;
866 }
867 tree type = NULL_TREE(tree) nullptr;
868 tree value = bind;
869
870 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 870, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 870, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
871 {
872 type = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 872, __FUNCTION__))->typed.type)
;
873 value = STAT_DECL (bind)(((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 873, __FUNCTION__, (OVERLOAD))))->function)
;
874
875 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
876 {
877 if (STAT_TYPE_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 877, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 877, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
878 type = NULL_TREE(tree) nullptr;
879 if (STAT_DECL_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 879, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 879, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
880 value = NULL_TREE(tree) nullptr;
881 else
882 value = ovl_skip_hidden (value);
883 }
884 }
885 else if (!bool (want & LOOK_want::HIDDEN_FRIEND))
886 value = ovl_skip_hidden (value);
887
888 marker = process_module_binding (value, type, marker);
889 }
890
891 /* Scan the imported bindings. */
892 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (val)((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 892, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
893 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
894 {
895 ix--;
896 cluster++;
897 }
898
899 /* Do this in forward order, so we load modules in an order
900 the user expects. */
901 for (; ix--; cluster++)
902 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
903 {
904 /* Are we importing this module? */
905 if (unsigned base = cluster->indices[jx].base)
906 if (unsigned span = cluster->indices[jx].span)
907 do
908 if (bitmap_bit_p (imports, base))
909 goto found;
910 while (++base, --span);
911 continue;
912
913 found:;
914 /* Is it loaded? */
915 if (cluster->slots[jx].is_lazy ())
916 {
917 gcc_assert (cluster->indices[jx].span == 1)((void)(!(cluster->indices[jx].span == 1) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 917, __FUNCTION__), 0 : 0))
;
918 lazy_load_binding (cluster->indices[jx].base,
919 scope, name, &cluster->slots[jx]);
920 }
921 tree bind = cluster->slots[jx];
922 if (!bind)
923 /* Load errors could mean there's nothing here. */
924 continue;
925
926 /* Extract what we can see from here. If there's no
927 stat_hack, then everything was exported. */
928 tree type = NULL_TREE(tree) nullptr;
929
930
931 /* If STAT_HACK_P is false, everything is visible, and
932 there's no duplication possibilities. */
933 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 933, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 933, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
934 {
935 if (!deduping)
936 {
937 /* Do we need to engage deduplication? */
938 int dup = 0;
939 if (MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 939, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
940 dup = 1;
941 else if (MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 941, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
942 dup = 2;
943 if (unsigned hit = dup_detect & dup)
944 {
945 if ((hit & 1 && BINDING_VECTOR_GLOBAL_DUPS_P (val)((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 945, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag)
)
946 || (hit & 2
947 && BINDING_VECTOR_PARTITION_DUPS_P (val)((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 947, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
))
948 {
949 lookup_mark (value, true);
950 deduping = true;
951 }
952 }
953 dup_detect |= dup;
954 }
955
956 if (STAT_TYPE_VISIBLE_P (bind)(((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 956, __FUNCTION__, (OVERLOAD))))->base.used_flag)
)
957 type = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 957, __FUNCTION__))->typed.type)
;
958 bind = STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 958, __FUNCTION__, (OVERLOAD))))->common.chain)
;
959 }
960
961 /* And process it. */
962 marker = process_module_binding (bind, type, marker);
963 }
964 found |= marker & 1;
965 }
966 else
967 {
968 /* Only a current module binding, visible from the current module. */
969 tree bind = *binding;
970 tree value = bind, type = NULL_TREE(tree) nullptr;
971
972 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 972, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 972, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
973 {
974 type = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 974, __FUNCTION__))->typed.type)
;
975 value = STAT_DECL (bind)(((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 975, __FUNCTION__, (OVERLOAD))))->function)
;
976
977 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
978 {
979 if (STAT_TYPE_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 979, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 979, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
980 type = NULL_TREE(tree) nullptr;
981 if (STAT_DECL_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 981, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 981, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
982 value = NULL_TREE(tree) nullptr;
983 else
984 value = ovl_skip_hidden (value);
985 }
986 }
987 else if (!bool (want & LOOK_want::HIDDEN_FRIEND))
988 value = ovl_skip_hidden (value);
989
990 found |= process_binding (value, type);
991 }
992 }
993
994 return found;
995}
996
997/* Conditionally look in namespace SCOPE and inline children. */
998
999bool
1000name_lookup::search_namespace (tree scope)
1001{
1002 if (see_and_mark (scope))
1003 /* We've visited this scope before. Return what we found then. */
1004 return found_p (scope);
1005
1006 /* Look in exactly namespace. */
1007 bool found = search_namespace_only (scope);
1008
1009 /* Don't look into inline children, if we're looking for an
1010 anonymous name -- it must be in the current scope, if anywhere. */
1011 if (name)
1012 /* Recursively look in its inline children. */
1013 if (vec<tree, va_gc> *inlinees = DECL_NAMESPACE_INLINEES (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1013, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1013, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1014 for (unsigned ix = inlinees->length (); ix--;)
1015 found |= search_namespace ((*inlinees)[ix]);
1016
1017 if (found)
1018 mark_found (scope);
1019
1020 return found;
1021}
1022
1023/* Recursively follow using directives of SCOPE & its inline children.
1024 Such following is essentially a flood-fill algorithm. */
1025
1026bool
1027name_lookup::search_usings (tree scope)
1028{
1029 /* We do not check seen_p here, as that was already set during the
1030 namespace_only walk. */
1031 if (found_p (scope))
1032 return true;
1033
1034 bool found = false;
1035 if (vec<tree, va_gc> *usings = NAMESPACE_LEVEL (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1035, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1035, __FUNCTION__); &lt->u.ns; })->level)
->using_directives)
1036 for (unsigned ix = usings->length (); ix--;)
1037 found |= search_qualified ((*usings)[ix], true);
1038
1039 /* Look in its inline children. */
1040 if (vec<tree, va_gc> *inlinees = DECL_NAMESPACE_INLINEES (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1040, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1040, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1041 for (unsigned ix = inlinees->length (); ix--;)
1042 found |= search_usings ((*inlinees)[ix]);
1043
1044 if (found)
1045 mark_found (scope);
1046
1047 return found;
1048}
1049
1050/* Qualified namespace lookup in SCOPE.
1051 1) Look in SCOPE (+inlines). If found, we're done.
1052 2) Otherwise, if USINGS is true,
1053 recurse for every using directive of SCOPE (+inlines).
1054
1055 Trickiness is (a) loops and (b) multiple paths to same namespace.
1056 In both cases we want to not repeat any lookups, and know whether
1057 to stop the caller's step #2. Do this via the FOUND_P marker. */
1058
1059bool
1060name_lookup::search_qualified (tree scope, bool usings)
1061{
1062 bool found = false;
1063
1064 if (seen_p (scope))
1065 found = found_p (scope);
1066 else
1067 {
1068 found = search_namespace (scope);
1069 if (!found && usings)
1070 found = search_usings (scope);
1071 }
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
1079name_lookup::using_queue *
1080name_lookup::queue_namespace (using_queue *queue, int depth, tree scope)
1081{
1082 if (see_and_mark (scope))
1083 return queue;
1084
1085 /* Record it. */
1086 tree common = scope;
1087 while (SCOPE_DEPTH (common)((tree_check ((common), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1087, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
> depth)
1088 common = CP_DECL_CONTEXT (common)(!(! (((contains_struct_check ((common), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1088, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((common), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1088, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((common
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1088, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1089 vec_safe_push (queue, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1092, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1092, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1093 for (unsigned ix = inlinees->length (); ix--;)
1094 queue = queue_namespace (queue, depth, (*inlinees)[ix]);
1095
1096 /* Queue its using targets. */
1097 queue = queue_usings (queue, depth, NAMESPACE_LEVEL (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1097, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1097, __FUNCTION__); &lt->u.ns; })->level)
->using_directives);
1098
1099 return queue;
1100}
1101
1102/* Add the namespaces in USINGS to the unqualified search queue. */
1103
1104name_lookup::using_queue *
1105name_lookup::do_queue_usings (using_queue *queue, int depth,
1106 vec<tree, va_gc> *usings)
1107{
1108 for (unsigned ix = usings->length (); ix--;)
1109 queue = queue_namespace (queue, depth, (*usings)[ix]);
1110
1111 return queue;
1112}
1113
1114/* Unqualified namespace lookup in SCOPE.
1115 1) add scope+inlins to worklist.
1116 2) recursively add target of every using directive
1117 3) for each worklist item where SCOPE is common ancestor, search it
1118 4) if nothing find, scope=parent, goto 1. */
1119
1120bool
1121name_lookup::search_unqualified (tree scope, cp_binding_level *level)
1122{
1123 /* Make static to avoid continual reallocation. We're not
1124 recursive. */
1125 static using_queue *queue = NULLnullptr;
1126 bool found = false;
1127 int length = vec_safe_length (queue);
1128
1129 /* Queue local using-directives. */
1130 for (; level->kind != sk_namespace; level = level->level_chain)
1131 queue = queue_usings (queue, SCOPE_DEPTH (scope)((tree_check ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1131, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
, level->using_directives);
1132
1133 for (; !found; scope = CP_DECL_CONTEXT (scope)(!(! (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1133, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1133, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((scope
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1133, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
)
1134 {
1135 gcc_assert (!DECL_NAMESPACE_ALIAS (scope))((void)(!(!((contains_struct_check (((tree_check ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1135, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1135, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1135, __FUNCTION__), 0 : 0))
;
1136 int depth = SCOPE_DEPTH (scope)((tree_check ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1136, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
;
1137
1138 /* Queue namespaces reachable from SCOPE. */
1139 queue = queue_namespace (queue, depth, scope);
1140
1141 /* Search every queued namespace where SCOPE is the common
1142 ancestor. Adjust the others. */
1143 unsigned ix = length;
1144 do
1145 {
1146 using_pair &pair = (*queue)[ix];
1147 while (pair.first == scope)
1148 {
1149 found |= search_namespace_only (pair.second);
1150 pair = queue->pop ();
1151 if (ix == queue->length ())
1152 goto done;
1153 }
1154 /* The depth is the same as SCOPE, find the parent scope. */
1155 if (SCOPE_DEPTH (pair.first)((tree_check ((pair.first), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1155, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
== depth)
1156 pair.first = CP_DECL_CONTEXT (pair.first)(!(! (((contains_struct_check ((pair.first), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1156, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((pair.first), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1156, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((pair.
first), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1156, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1157 ix++;
1158 }
1159 while (ix < queue->length ());
1160 done:;
1161 if (scope == global_namespacecp_global_trees[CPTI_GLOBAL])
1162 break;
1163
1164 /* If looking for hidden friends, we only look in the innermost
1165 namespace scope. [namespace.memdef]/3 If a friend
1166 declaration in a non-local class first declares a class,
1167 function, class template or function template the friend is a
1168 member of the innermost enclosing namespace. See also
1169 [basic.lookup.unqual]/7 */
1170 if (bool (want & LOOK_want::HIDDEN_FRIEND))
1171 break;
1172 }
1173
1174 /* Restore to incoming length. */
1175 vec_safe_truncate (queue, length);
1176
1177 return found;
1178}
1179
1180/* FNS is a value binding. If it is a (set of overloaded) functions,
1181 add them into the current value. */
1182
1183void
1184name_lookup::add_fns (tree fns)
1185{
1186 if (!fns)
1187 return;
1188 else if (TREE_CODE (fns)((enum tree_code) (fns)->base.code) == OVERLOAD)
1189 {
1190 if (TREE_TYPE (fns)((contains_struct_check ((fns), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1190, __FUNCTION__))->typed.type)
!= unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE])
1191 fns = OVL_FUNCTION (fns)(((struct tree_overload*)(tree_check ((fns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1191, __FUNCTION__, (OVERLOAD))))->function)
;
1192 }
1193 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1193, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fns)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1193, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
1194 return;
1195
1196 add_overload (fns);
1197}
1198
1199/* Add the overloaded fns of SCOPE. */
1200
1201void
1202name_lookup::adl_namespace_fns (tree scope, bitmap imports)
1203{
1204 if (tree *binding = find_namespace_slot (scope, name))
1205 {
1206 tree val = *binding;
1207 if (TREE_CODE (val)((enum tree_code) (val)->base.code) != BINDING_VECTOR)
1208 add_fns (ovl_skip_hidden (MAYBE_STAT_DECL (val)(((val) && ((enum tree_code) (val)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1208, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1208, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((val),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1208, __FUNCTION__, (OVERLOAD))))->function) : val)
));
1209 else
1210 {
1211 /* I presume the binding list is going to be sparser than
1212 the import bitmap. Hence iterate over the former
1213 checking for bits set in the bitmap. */
1214 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (val)(((tree_binding_vec *)(tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1214, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
1215 int dup_detect = 0;
1216
1217 if (tree bind = cluster->slots[BINDING_SLOT_CURRENT])
1218 {
1219 /* The current TU's bindings must be visible, we don't
1220 need to check the bitmaps. */
1221
1222 if (!deduping)
1223 {
1224 if (named_module_purview_p ())
1225 {
1226 dup_detect |= 2;
1227
1228 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1228, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1228, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1228, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
1229 dup_detect |= 1;
1230 }
1231 else
1232 dup_detect |= 1;
1233 }
1234
1235 add_fns (ovl_skip_hidden (MAYBE_STAT_DECL (bind)(((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1235, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1235, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((bind)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1235, __FUNCTION__, (OVERLOAD))))->function) : bind)
));
1236 }
1237
1238 /* Scan the imported bindings. */
1239 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (val)((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1239, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
1240 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
1241 {
1242 ix--;
1243 cluster++;
1244 }
1245
1246 /* Do this in forward order, so we load modules in an order
1247 the user expects. */
1248 for (; ix--; cluster++)
1249 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
1250 {
1251 /* Functions are never on merged slots. */
1252 if (!cluster->indices[jx].base
1253 || cluster->indices[jx].span != 1)
1254 continue;
1255
1256 /* Is this slot visible? */
1257 if (!bitmap_bit_p (imports, cluster->indices[jx].base))
1258 continue;
1259
1260 /* Is it loaded. */
1261 if (cluster->slots[jx].is_lazy ())
1262 lazy_load_binding (cluster->indices[jx].base,
1263 scope, name, &cluster->slots[jx]);
1264
1265 tree bind = cluster->slots[jx];
1266 if (!bind)
1267 /* Load errors could mean there's nothing here. */
1268 continue;
1269
1270 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1270, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1270, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1271 {
1272 if (!deduping)
1273 {
1274 /* Do we need to engage deduplication? */
1275 int dup = 0;
1276 if (MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1276, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
1277 dup = 1;
1278 else if (MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1278, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
1279 dup = 2;
1280 if (unsigned hit = dup_detect & dup)
1281 {
1282 if ((hit & 1 && BINDING_VECTOR_GLOBAL_DUPS_P (val)((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1282, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag
)
)
1283 || (hit & 2
1284 && BINDING_VECTOR_PARTITION_DUPS_P (val)((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1284, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
))
1285 {
1286 lookup_mark (value, true);
1287 deduping = true;
1288 }
1289 }
1290 dup_detect |= dup;
1291 }
1292
1293 bind = STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1293, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1294 }
1295
1296 add_fns (bind);
1297 }
1298 }
1299 }
1300}
1301
1302/* Add the hidden friends of SCOPE. */
1303
1304void
1305name_lookup::adl_class_fns (tree type)
1306{
1307 /* Add friends. */
1308 for (tree list = DECL_FRIENDLIST (TYPE_MAIN_DECL (type))(((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1308, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1308, __FUNCTION__))->common.chain)))), (TS_DECL_COMMON)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1308, __FUNCTION__))->decl_common.initial))
;
1309 list; list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1309, __FUNCTION__))->common.chain)
)
1310 if (name == FRIEND_NAME (list)(((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1310, __FUNCTION__, (TREE_LIST)))->list.purpose))
)
1311 {
1312 tree context = NULL_TREE(tree) nullptr; /* Lazily computed. */
1313 for (tree friends = FRIEND_DECLS (list)(((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1313, __FUNCTION__, (TREE_LIST)))->list.value))
; friends;
1314 friends = TREE_CHAIN (friends)((contains_struct_check ((friends), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1314, __FUNCTION__))->common.chain)
)
1315 {
1316 tree fn = TREE_VALUE (friends)((tree_check ((friends), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1316, __FUNCTION__, (TREE_LIST)))->list.value)
;
1317
1318 /* Only interested in global functions with potentially hidden
1319 (i.e. unqualified) declarations. */
1320 if (!context)
1321 context = decl_namespace_context (type);
1322 if (CP_DECL_CONTEXT (fn)(!(! (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1322, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1322, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((fn), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1322, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
!= context)
1323 continue;
1324
1325 if (!deduping)
1326 {
1327 lookup_mark (value, true);
1328 deduping = true;
1329 }
1330
1331 /* Template specializations are never found by name lookup.
1332 (Templates themselves can be found, but not template
1333 specializations.) */
1334 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL && DECL_USE_TEMPLATE (fn)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1334, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
)
1335 continue;
1336
1337 add_fns (fn);
1338 }
1339 }
1340}
1341
1342/* Find the containing non-inlined namespace, add it and all its
1343 inlinees. */
1344
1345void
1346name_lookup::adl_namespace (tree scope)
1347{
1348 if (see_and_mark (scope))
1349 return;
1350
1351 /* Look down into inline namespaces. */
1352 if (vec<tree, va_gc> *inlinees = DECL_NAMESPACE_INLINEES (scope)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((scope), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1352, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (scope)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1352, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1353 for (unsigned ix = inlinees->length (); ix--;)
1354 adl_namespace ((*inlinees)[ix]);
1355
1356 if (DECL_NAMESPACE_INLINE_P (scope)((tree_not_check2 (((tree_check ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1356, __FUNCTION__, (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1356, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
1357 /* Mark parent. */
1358 adl_namespace (CP_DECL_CONTEXT (scope)(!(! (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1358, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((scope), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1358, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((scope
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1358, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
);
1359}
1360
1361/* Adds the class and its friends to the lookup structure. */
1362
1363void
1364name_lookup::adl_class_only (tree type)
1365{
1366 /* Backend-built structures, such as __builtin_va_list, aren't
1367 affected by all this. */
1368 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1368, __FUNCTION__))->type_common.lang_flag_5))
)
1369 return;
1370
1371 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1371, __FUNCTION__))->type_common.main_variant)
;
1372
1373 if (see_and_mark (type))
1374 return;
1375
1376 tree context = decl_namespace_context (type);
1377 adl_namespace (context);
1378}
1379
1380/* Adds the class and its bases to the lookup structure.
1381 Returns true on error. */
1382
1383void
1384name_lookup::adl_bases (tree type)
1385{
1386 adl_class_only (type);
1387
1388 /* Process baseclasses. */
1389 if (tree binfo = TYPE_BINFO (type)((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1389, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.maxval)
)
1390 {
1391 tree base_binfo;
1392 int i;
1393
1394 for (i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1394, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)->
iterate ((i), &(base_binfo)))
; i++)
1395 adl_bases (BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1395, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1395, __FUNCTION__))->typed.type)
);
1396 }
1397}
1398
1399/* Adds everything associated with a class argument type to the lookup
1400 structure.
1401
1402 If T is a class type (including unions), its associated classes are: the
1403 class itself; the class of which it is a member, if any; and its direct
1404 and indirect base classes. Its associated namespaces are the namespaces
1405 of which its associated classes are members. Furthermore, if T is a
1406 class template specialization, its associated namespaces and classes
1407 also include: the namespaces and classes associated with the types of
1408 the template arguments provided for template type parameters (excluding
1409 template template parameters); the namespaces of which any template
1410 template arguments are members; and the classes of which any member
1411 templates used as template template arguments are members. [ Note:
1412 non-type template arguments do not contribute to the set of associated
1413 namespaces. --end note] */
1414
1415void
1416name_lookup::adl_class (tree type)
1417{
1418 /* Backend build structures, such as __builtin_va_list, aren't
1419 affected by all this. */
1420 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1420, __FUNCTION__))->type_common.lang_flag_5))
)
1421 return;
1422
1423 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1423, __FUNCTION__))->type_common.main_variant)
;
1424
1425 /* We don't set found here because we have to have set seen first,
1426 which is done in the adl_bases walk. */
1427 if (found_p (type))
1428 return;
1429
1430 complete_type (type);
1431 adl_bases (type);
1432 mark_found (type);
1433
1434 if (TYPE_CLASS_SCOPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1434, __FUNCTION__))->type_common.context) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1434, __FUNCTION__))->type_common.context))->base.code
))] == tcc_type))
)
1435 adl_class_only (TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1435, __FUNCTION__))->type_common.context)
);
1436
1437 /* Process template arguments. */
1438 if (CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1438, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1438, __FUNCTION__))->type_non_common.lang_1))
1439 && 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1439, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
1440 {
1441 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1441, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1441, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1441, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
;
1442 for (int i = 0; i < TREE_VEC_LENGTH (list)((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1442, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
1443 adl_template_arg (TREE_VEC_ELT (list, i)(*((const_cast<tree *> (tree_vec_elt_check ((list), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1443, __FUNCTION__)))))
);
1444 }
1445}
1446
1447void
1448name_lookup::adl_enum (tree type)
1449{
1450 type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1450, __FUNCTION__))->type_common.main_variant)
;
1451 if (see_and_mark (type))
1452 return;
1453
1454 if (TYPE_CLASS_SCOPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1454, __FUNCTION__))->type_common.context) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1454, __FUNCTION__))->type_common.context))->base.code
))] == tcc_type))
)
1455 adl_class_only (TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1455, __FUNCTION__))->type_common.context)
);
1456 else
1457 adl_namespace (decl_namespace_context (type));
1458}
1459
1460void
1461name_lookup::adl_expr (tree expr)
1462{
1463 if (!expr)
1464 return;
1465
1466 gcc_assert (!TYPE_P (expr))((void)(!(!(tree_code_type[(int) (((enum tree_code) (expr)->
base.code))] == tcc_type)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1466, __FUNCTION__), 0 : 0))
;
1467
1468 if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1468, __FUNCTION__))->typed.type)
!= unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE])
1469 {
1470 adl_type (unlowered_expr_type (expr));
1471 return;
1472 }
1473
1474 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == ADDR_EXPR)
1475 expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1475, __FUNCTION__)))))
;
1476 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPONENT_REF
1477 || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == OFFSET_REF)
1478 expr = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1478, __FUNCTION__)))))
;
1479 expr = MAYBE_BASELINK_FUNCTIONS (expr)((((enum tree_code) (expr)->base.code) == BASELINK) ? (((struct
tree_baselink*) (tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1479, __FUNCTION__, (BASELINK))))->functions) : expr)
;
1480
1481 if (OVL_P (expr)(((enum tree_code) (expr)->base.code) == FUNCTION_DECL || (
(enum tree_code) (expr)->base.code) == OVERLOAD)
)
1482 for (lkp_iterator iter (expr); iter; ++iter)
1483 adl_type (TREE_TYPE (*iter)((contains_struct_check ((*iter), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1483, __FUNCTION__))->typed.type)
);
1484 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == TEMPLATE_ID_EXPR)
1485 {
1486 /* The working paper doesn't currently say how to handle
1487 template-id arguments. The sensible thing would seem to be
1488 to handle the list of template candidates like a normal
1489 overload set, and handle the template arguments like we do
1490 for class template specializations. */
1491
1492 /* First the templates. */
1493 adl_expr (TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1493, __FUNCTION__)))))
);
1494
1495 /* Now the arguments. */
1496 if (tree args = TREE_OPERAND (expr, 1)(*((const_cast<tree*> (tree_operand_check ((expr), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1496, __FUNCTION__)))))
)
1497 for (int ix = TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1497, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ix--;)
1498 adl_template_arg (TREE_VEC_ELT (args, ix)(*((const_cast<tree *> (tree_vec_elt_check ((args), (ix
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1498, __FUNCTION__)))))
);
1499 }
1500}
1501
1502void
1503name_lookup::adl_type (tree type)
1504{
1505 if (!type)
1506 return;
1507
1508 if (TYPE_PTRDATAMEM_P (type)(((enum tree_code) (type)->base.code) == OFFSET_TYPE))
1509 {
1510 /* Pointer to member: associate class type and value type. */
1511 adl_type (TYPE_PTRMEM_CLASS_TYPE (type)((((enum tree_code) (type)->base.code) == OFFSET_TYPE) ? (
(tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1511, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1511, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1511, __FUNCTION__))->typed.type)), (cp_type_quals (type
)), tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1511, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1511, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
);
1512 adl_type (TYPE_PTRMEM_POINTED_TO_TYPE (type)((((enum tree_code) (type)->base.code) == OFFSET_TYPE) ? (
(contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1512, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type_real ((((contains_struct_check ((
((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1512, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1512, __FUNCTION__))->typed.type)), (cp_type_quals (type
)), tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1512, __FUNCTION__))->typed.type))
);
1513 return;
1514 }
1515
1516 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
1517 {
1518 case RECORD_TYPE:
1519 if (TYPE_PTRMEMFUNC_P (type)(((enum tree_code) (type)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1519, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1519, __FUNCTION__))->type_common.lang_flag_2)))
)
1520 {
1521 adl_type (TYPE_PTRMEMFUNC_FN_TYPE (type)(cp_build_qualified_type_real ((((contains_struct_check ((((tree_check3
((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1521, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1521, __FUNCTION__))->typed.type)), (cp_type_quals (type
)), tf_warning_or_error))
);
1522 return;
1523 }
1524 /* FALLTHRU */
1525 case UNION_TYPE:
1526 adl_class (type);
1527 return;
1528
1529 case METHOD_TYPE:
1530 /* The basetype is referenced in the first arg type, so just
1531 fall through. */
1532 case FUNCTION_TYPE:
1533 /* Associate the parameter types. */
1534 for (tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1534, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
; args; args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1534, __FUNCTION__))->common.chain)
)
1535 adl_type (TREE_VALUE (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1535, __FUNCTION__, (TREE_LIST)))->list.value)
);
1536 /* FALLTHROUGH */
1537
1538 case POINTER_TYPE:
1539 case REFERENCE_TYPE:
1540 case ARRAY_TYPE:
1541 adl_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1541, __FUNCTION__))->typed.type)
);
1542 return;
1543
1544 case ENUMERAL_TYPE:
1545 adl_enum (type);
1546 return;
1547
1548 case LANG_TYPE:
1549 gcc_assert (type == unknown_type_node((void)(!(type == cp_global_trees[CPTI_UNKNOWN_TYPE] || type ==
cp_global_trees[CPTI_INIT_LIST_TYPE]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1550, __FUNCTION__), 0 : 0))
1550 || type == init_list_type_node)((void)(!(type == cp_global_trees[CPTI_UNKNOWN_TYPE] || type ==
cp_global_trees[CPTI_INIT_LIST_TYPE]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1550, __FUNCTION__), 0 : 0))
;
1551 return;
1552
1553 case TYPE_PACK_EXPANSION:
1554 adl_type (PACK_EXPANSION_PATTERN (type)(((enum tree_code) (type)->base.code) == TYPE_PACK_EXPANSION
? ((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1554, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((type), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1554, __FUNCTION__))))))
);
1555 return;
1556
1557 default:
1558 break;
1559 }
1560}
1561
1562/* Adds everything associated with a template argument to the lookup
1563 structure. */
1564
1565void
1566name_lookup::adl_template_arg (tree arg)
1567{
1568 /* [basic.lookup.koenig]
1569
1570 If T is a template-id, its associated namespaces and classes are
1571 ... the namespaces and classes associated with the types of the
1572 template arguments provided for template type parameters
1573 (excluding template template parameters); the namespaces in which
1574 any template template arguments are defined; and the classes in
1575 which any member templates used as template template arguments
1576 are defined. [Note: non-type template arguments do not
1577 contribute to the set of associated namespaces. ] */
1578
1579 /* Consider first template template arguments. */
1580 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_TEMPLATE_PARM
1581 || TREE_CODE (arg)((enum tree_code) (arg)->base.code) == UNBOUND_CLASS_TEMPLATE)
1582 ;
1583 else if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL)
1584 {
1585 tree ctx = CP_DECL_CONTEXT (arg)(!(! (((contains_struct_check ((arg), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1585, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((arg), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1585, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((arg),
(TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1585, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1586
1587 /* It's not a member template. */
1588 if (TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) == NAMESPACE_DECL)
1589 adl_namespace (ctx);
1590 /* Otherwise, it must be member template. */
1591 else
1592 adl_class_only (ctx);
1593 }
1594 /* It's an argument pack; handle it recursively. */
1595 else if (ARGUMENT_PACK_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
|| ((enum tree_code) (arg)->base.code) == NONTYPE_ARGUMENT_PACK
)
)
1596 {
1597 tree args = ARGUMENT_PACK_ARGS (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1597, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1597, __FUNCTION__))))))
;
1598 int i, len = TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1598, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
1599 for (i = 0; i < len; ++i)
1600 adl_template_arg (TREE_VEC_ELT (args, i)(*((const_cast<tree *> (tree_vec_elt_check ((args), (i)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1600, __FUNCTION__)))))
);
1601 }
1602 /* It's not a template template argument, but it is a type template
1603 argument. */
1604 else if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code)
)] == tcc_type)
)
1605 adl_type (arg);
1606}
1607
1608/* Perform ADL lookup. FNS is the existing lookup result and ARGS are
1609 the call arguments. */
1610
1611tree
1612name_lookup::search_adl (tree fns, vec<tree, va_gc> *args)
1613{
1614 gcc_checking_assert (!vec_safe_length (scopes))((void)(!(!vec_safe_length (scopes)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1614, __FUNCTION__), 0 : 0))
;
1615
1616 /* Gather each associated entity onto the lookup's scope list. */
1617 unsigned ix;
1618 tree arg;
1619
1620 FOR_EACH_VEC_ELT_REVERSE (*args, ix, arg)for (ix = (*args).length () - 1; (*args).iterate ((ix), &
(arg)); (ix)--)
1621 /* OMP reduction operators put an ADL-significant type as the
1622 first arg. */
1623 if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code)
)] == tcc_type)
)
1624 adl_type (arg);
1625 else
1626 adl_expr (arg);
1627
1628 if (vec_safe_length (scopes))
1629 {
1630 /* Now do the lookups. */
1631 if (fns)
1632 {
1633 deduping = true;
1634 lookup_mark (fns, true);
1635 }
1636 value = fns;
1637
1638 /* INST_PATH will be NULL, if this is /not/ 2nd-phase ADL. */
1639 bitmap inst_path = NULLnullptr;
1640 /* VISIBLE is the regular import bitmap. */
1641 bitmap visible = visible_instantiation_path (&inst_path);
1642
1643 for (unsigned ix = scopes->length (); ix--;)
1644 {
1645 tree scope = (*scopes)[ix];
1646 if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) == NAMESPACE_DECL)
1647 adl_namespace_fns (scope, visible);
1648 else
1649 {
1650 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)
)
1651 adl_class_fns (scope);
1652
1653 /* During 2nd phase ADL: Any exported declaration D in N
1654 declared within the purview of a named module M
1655 (10.2) is visible if there is an associated entity
1656 attached to M with the same innermost enclosing
1657 non-inline namespace as D.
1658 [basic.lookup.argdep]/4.4 */
1659
1660 if (!inst_path)
1661 /* Not 2nd phase. */
1662 continue;
1663
1664 tree ctx = CP_DECL_CONTEXT (TYPE_NAME (scope))(!(! (((contains_struct_check ((((tree_class_check ((scope), (
tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1664, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1664, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((((tree_class_check ((scope), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1664, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1664, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((((tree_class_check
((scope), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1664, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1664, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1665 if (TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) != NAMESPACE_DECL)
1666 /* Not namespace-scope class. */
1667 continue;
1668
1669 tree origin = get_originating_module_decl (TYPE_NAME (scope)((tree_class_check ((scope), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1669, __FUNCTION__))->type_common.name)
);
1670 if (!DECL_LANG_SPECIFIC (origin)((contains_struct_check ((origin), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1670, __FUNCTION__))->decl_common.lang_specific)
1671 || !DECL_MODULE_IMPORT_P (origin)(((contains_struct_check (((origin)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1671, __FUNCTION__))->decl_common.lang_specific)->u.base
.module_import_p)
)
1672 /* Not imported. */
1673 continue;
1674
1675 unsigned module = get_importing_module (origin);
1676
1677 if (!bitmap_bit_p (inst_path, module))
1678 /* Not on path of instantiation. */
1679 continue;
1680
1681 if (bitmap_bit_p (visible, module))
1682 /* If the module was in the visible set, we'll look at
1683 its namespace partition anyway. */
1684 continue;
1685
1686 if (tree *slot = find_namespace_slot (ctx, name, false))
1687 if (binding_slot *mslot = search_imported_binding_slot (slot, module))
1688 {
1689 if (mslot->is_lazy ())
1690 lazy_load_binding (module, ctx, name, mslot);
1691
1692 if (tree bind = *mslot)
1693 {
1694 if (!deduping)
1695 {
1696 /* We must turn on deduping, because some
1697 other class from this module might also
1698 be in this namespace. */
1699 deduping = true;
1700 lookup_mark (value, true);
1701 }
1702
1703 /* Add the exported fns */
1704 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1704, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1704, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1705 add_fns (STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1705, __FUNCTION__, (OVERLOAD))))->common.chain)
);
1706 }
1707 }
1708 }
1709 }
1710
1711 fns = value;
1712 }
1713
1714 return fns;
1715}
1716
1717static bool qualified_namespace_lookup (tree, name_lookup *);
1718static void consider_binding_level (tree name,
1719 best_match <tree, const char *> &bm,
1720 cp_binding_level *lvl,
1721 bool look_within_fields,
1722 enum lookup_name_fuzzy_kind kind);
1723static void diagnose_name_conflict (tree, tree);
1724
1725/* ADL lookup of NAME. FNS is the result of regular lookup, and we
1726 don't add duplicates to it. ARGS is the vector of call
1727 arguments (which will not be empty). */
1728
1729tree
1730lookup_arg_dependent (tree name, tree fns, vec<tree, va_gc> *args)
1731{
1732 bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
1733 name_lookup lookup (name);
1734 fns = lookup.search_adl (fns, args);
1735 timevar_cond_stop (TV_NAME_LOOKUP, subtime);
1736 return fns;
1737}
1738
1739/* FNS is an overload set of conversion functions. Return the
1740 overloads converting to TYPE. */
1741
1742static tree
1743extract_conversion_operator (tree fns, tree type)
1744{
1745 tree convs = NULL_TREE(tree) nullptr;
1746 tree tpls = NULL_TREE(tree) nullptr;
1747
1748 for (ovl_iterator iter (fns); iter; ++iter)
1749 {
1750 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((*iter), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((*iter), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__), 0 : 0)), ((contains_struct_check ((*iter
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__))->decl_minimal.name))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1750, __FUNCTION__))->typed.type)), (type), 0)
)
1751 convs = lookup_add (*iter, convs);
1752
1753 if (TREE_CODE (*iter)((enum tree_code) (*iter)->base.code) == TEMPLATE_DECL)
1754 tpls = lookup_add (*iter, tpls);
1755 }
1756
1757 if (!convs)
1758 convs = tpls;
1759
1760 return convs;
1761}
1762
1763/* Binary search of (ordered) MEMBER_VEC for NAME. */
1764
1765static tree
1766member_vec_binary_search (vec<tree, va_gc> *member_vec, tree name)
1767{
1768 for (unsigned lo = 0, hi = member_vec->length (); lo < hi;)
1769 {
1770 unsigned mid = (lo + hi) / 2;
1771 tree binding = (*member_vec)[mid];
1772 tree binding_name = OVL_NAME (binding)((contains_struct_check ((ovl_first (binding)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1772, __FUNCTION__))->decl_minimal.name)
;
1773
1774 if (binding_name > name)
1775 hi = mid;
1776 else if (binding_name < name)
1777 lo = mid + 1;
1778 else
1779 return binding;
1780 }
1781
1782 return NULL_TREE(tree) nullptr;
1783}
1784
1785/* Linear search of (unordered) MEMBER_VEC for NAME. */
1786
1787static tree
1788member_vec_linear_search (vec<tree, va_gc> *member_vec, tree name)
1789{
1790 for (int ix = member_vec->length (); ix--;)
1791 if (tree binding = (*member_vec)[ix])
1792 if (OVL_NAME (binding)((contains_struct_check ((ovl_first (binding)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1792, __FUNCTION__))->decl_minimal.name)
== name)
1793 return binding;
1794
1795 return NULL_TREE(tree) nullptr;
1796}
1797
1798/* Linear search of (partially ordered) fields of KLASS for NAME. */
1799
1800static tree
1801fields_linear_search (tree klass, tree name, bool want_type)
1802{
1803 for (tree fields = TYPE_FIELDS (klass)((tree_check3 ((klass), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1803, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1803, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1803, __FUNCTION__))->common.chain))
)
1804 {
1805 tree decl = fields;
1806
1807 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL
1808 && ANON_AGGR_TYPE_P (TREE_TYPE (decl))((((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1808, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1808, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((decl
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1808, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1808, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1808, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1808, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
1809 {
1810 if (tree temp = search_anon_aggr (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1810, __FUNCTION__))->typed.type)
, name, want_type))
1811 return temp;
1812 }
1813
1814 if (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1814, __FUNCTION__))->decl_minimal.name)
!= name)
1815 continue;
1816
1817 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == USING_DECL)
1818 {
1819 decl = strip_using_decl (decl);
1820 if (is_overloaded_fn (decl))
1821 continue;
1822 }
1823
1824 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1824, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1824, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
1825 /* Functions are found separately. */
1826 continue;
1827
1828 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1828, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1828, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
1829 return decl;
1830 }
1831
1832 return NULL_TREE(tree) nullptr;
1833}
1834
1835/* Look for NAME member inside of anonymous aggregate ANON. Although
1836 such things should only contain FIELD_DECLs, we check that too
1837 late, and would give very confusing errors if we weren't
1838 permissive here. */
1839
1840tree
1841search_anon_aggr (tree anon, tree name, bool want_type)
1842{
1843 gcc_assert (COMPLETE_TYPE_P (anon))((void)(!((((tree_class_check ((anon), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1843, __FUNCTION__))->type_common.size) != (tree) nullptr
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1843, __FUNCTION__), 0 : 0))
;
1844 tree ret = get_class_binding_direct (anon, name, want_type);
1845 return ret;
1846}
1847
1848/* Look for NAME as an immediate member of KLASS (including
1849 anon-members or unscoped enum member). TYPE_OR_FNS is zero for
1850 regular search. >0 to get a type binding (if there is one) and <0
1851 if you want (just) the member function binding.
1852
1853 Use this if you do not want lazy member creation. */
1854
1855tree
1856get_class_binding_direct (tree klass, tree name, bool want_type)
1857{
1858 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1858, __FUNCTION__), 0 : 0))
;
1859
1860 /* Conversion operators can only be found by the marker conversion
1861 operator name. */
1862 bool conv_op = IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1862, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1862, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1862, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1862, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1862, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1862, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
;
1863 tree lookup = conv_op ? conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER] : name;
1864 tree val = NULL_TREE(tree) nullptr;
1865 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1865, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
1866
1867 if (COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1867, __FUNCTION__))->type_common.size) != (tree) nullptr
)
&& member_vec)
1868 {
1869 val = member_vec_binary_search (member_vec, lookup);
1870 if (!val)
1871 ;
1872 else if (STAT_HACK_P (val)((val) && ((enum tree_code) (val)->base.code) == OVERLOAD
&& ((tree_not_check2 (((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1872, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1872, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1873 val = want_type ? STAT_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1873, __FUNCTION__))->typed.type)
: STAT_DECL (val)(((struct tree_overload*)(tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1873, __FUNCTION__, (OVERLOAD))))->function)
;
1874 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1874, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((val)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1874, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
1875 val = NULL_TREE(tree) nullptr;
1876 }
1877 else
1878 {
1879 if (member_vec && !want_type)
1880 val = member_vec_linear_search (member_vec, lookup);
1881
1882 if (!val || (TREE_CODE (val)((enum tree_code) (val)->base.code) == OVERLOAD && OVL_DEDUP_P (val)((tree_not_check2 (((tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1882, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1882, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
))
1883 /* Dependent using declarations are a 'field', make sure we
1884 return that even if we saw an overload already. */
1885 if (tree field_val = fields_linear_search (klass, lookup, want_type))
1886 {
1887 if (!val)
1888 val = field_val;
1889 else if (TREE_CODE (field_val)((enum tree_code) (field_val)->base.code) == USING_DECL)
1890 val = ovl_make (field_val, val);
1891 }
1892 }
1893
1894 /* Extract the conversion operators asked for, unless the general
1895 conversion operator was requested. */
1896 if (val && conv_op)
1897 {
1898 gcc_checking_assert (OVL_FUNCTION (val) == conv_op_marker)((void)(!((((struct tree_overload*)(tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1898, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1898, __FUNCTION__), 0 : 0))
;
1899 val = OVL_CHAIN (val)(((struct tree_overload*)(tree_check ((val), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1899, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1900 if (tree type = TREE_TYPE (name)((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1900, __FUNCTION__))->typed.type)
)
1901 val = extract_conversion_operator (val, type);
1902 }
1903
1904 return val;
1905}
1906
1907/* We're about to lookup NAME in KLASS. Make sure any lazily declared
1908 members are now declared. */
1909
1910static void
1911maybe_lazily_declare (tree klass, tree name)
1912{
1913 tree main_decl = TYPE_NAME (TYPE_MAIN_VARIANT (klass))((tree_class_check ((((tree_class_check ((klass), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1913, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1913, __FUNCTION__))->type_common.name)
;
1914 if (DECL_LANG_SPECIFIC (main_decl)((contains_struct_check ((main_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1914, __FUNCTION__))->decl_common.lang_specific)
1915 && DECL_MODULE_PENDING_MEMBERS_P (main_decl)(((contains_struct_check (((tree_check ((main_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1915, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1915, __FUNCTION__))->decl_common.lang_specific) ->u.
base.module_pending_p)
)
1916 lazy_load_members (main_decl);
1917
1918 /* Lazily declare functions, if we're going to search these. */
1919 if (IDENTIFIER_CTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1919, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1919, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1919, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1919, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) & (!((tree_not_check2 (((tree_check ((name
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1919, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1919, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1920 {
1921 if (CLASSTYPE_LAZY_DEFAULT_CTOR (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1921, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_default_ctor)
)
1922 lazily_declare_fn (sfk_constructor, klass);
1923 if (CLASSTYPE_LAZY_COPY_CTOR (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1923, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_copy_ctor)
)
1924 lazily_declare_fn (sfk_copy_constructor, klass);
1925 if (CLASSTYPE_LAZY_MOVE_CTOR (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1925, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_move_ctor)
)
1926 lazily_declare_fn (sfk_move_constructor, klass);
1927 }
1928 else if (IDENTIFIER_DTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1928, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1928, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1928, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1928, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1928, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1928, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
1929 {
1930 if (CLASSTYPE_LAZY_DESTRUCTOR (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1930, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_destructor)
)
1931 lazily_declare_fn (sfk_destructor, klass);
1932 }
1933 else if (name == assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier))
1934 {
1935 if (CLASSTYPE_LAZY_COPY_ASSIGN (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1935, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_copy_assign)
)
1936 lazily_declare_fn (sfk_copy_assignment, klass);
1937 if (CLASSTYPE_LAZY_MOVE_ASSIGN (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1937, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_move_assign)
)
1938 lazily_declare_fn (sfk_move_assignment, klass);
1939 }
1940}
1941
1942/* Look for NAME's binding in exactly KLASS. See
1943 get_class_binding_direct for argument description. Does lazy
1944 special function creation as necessary. */
1945
1946tree
1947get_class_binding (tree klass, tree name, bool want_type /*=false*/)
1948{
1949 klass = complete_type (klass);
1950
1951 if (COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1951, __FUNCTION__))->type_common.size) != (tree) nullptr
)
)
1952 maybe_lazily_declare (klass, name);
1953
1954 return get_class_binding_direct (klass, name, want_type);
1955}
1956
1957/* Find the slot containing overloads called 'NAME'. If there is no
1958 such slot and the class is complete, create an empty one, at the
1959 correct point in the sorted member vector. Otherwise return NULL.
1960 Deals with conv_op marker handling. */
1961
1962tree *
1963find_member_slot (tree klass, tree name)
1964{
1965 bool complete_p = COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1965, __FUNCTION__))->type_common.size) != (tree) nullptr
)
;
1966
1967 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1967, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
1968 if (!member_vec)
1969 {
1970 vec_alloc (member_vec, 8);
1971 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1971, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
1972 if (complete_p)
1973 /* If the class is complete but had no member_vec, we need to
1974 add the TYPE_FIELDS into it. We're also most likely to be
1975 adding ctors & dtors, so ask for 6 spare slots (the
1976 abstract cdtors and their clones). */
1977 member_vec = set_class_bindings (klass, 6);
1978 }
1979
1980 if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1980, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1980, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1980, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1980, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1980, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1980, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1981 name = conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER];
1982
1983 unsigned ix, length = member_vec->length ();
1984 for (ix = 0; ix < length; ix++)
1985 {
1986 tree *slot = &(*member_vec)[ix];
1987 tree fn_name = OVL_NAME (*slot)((contains_struct_check ((ovl_first (*slot)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1987, __FUNCTION__))->decl_minimal.name)
;
1988
1989 if (fn_name == name)
1990 {
1991 /* If we found an existing slot, it must be a function set.
1992 Even with insertion after completion, because those only
1993 happen with artificial fns that have unspellable names.
1994 This means we do not have to deal with the stat hack
1995 either. */
1996 gcc_checking_assert (OVL_P (*slot))((void)(!((((enum tree_code) (*slot)->base.code) == FUNCTION_DECL
|| ((enum tree_code) (*slot)->base.code) == OVERLOAD)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1996, __FUNCTION__), 0 : 0))
;
1997 if (name == conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER])
1998 {
1999 gcc_checking_assert (OVL_FUNCTION (*slot) == conv_op_marker)((void)(!((((struct tree_overload*)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1999, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1999, __FUNCTION__), 0 : 0))
;
2000 /* Skip the conv-op marker. */
2001 slot = &OVL_CHAIN (*slot)(((struct tree_overload*)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2001, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2002 }
2003 return slot;
2004 }
2005
2006 if (complete_p && fn_name > name)
2007 break;
2008 }
2009
2010 /* No slot found, add one if the class is complete. */
2011 if (complete_p)
2012 {
2013 /* Do exact allocation, as we don't expect to add many. */
2014 gcc_assert (name != conv_op_identifier)((void)(!(name != cp_global_trees[CPTI_CONV_OP_IDENTIFIER]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2014, __FUNCTION__), 0 : 0))
;
2015 vec_safe_reserve_exact (member_vec, 1);
2016 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2016, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2017 member_vec->quick_insert (ix, NULL_TREE(tree) nullptr);
2018 return &(*member_vec)[ix];
2019 }
2020
2021 return NULLnullptr;
2022}
2023
2024/* KLASS is an incomplete class to which we're adding a method NAME.
2025 Add a slot and deal with conv_op marker handling. */
2026
2027tree *
2028add_member_slot (tree klass, tree name)
2029{
2030 gcc_assert (!COMPLETE_TYPE_P (klass))((void)(!(!(((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2030, __FUNCTION__))->type_common.size) != (tree) nullptr
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2030, __FUNCTION__), 0 : 0))
;
2031
2032 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2032, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2033 vec_safe_push (member_vec, NULL_TREE(tree) nullptr);
2034 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2034, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2035
2036 tree *slot = &member_vec->last ();
2037 if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2037, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2037, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2037, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2037, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2037, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2037, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2038 {
2039 /* Install the marker prefix. */
2040 *slot = ovl_make (conv_op_markercp_global_trees[CPTI_CONV_OP_MARKER], NULL_TREE(tree) nullptr);
2041 slot = &OVL_CHAIN (*slot)(((struct tree_overload*)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2041, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2042 }
2043
2044 return slot;
2045}
2046
2047/* Comparison function to compare two MEMBER_VEC entries by name.
2048 Because we can have duplicates during insertion of TYPE_FIELDS, we
2049 do extra checking so deduping doesn't have to deal with so many
2050 cases. */
2051
2052static int
2053member_name_cmp (const void *a_p, const void *b_p)
2054{
2055 tree a = *(const tree *)a_p;
2056 tree b = *(const tree *)b_p;
2057 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2057, __FUNCTION__, (OVERLOAD))))->function) : a), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2057, __FUNCTION__))->decl_minimal.name)
;
2058 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2058, __FUNCTION__, (OVERLOAD))))->function) : b), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2058, __FUNCTION__))->decl_minimal.name)
;
2059
2060 gcc_checking_assert (name_a && name_b)((void)(!(name_a && name_b) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2060, __FUNCTION__), 0 : 0))
;
2061 if (name_a != name_b)
2062 return name_a < name_b ? -1 : +1;
2063
2064 if (name_a == conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER])
2065 {
2066 /* Strip the conv-op markers. */
2067 gcc_checking_assert (OVL_FUNCTION (a) == conv_op_marker((void)(!((((struct tree_overload*)(tree_check ((a), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2067, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER] && (((struct tree_overload*)(tree_check
((b), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2068, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2068, __FUNCTION__), 0 : 0))
2068 && OVL_FUNCTION (b) == conv_op_marker)((void)(!((((struct tree_overload*)(tree_check ((a), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2067, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER] && (((struct tree_overload*)(tree_check
((b), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2068, __FUNCTION__, (OVERLOAD))))->function) == cp_global_trees
[CPTI_CONV_OP_MARKER]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2068, __FUNCTION__), 0 : 0))
;
2069 a = OVL_CHAIN (a)(((struct tree_overload*)(tree_check ((a), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2069, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2070 b = OVL_CHAIN (b)(((struct tree_overload*)(tree_check ((b), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2070, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2071 }
2072
2073 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == OVERLOAD)
2074 a = OVL_FUNCTION (a)(((struct tree_overload*)(tree_check ((a), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2074, __FUNCTION__, (OVERLOAD))))->function)
;
2075 if (TREE_CODE (b)((enum tree_code) (b)->base.code) == OVERLOAD)
2076 b = OVL_FUNCTION (b)(((struct tree_overload*)(tree_check ((b), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2076, __FUNCTION__, (OVERLOAD))))->function)
;
2077
2078 /* We're in STAT_HACK or USING_DECL territory (or possibly error-land). */
2079 if (TREE_CODE (a)((enum tree_code) (a)->base.code) != TREE_CODE (b)((enum tree_code) (b)->base.code))
2080 {
2081 /* If one of them is a TYPE_DECL, it loses. */
2082 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == TYPE_DECL)
2083 return +1;
2084 else if (TREE_CODE (b)((enum tree_code) (b)->base.code) == TYPE_DECL)
2085 return -1;
2086
2087 /* If one of them is a USING_DECL, it loses. */
2088 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == USING_DECL)
2089 return +1;
2090 else if (TREE_CODE (b)((enum tree_code) (b)->base.code) == USING_DECL)
2091 return -1;
2092
2093 /* There are no other cases with different kinds of decls, as
2094 duplicate detection should have kicked in earlier. However,
2095 some erroneous cases get though. */
2096 gcc_assert (errorcount)((void)(!((global_dc)->diagnostic_count[(int) (DK_ERROR)])
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2096, __FUNCTION__), 0 : 0))
;
2097 }
2098
2099 /* Using source location would be the best thing here, but we can
2100 get identically-located decls in the following circumstances:
2101
2102 1) duplicate artificial type-decls for the same type.
2103
2104 2) pack expansions of using-decls.
2105
2106 We should not be doing #1, but in either case it doesn't matter
2107 how we order these. Use UID as a proxy for source ordering, so
2108 that identically-located decls still have a well-defined stable
2109 ordering. */
2110 if (DECL_UID (a)((contains_struct_check ((a), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2110, __FUNCTION__))->decl_minimal.uid)
!= DECL_UID (b)((contains_struct_check ((b), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2110, __FUNCTION__))->decl_minimal.uid)
)
2111 return DECL_UID (a)((contains_struct_check ((a), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2111, __FUNCTION__))->decl_minimal.uid)
< DECL_UID (b)((contains_struct_check ((b), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2111, __FUNCTION__))->decl_minimal.uid)
? -1 : +1;
2112 gcc_assert (a == b)((void)(!(a == b) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2112, __FUNCTION__), 0 : 0))
;
2113 return 0;
2114}
2115
2116static struct {
2117 gt_pointer_operator new_value;
2118 void *cookie;
2119} resort_data;
2120
2121/* This routine compares two fields like member_name_cmp but using the
2122 pointer operator in resort_field_decl_data. We don't have to deal
2123 with duplicates here. */
2124
2125static int
2126resort_member_name_cmp (const void *a_p, const void *b_p)
2127{
2128 tree a = *(const tree *)a_p;
2129 tree b = *(const tree *)b_p;
2130 tree name_a = OVL_NAME (a)((contains_struct_check ((ovl_first (a)), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2130, __FUNCTION__))->decl_minimal.name)
;
2131 tree name_b = OVL_NAME (b)((contains_struct_check ((ovl_first (b)), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2131, __FUNCTION__))->decl_minimal.name)
;
2132
2133 resort_data.new_value (&name_a, resort_data.cookie);
2134 resort_data.new_value (&name_b, resort_data.cookie);
2135
2136 gcc_checking_assert (name_a != name_b)((void)(!(name_a != name_b) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2136, __FUNCTION__), 0 : 0))
;
2137
2138 return name_a < name_b ? -1 : +1;
2139}
2140
2141/* Resort CLASSTYPE_MEMBER_VEC because pointers have been reordered. */
2142
2143void
2144resort_type_member_vec (void *obj, void */*orig_obj*/,
2145 gt_pointer_operator new_value, void* cookie)
2146{
2147 if (vec<tree, va_gc> *member_vec = (vec<tree, va_gc> *) obj)
2148 {
2149 resort_data.new_value = new_value;
2150 resort_data.cookie = cookie;
2151 member_vec->qsort (resort_member_name_cmp)qsort (resort_member_name_cmp);
2152 }
2153}
2154
2155/* Recursively count the number of fields in KLASS, including anonymous
2156 union members. */
2157
2158static unsigned
2159count_class_fields (tree klass)
2160{
2161 unsigned n_fields = 0;
2162
2163 for (tree fields = TYPE_FIELDS (klass)((tree_check3 ((klass), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2163, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2163, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2163, __FUNCTION__))->common.chain))
)
2164 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2164, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fields
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2164, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2165 /* Functions are dealt with separately. */;
2166 else if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL
2167 && ANON_AGGR_TYPE_P (TREE_TYPE (fields))((((((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2167, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2167, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((fields
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2167, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2167, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((fields), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2167, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2167, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
2168 n_fields += count_class_fields (TREE_TYPE (fields)((contains_struct_check ((fields), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2168, __FUNCTION__))->typed.type)
);
2169 else if (DECL_NAME (fields)((contains_struct_check ((fields), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2169, __FUNCTION__))->decl_minimal.name)
)
2170 n_fields += 1;
2171
2172 return n_fields;
2173}
2174
2175/* Append all the nonfunction members fields of KLASS to MEMBER_VEC.
2176 Recurse for anonymous members. MEMBER_VEC must have space. */
2177
2178static void
2179member_vec_append_class_fields (vec<tree, va_gc> *member_vec, tree klass)
2180{
2181 for (tree fields = TYPE_FIELDS (klass)((tree_check3 ((klass), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2181, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2181, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2181, __FUNCTION__))->common.chain))
)
2182 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2182, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fields
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2182, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2183 /* Functions are handled separately. */;
2184 else if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL
2185 && ANON_AGGR_TYPE_P (TREE_TYPE (fields))((((((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2185, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((fields), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2185, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((fields
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2185, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2185, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((fields), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2185, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2185, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
2186 member_vec_append_class_fields (member_vec, TREE_TYPE (fields)((contains_struct_check ((fields), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2186, __FUNCTION__))->typed.type)
);
2187 else if (DECL_NAME (fields)((contains_struct_check ((fields), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2187, __FUNCTION__))->decl_minimal.name)
)
2188 {
2189 tree field = fields;
2190 /* Mark a conv-op USING_DECL with the conv-op-marker. */
2191 if (TREE_CODE (field)((enum tree_code) (field)->base.code) == USING_DECL
2192 && IDENTIFIER_CONV_OP_P (DECL_NAME (field))((((tree_not_check2 (((tree_check ((((contains_struct_check (
(field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2192, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2193 field = ovl_make (conv_op_markercp_global_trees[CPTI_CONV_OP_MARKER], field);
2194 member_vec->quick_push (field);
2195 }
2196}
2197
2198/* Append all of the enum values of ENUMTYPE to MEMBER_VEC.
2199 MEMBER_VEC must have space. */
2200
2201static void
2202member_vec_append_enum_values (vec<tree, va_gc> *member_vec, tree enumtype)
2203{
2204 for (tree values = TYPE_VALUES (enumtype)((tree_check ((enumtype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2204, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
;
25
Calling 'tree_check'
28
Returning from 'tree_check'
29
Loop condition is true. Entering loop body
2205 values; values = TREE_CHAIN (values)((contains_struct_check ((values), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2205, __FUNCTION__))->common.chain)
)
2206 member_vec->quick_push (TREE_VALUE (values)((tree_check ((values), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2206, __FUNCTION__, (TREE_LIST)))->list.value)
);
30
Called C++ object pointer is null
2207}
2208
2209/* MEMBER_VEC has just had new DECLs added to it, but is sorted.
2210 DeDup adjacent DECLS of the same name. We already dealt with
2211 conflict resolution when adding the fields or methods themselves.
2212 There are three cases (which could all be combined):
2213 1) a TYPE_DECL and non TYPE_DECL. Deploy STAT_HACK as appropriate.
2214 2) a USING_DECL and an overload. If the USING_DECL is dependent,
2215 it wins. Otherwise the OVERLOAD does.
2216 3) two USING_DECLS. ...
2217
2218 member_name_cmp will have ordered duplicates as
2219 <fns><using><type> */
2220
2221static void
2222member_vec_dedup (vec<tree, va_gc> *member_vec)
2223{
2224 unsigned len = member_vec->length ();
2225 unsigned store = 0;
2226
2227 if (!len)
2228 return;
2229
2230 tree name = OVL_NAME ((*member_vec)[0])((contains_struct_check ((ovl_first ((*member_vec)[0])), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2230, __FUNCTION__))->decl_minimal.name)
;
2231 for (unsigned jx, ix = 0; ix < len; ix = jx)
2232 {
2233 tree current = NULL_TREE(tree) nullptr;
2234 tree to_type = NULL_TREE(tree) nullptr;
2235 tree to_using = NULL_TREE(tree) nullptr;
2236 tree marker = NULL_TREE(tree) nullptr;
2237
2238 for (jx = ix; jx < len; jx++)
2239 {
2240 tree next = (*member_vec)[jx];
2241 if (jx != ix)
2242 {
2243 tree next_name = OVL_NAME (next)((contains_struct_check ((ovl_first (next)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2243, __FUNCTION__))->decl_minimal.name)
;
2244 if (next_name != name)
2245 {
2246 name = next_name;
2247 break;
2248 }
2249 }
2250
2251 if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2251, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2251, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2251, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2251, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2251, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2251, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2252 {
2253 marker = next;
2254 next = OVL_CHAIN (next)(((struct tree_overload*)(tree_check ((next), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2254, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2255 }
2256
2257 if (TREE_CODE (next)((enum tree_code) (next)->base.code) == USING_DECL)
2258 {
2259 if (IDENTIFIER_CTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2259, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2259, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2259, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2259, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) & (!((tree_not_check2 (((tree_check ((name
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2259, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2259, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2260 /* Dependent inherited ctor. */
2261 continue;
2262
2263 next = strip_using_decl (next);
2264 if (TREE_CODE (next)((enum tree_code) (next)->base.code) == USING_DECL)
2265 {
2266 to_using = next;
2267 continue;
2268 }
2269
2270 if (is_overloaded_fn (next))
2271 continue;
2272 }
2273
2274 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2274, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((next
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2274, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
2275 {
2276 to_type = next;
2277 continue;
2278 }
2279
2280 if (!current)
2281 current = next;
2282 }
2283
2284 if (to_using)
2285 {
2286 if (!current)
2287 current = to_using;
2288 else
2289 current = ovl_make (to_using, current);
2290 }
2291
2292 if (to_type)
2293 {
2294 if (!current)
2295 current = to_type;
2296 else
2297 current = stat_hack (current, to_type);
2298 }
2299
2300 if (current)
2301 {
2302 if (marker)
2303 {
2304 OVL_CHAIN (marker)(((struct tree_overload*)(tree_check ((marker), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2304, __FUNCTION__, (OVERLOAD))))->common.chain)
= current;
2305 current = marker;
2306 }
2307 (*member_vec)[store++] = current;
2308 }
2309 }
2310
2311 while (store++ < len)
2312 member_vec->pop ();
2313}
2314
2315/* Add the non-function members to CLASSTYPE_MEMBER_VEC. If there is
2316 no existing MEMBER_VEC and fewer than 8 fields, do nothing. We
2317 know there must be at least 1 field -- the self-reference
2318 TYPE_DECL, except for anon aggregates, which will have at least
2319 one field anyway. If EXTRA < 0, always create the vector. */
2320
2321vec<tree, va_gc> *
2322set_class_bindings (tree klass, int extra)
2323{
2324 unsigned n_fields = count_class_fields (klass);
2325 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2325, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2326
2327 if (member_vec || n_fields >= 8 || extra < 0)
2328 {
2329 /* Append the new fields. */
2330 vec_safe_reserve_exact (member_vec, n_fields + (extra >= 0 ? extra : 0));
2331 member_vec_append_class_fields (member_vec, klass);
2332 }
2333
2334 if (member_vec)
2335 {
2336 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2336, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2337 member_vec->qsort (member_name_cmp)qsort (member_name_cmp);
2338 member_vec_dedup (member_vec);
2339 }
2340
2341 return member_vec;
2342}
2343
2344/* Insert lately defined enum ENUMTYPE into KLASS for the sorted case. */
2345
2346void
2347insert_late_enum_def_bindings (tree klass, tree enumtype)
2348{
2349 int n_fields;
2350 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2350, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2351
2352 /* The enum bindings will already be on the TYPE_FIELDS, so don't
2353 count them twice. */
2354 if (!member_vec)
1
Assuming 'member_vec' is non-null
2
Taking false branch
2355 n_fields = count_class_fields (klass);
2356 else
2357 n_fields = list_length (TYPE_VALUES (enumtype)((tree_check ((enumtype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2357, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
);
3
Calling 'tree_check'
7
Returning from 'tree_check'
2358
2359 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)
2360 {
2361 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>'
2362 if (CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2362, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
)
22
Taking true branch
2363 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'
2364 else
2365 member_vec_append_class_fields (member_vec, klass);
2366 CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2366, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2367 member_vec->qsort (member_name_cmp)qsort (member_name_cmp);
2368 member_vec_dedup (member_vec);
2369 }
2370}
2371
2372/* The binding oracle; see cp-tree.h. */
2373
2374cp_binding_oracle_function *cp_binding_oracle;
2375
2376/* If we have a binding oracle, ask it for all namespace-scoped
2377 definitions of NAME. */
2378
2379static inline void
2380query_oracle (tree name)
2381{
2382 if (!cp_binding_oracle)
2383 return;
2384
2385 /* LOOKED_UP holds the set of identifiers that we have already
2386 looked up with the oracle. */
2387 static hash_set<tree> looked_up;
2388 if (looked_up.add (name))
2389 return;
2390
2391 cp_binding_oracle (CP_ORACLE_IDENTIFIER, name);
2392}
2393
2394#ifndef ENABLE_SCOPE_CHECKING0
2395# define ENABLE_SCOPE_CHECKING0 0
2396#else
2397# define ENABLE_SCOPE_CHECKING0 1
2398#endif
2399
2400/* A free list of "cxx_binding"s, connected by their PREVIOUS. */
2401
2402static GTY((deletable)) cxx_binding *free_bindings;
2403
2404/* Initialize VALUE and TYPE field for BINDING, and set the PREVIOUS
2405 field to NULL. */
2406
2407static inline void
2408cxx_binding_init (cxx_binding *binding, tree value, tree type)
2409{
2410 binding->value = value;
2411 binding->type = type;
2412 binding->previous = NULLnullptr;
2413}
2414
2415/* (GC)-allocate a binding object with VALUE and TYPE member initialized. */
2416
2417static cxx_binding *
2418cxx_binding_make (tree value, tree type)
2419{
2420 cxx_binding *binding = free_bindings;
2421
2422 if (binding)
2423 free_bindings = binding->previous;
2424 else
2425 binding = ggc_alloc<cxx_binding> ();
2426
2427 /* Clear flags by default. */
2428 LOCAL_BINDING_P (binding)((binding)->is_local) = false;
2429 INHERITED_VALUE_BINDING_P (binding)((binding)->value_is_inherited) = false;
2430 HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden) = false;
2431
2432 cxx_binding_init (binding, value, type);
2433
2434 return binding;
2435}
2436
2437/* Put BINDING back on the free list. */
2438
2439static inline void
2440cxx_binding_free (cxx_binding *binding)
2441{
2442 binding->scope = NULLnullptr;
2443 binding->previous = free_bindings;
2444 free_bindings = binding;
2445}
2446
2447/* Create a new binding for NAME (with the indicated VALUE and TYPE
2448 bindings) in the class scope indicated by SCOPE. */
2449
2450static cxx_binding *
2451new_class_binding (tree name, tree value, tree type, cp_binding_level *scope)
2452{
2453 cp_class_binding cb = {cxx_binding_make (value, type), name};
2454 cxx_binding *binding = cb.base;
2455 vec_safe_push (scope->class_shadowed, cb);
2456 binding->scope = scope;
2457 return binding;
2458}
2459
2460/* Make DECL the innermost binding for ID. The LEVEL is the binding
2461 level at which this declaration is being bound. */
2462
2463void
2464push_binding (tree id, tree decl, cp_binding_level* level)
2465{
2466 cxx_binding *binding;
2467
2468 if (level != class_binding_levelscope_chain->class_bindings)
2469 {
2470 binding = cxx_binding_make (decl, NULL_TREE(tree) nullptr);
2471 binding->scope = level;
2472 }
2473 else
2474 binding = new_class_binding (id, decl, /*type=*/NULL_TREE(tree) nullptr, level);
2475
2476 /* Now, fill in the binding information. */
2477 binding->previous = IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2477, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
2478 LOCAL_BINDING_P (binding)((binding)->is_local) = (level != class_binding_levelscope_chain->class_bindings);
2479
2480 /* And put it on the front of the list of bindings for ID. */
2481 IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2481, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
= binding;
2482}
2483
2484/* Remove the binding for DECL which should be the innermost binding
2485 for ID. */
2486
2487void
2488pop_local_binding (tree id, tree decl)
2489{
2490 if (!id || IDENTIFIER_ANON_P (id)((tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2490, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
)
2491 /* It's easiest to write the loops that call this function without
2492 checking whether or not the entities involved have names. We
2493 get here for such an entity. */
2494 return;
2495
2496 /* Get the innermost binding for ID. */
2497 cxx_binding *binding = IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2497, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
2498
2499 /* The name should be bound. */
2500 gcc_assert (binding != NULL)((void)(!(binding != nullptr) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2500, __FUNCTION__), 0 : 0))
;
2501
2502 /* The DECL will be either the ordinary binding or the type binding
2503 for this identifier. Remove that binding. We don't have to
2504 clear HIDDEN_TYPE_BINDING_P, as the whole binding will be going
2505 away. */
2506 if (binding->value == decl)
2507 binding->value = NULL_TREE(tree) nullptr;
2508 else
2509 {
2510 gcc_checking_assert (binding->type == decl)((void)(!(binding->type == decl) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2510, __FUNCTION__), 0 : 0))
;
2511 binding->type = NULL_TREE(tree) nullptr;
2512 }
2513
2514 if (!binding->value && !binding->type)
2515 {
2516 /* We're completely done with the innermost binding for this
2517 identifier. Unhook it from the list of bindings. */
2518 IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2518, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
= binding->previous;
2519
2520 /* Add it to the free list. */
2521 cxx_binding_free (binding);
2522 }
2523}
2524
2525/* Remove the bindings for the decls of the current level and leave
2526 the current scope. */
2527
2528void
2529pop_bindings_and_leave_scope (void)
2530{
2531 for (tree t = get_local_decls (); t; t = DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2531, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2531, __FUNCTION__))->common.chain))
)
2532 {
2533 tree decl = TREE_CODE (t)((enum tree_code) (t)->base.code) == TREE_LIST ? TREE_VALUE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2533, __FUNCTION__, (TREE_LIST)))->list.value)
: t;
2534 tree name = OVL_NAME (decl)((contains_struct_check ((ovl_first (decl)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2534, __FUNCTION__))->decl_minimal.name)
;
2535
2536 pop_local_binding (name, decl);
2537 }
2538
2539 leave_scope ();
2540}
2541
2542/* Strip non dependent using declarations. If DECL is dependent,
2543 surreptitiously create a typename_type and return it. */
2544
2545tree
2546strip_using_decl (tree decl)
2547{
2548 if (decl == NULL_TREE(tree) nullptr)
2549 return NULL_TREE(tree) nullptr;
2550
2551 while (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == USING_DECL && !DECL_DEPENDENT_P (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2551, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2551, __FUNCTION__))->decl_common.lang_flag_0)
)
2552 decl = USING_DECL_DECLS (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2552, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2552, __FUNCTION__))->decl_common.initial)
;
2553
2554 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == USING_DECL && DECL_DEPENDENT_P (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2554, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2554, __FUNCTION__))->decl_common.lang_flag_0)
2555 && USING_DECL_TYPENAME_P (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2555, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2555, __FUNCTION__))->decl_common.lang_flag_1)
)
2556 {
2557 /* We have found a type introduced by a using
2558 declaration at class scope that refers to a dependent
2559 type.
2560
2561 using typename :: [opt] nested-name-specifier unqualified-id ;
2562 */
2563 decl = make_typename_type (USING_DECL_SCOPE (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2563, __FUNCTION__, (USING_DECL)))), (TS_DECL_NON_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2563, __FUNCTION__))->decl_non_common.result)
,
2564 DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2564, __FUNCTION__))->decl_minimal.name)
,
2565 typename_type, tf_error);
2566 if (decl != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2567 decl = TYPE_NAME (decl)((tree_class_check ((decl), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2567, __FUNCTION__))->type_common.name)
;
2568 }
2569
2570 return decl;
2571}
2572
2573/* Return true if OVL is an overload for an anticipated builtin. */
2574
2575static bool
2576anticipated_builtin_p (tree ovl)
2577{
2578 return (TREE_CODE (ovl)((enum tree_code) (ovl)->base.code) == OVERLOAD
2579 && OVL_HIDDEN_P (ovl)((tree_not_check2 (((tree_check ((ovl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2579, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2579, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
2580 && DECL_IS_UNDECLARED_BUILTIN (OVL_FUNCTION (ovl))(((contains_struct_check (((((struct tree_overload*)(tree_check
((ovl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2580, __FUNCTION__, (OVERLOAD))))->function)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2580, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
);
2581}
2582
2583/* BINDING records an existing declaration for a name in the current scope.
2584 But, DECL is another declaration for that same identifier in the
2585 same scope. This is the `struct stat' hack whereby a non-typedef
2586 class name or enum-name can be bound at the same level as some other
2587 kind of entity.
2588 3.3.7/1
2589
2590 A class name (9.1) or enumeration name (7.2) can be hidden by the
2591 name of an object, function, or enumerator declared in the same scope.
2592 If a class or enumeration name and an object, function, or enumerator
2593 are declared in the same scope (in any order) with the same name, the
2594 class or enumeration name is hidden wherever the object, function, or
2595 enumerator name is visible.
2596
2597 It's the responsibility of the caller to check that
2598 inserting this name is valid here. Returns nonzero if the new binding
2599 was successful. */
2600
2601static bool
2602supplement_binding_1 (cxx_binding *binding, tree decl)
2603{
2604 tree bval = binding->value;
2605 bool ok = true;
2606 tree target_bval = strip_using_decl (bval);
2607 tree target_decl = strip_using_decl (decl);
2608
2609 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2609, __FUNCTION__))->decl_common.artificial_flag)
2610 && target_decl != target_bval
2611 && (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) != TYPE_DECL
2612 /* We allow pushing an enum multiple times in a class
2613 template in order to handle late matching of underlying
2614 type on an opaque-enum-declaration followed by an
2615 enum-specifier. */
2616 || (processing_template_declscope_chain->x_processing_template_decl
2617 && TREE_CODE (TREE_TYPE (target_decl))((enum tree_code) (((contains_struct_check ((target_decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2617, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
2618 && TREE_CODE (TREE_TYPE (target_bval))((enum tree_code) (((contains_struct_check ((target_bval), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2618, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
2619 && (dependent_type_p (ENUM_UNDERLYING_TYPE((contains_struct_check (((tree_check ((((contains_struct_check
((target_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2620, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2620, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2620, __FUNCTION__))->typed.type)
2620 (TREE_TYPE (target_decl))((contains_struct_check (((tree_check ((((contains_struct_check
((target_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2620, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2620, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2620, __FUNCTION__))->typed.type)
)
2621 || dependent_type_p (ENUM_UNDERLYING_TYPE((contains_struct_check (((tree_check ((((contains_struct_check
((target_bval), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2622, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2622, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2622, __FUNCTION__))->typed.type)
2622 (TREE_TYPE (target_bval))((contains_struct_check (((tree_check ((((contains_struct_check
((target_bval), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2622, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2622, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2622, __FUNCTION__))->typed.type)
)))))
2623 /* The new name is the type name. */
2624 binding->type = decl;
2625 else if (/* TARGET_BVAL is null when push_class_level_binding moves
2626 an inherited type-binding out of the way to make room
2627 for a new value binding. */
2628 !target_bval
2629 /* TARGET_BVAL is error_mark_node when TARGET_DECL's name
2630 has been used in a non-class scope prior declaration.
2631 In that case, we should have already issued a
2632 diagnostic; for graceful error recovery purpose, pretend
2633 this was the intended declaration for that name. */
2634 || target_bval == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2635 /* If TARGET_BVAL is anticipated but has not yet been
2636 declared, pretend it is not there at all. */
2637 || anticipated_builtin_p (target_bval))
2638 binding->value = decl;
2639 else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL
2640 && DECL_ARTIFICIAL (target_bval)((contains_struct_check ((target_bval), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2640, __FUNCTION__))->decl_common.artificial_flag)
2641 && target_decl != target_bval
2642 && (TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) != TYPE_DECL
2643 || same_type_p (TREE_TYPE (target_decl),comptypes ((((contains_struct_check ((target_decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2643, __FUNCTION__))->typed.type)), (((contains_struct_check
((target_bval), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2644, __FUNCTION__))->typed.type)), 0)
2644 TREE_TYPE (target_bval))comptypes ((((contains_struct_check ((target_decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2643, __FUNCTION__))->typed.type)), (((contains_struct_check
((target_bval), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2644, __FUNCTION__))->typed.type)), 0)
))
2645 {
2646 /* The old binding was a type name. It was placed in
2647 VALUE field because it was thought, at the point it was
2648 declared, to be the only entity with such a name. Move the
2649 type name into the type slot; it is now hidden by the new
2650 binding. */
2651 binding->type = bval;
2652 binding->value = decl;
2653 binding->value_is_inherited = false;
2654 }
2655 else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL
2656 && TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) == TYPE_DECL
2657 && DECL_NAME (target_decl)((contains_struct_check ((target_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2657, __FUNCTION__))->decl_minimal.name)
== DECL_NAME (target_bval)((contains_struct_check ((target_bval), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2657, __FUNCTION__))->decl_minimal.name)
2658 && binding->scope->kind != sk_class
2659 && (same_type_p (TREE_TYPE (target_decl), TREE_TYPE (target_bval))comptypes ((((contains_struct_check ((target_decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2659, __FUNCTION__))->typed.type)), (((contains_struct_check
((target_bval), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2659, __FUNCTION__))->typed.type)), 0)
2660 /* If either type involves template parameters, we must
2661 wait until instantiation. */
2662 || uses_template_parms (TREE_TYPE (target_decl)((contains_struct_check ((target_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2662, __FUNCTION__))->typed.type)
)
2663 || uses_template_parms (TREE_TYPE (target_bval)((contains_struct_check ((target_bval), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2663, __FUNCTION__))->typed.type)
)))
2664 /* We have two typedef-names, both naming the same type to have
2665 the same name. In general, this is OK because of:
2666
2667 [dcl.typedef]
2668
2669 In a given scope, a typedef specifier can be used to redefine
2670 the name of any type declared in that scope to refer to the
2671 type to which it already refers.
2672
2673 However, in class scopes, this rule does not apply due to the
2674 stricter language in [class.mem] prohibiting redeclarations of
2675 members. */
2676 ok = false;
2677 /* There can be two block-scope declarations of the same variable,
2678 so long as they are `extern' declarations. However, there cannot
2679 be two declarations of the same static data member:
2680
2681 [class.mem]
2682
2683 A member shall not be declared twice in the
2684 member-specification. */
2685 else if (VAR_P (target_decl)(((enum tree_code) (target_decl)->base.code) == VAR_DECL)
2686 && VAR_P (target_bval)(((enum tree_code) (target_bval)->base.code) == VAR_DECL)
2687 && DECL_EXTERNAL (target_decl)((contains_struct_check ((target_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2687, __FUNCTION__))->decl_common.decl_flag_1)
&& DECL_EXTERNAL (target_bval)((contains_struct_check ((target_bval), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2687, __FUNCTION__))->decl_common.decl_flag_1)
2688 && !DECL_CLASS_SCOPE_P (target_decl)(((contains_struct_check ((target_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2688, __FUNCTION__))->decl_minimal.context) && (
tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((target_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2688, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
2689 {
2690 duplicate_decls (decl, binding->value);
2691 ok = false;
2692 }
2693 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
2694 && TREE_CODE (bval)((enum tree_code) (bval)->base.code) == NAMESPACE_DECL
2695 && DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2695, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2695, __FUNCTION__))->decl_common.abstract_origin)
2696 && DECL_NAMESPACE_ALIAS (bval)((contains_struct_check (((tree_check ((bval), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2696, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2696, __FUNCTION__))->decl_common.abstract_origin)
2697 && ORIGINAL_NAMESPACE (bval)(((contains_struct_check (((tree_check ((bval), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((bval), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__))->decl_common.abstract_origin) : (bval
))
== ORIGINAL_NAMESPACE (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2697, __FUNCTION__))->decl_common.abstract_origin) : (decl
))
)
2698 /* [namespace.alias]
2699
2700 In a declarative region, a namespace-alias-definition can be
2701 used to redefine a namespace-alias declared in that declarative
2702 region to refer only to the namespace to which it already
2703 refers. */
2704 ok = false;
2705 else if (TREE_CODE (bval)((enum tree_code) (bval)->base.code) == USING_DECL
2706 && CONST_DECL_USING_P (decl)(((enum tree_code) (decl)->base.code) == CONST_DECL &&
((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2706, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
&& ((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2706, __FUNCTION__))->decl_minimal.context) != ((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2706, __FUNCTION__))->typed.type))
)
2707 /* Let the clone hide the using-decl that introduced it. */
2708 binding->value = decl;
2709 else
2710 {
2711 if (!error_operand_p (bval)((bval) == global_trees[TI_ERROR_MARK] || ((bval) && (
(contains_struct_check (((bval)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2711, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK
]))
)
2712 diagnose_name_conflict (decl, bval);
2713 ok = false;
2714 }
2715
2716 return ok;
2717}
2718
2719/* Diagnose a name conflict between DECL and BVAL. */
2720
2721static void
2722diagnose_name_conflict (tree decl, tree bval)
2723{
2724 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_CODE (bval)((enum tree_code) (bval)->base.code)
2725 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != NAMESPACE_DECL
2726 && !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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2726, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2726, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
2727 && (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL
2728 || DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2728, __FUNCTION__))->decl_common.artificial_flag)
== DECL_ARTIFICIAL (bval)((contains_struct_check ((bval), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2728, __FUNCTION__))->decl_common.artificial_flag)
)
2729 && CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2729, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2729, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2729, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
== CP_DECL_CONTEXT (bval)(!(! (((contains_struct_check ((bval), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2729, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((bval), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2729, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((bval)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2729, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
)
2730 {
2731 if (concept_definition_p (decl))
2732 error ("redeclaration of %q#D with different template parameters",
2733 decl);
2734 else
2735 error ("redeclaration of %q#D", decl);
2736 }
2737 else
2738 error ("%q#D conflicts with a previous declaration", decl);
2739
2740 inform (location_of (bval), "previous declaration %q#D", bval);
2741}
2742
2743/* Wrapper for supplement_binding_1. */
2744
2745static bool
2746supplement_binding (cxx_binding *binding, tree decl)
2747{
2748 bool ret;
2749 bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
2750 ret = supplement_binding_1 (binding, decl);
2751 timevar_cond_stop (TV_NAME_LOOKUP, subtime);
2752 return ret;
2753}
2754
2755/* Replace BINDING's current value on its scope's name list with
2756 NEWVAL. */
2757
2758static void
2759update_local_overload (cxx_binding *binding, tree newval)
2760{
2761 tree *d;
2762
2763 for (d = &binding->scope->names; ; d = &TREE_CHAIN (*d)((contains_struct_check ((*d), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2763, __FUNCTION__))->common.chain)
)
2764 if (*d == binding->value)
2765 {
2766 /* Stitch new list node in. */
2767 *d = tree_cons (DECL_NAME (*d)((contains_struct_check ((*d), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2767, __FUNCTION__))->decl_minimal.name)
, NULL_TREE(tree) nullptr, TREE_CHAIN (*d)((contains_struct_check ((*d), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2767, __FUNCTION__))->common.chain)
);
2768 break;
2769 }
2770 else if (TREE_CODE (*d)((enum tree_code) (*d)->base.code) == TREE_LIST && TREE_VALUE (*d)((tree_check ((*d), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2770, __FUNCTION__, (TREE_LIST)))->list.value)
== binding->value)
2771 break;
2772
2773 TREE_VALUE (*d)((tree_check ((*d), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2773, __FUNCTION__, (TREE_LIST)))->list.value)
= newval;
2774}
2775
2776/* Compares the parameter-type-lists of ONE and TWO and
2777 returns false if they are different. If the DECLs are template
2778 functions, the return types and the template parameter lists are
2779 compared too (DR 565). */
2780
2781static bool
2782matching_fn_p (tree one, tree two)
2783{
2784 if (TREE_CODE (one)((enum tree_code) (one)->base.code) != TREE_CODE (two)((enum tree_code) (two)->base.code))
2785 return false;
2786
2787 if (!compparms (TYPE_ARG_TYPES (TREE_TYPE (one))((tree_check2 ((((contains_struct_check ((one), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2787, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2787, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
,
2788 TYPE_ARG_TYPES (TREE_TYPE (two))((tree_check2 ((((contains_struct_check ((two), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2788, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2788, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
))
2789 return false;
2790
2791 if (TREE_CODE (one)((enum tree_code) (one)->base.code) == TEMPLATE_DECL)
2792 {
2793 /* Compare template parms. */
2794 if (!comp_template_parms (DECL_TEMPLATE_PARMS (one)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((one), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2794, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
2795 DECL_TEMPLATE_PARMS (two)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((two), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2795, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
))
2796 return false;
2797
2798 /* And return type. */
2799 if (!same_type_p (TREE_TYPE (TREE_TYPE (one)),comptypes ((((contains_struct_check ((((contains_struct_check
((one), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2799, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2799, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((two), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2800, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2800, __FUNCTION__))->typed.type)), 0)
2800 TREE_TYPE (TREE_TYPE (two)))comptypes ((((contains_struct_check ((((contains_struct_check
((one), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2799, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2799, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((two), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2800, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2800, __FUNCTION__))->typed.type)), 0)
)
2801 return false;
2802 }
2803
2804 if (!equivalently_constrained (one, two))
2805 return false;
2806
2807 return true;
2808}
2809
2810/* Push DECL into nonclass LEVEL BINDING or SLOT. OLD is the current
2811 binding value (possibly with anticipated builtins stripped).
2812 Diagnose conflicts and return updated decl. */
2813
2814static tree
2815update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
2816 tree old, tree decl, bool hiding = false)
2817{
2818 tree old_type = NULL_TREE(tree) nullptr;
2819 bool hide_type = false;
2820 bool hide_value = false;
2821
2822 if (!slot)
2823 {
2824 old_type = binding->type;
2825 hide_type = HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden);
2826 if (!old_type)
2827 hide_value = hide_type, hide_type = false;
2828 }
2829 else if (STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2829, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2829, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
2830 {
2831 old_type = STAT_TYPE (*slot)((contains_struct_check ((*slot), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2831, __FUNCTION__))->typed.type)
;
2832 hide_type = STAT_TYPE_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2832, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2832, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
;
2833 hide_value = STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2833, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2833, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
2834 }
2835
2836 tree to_val = decl;
2837 tree to_type = old_type;
2838 bool local_overload = false;
2839
2840 gcc_assert (!level || level->kind == sk_namespace ? !binding((void)(!(!level || level->kind == sk_namespace ? !binding
: level->kind != sk_class && !slot) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2841, __FUNCTION__), 0 : 0))
2841 : level->kind != sk_class && !slot)((void)(!(!level || level->kind == sk_namespace ? !binding
: level->kind != sk_class && !slot) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2841, __FUNCTION__), 0 : 0))
;
2842
2843 if (old == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2844 old = NULL_TREE(tree) nullptr;
2845
2846 if (DECL_IMPLICIT_TYPEDEF_P (decl)(((enum tree_code) (decl)->base.code) == TYPE_DECL &&
((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2846, __FUNCTION__))->decl_common.lang_flag_2))
)
2847 {
2848 /* Pushing an artificial decl. We should not find another
2849 artificial decl here already -- lookup_elaborated_type will
2850 have already found it. */
2851 gcc_checking_assert (!to_type((void)(!(!to_type && !(old && (((enum tree_code
) (old)->base.code) == TYPE_DECL && ((contains_struct_check
((old), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2852, __FUNCTION__))->decl_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2852, __FUNCTION__), 0 : 0))
2852 && !(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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2852, __FUNCTION__))->decl_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2852, __FUNCTION__), 0 : 0))
;
2853
2854 if (old)
2855 {
2856 /* Put DECL into the type slot. */
2857 gcc_checking_assert (!to_type)((void)(!(!to_type) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2857, __FUNCTION__), 0 : 0))
;
2858 hide_type = hiding;
2859 to_type = decl;
2860 to_val = old;
2861 }
2862 else
2863 hide_value = hiding;
2864
2865 goto done;
2866 }
2867
2868 if (old && DECL_IMPLICIT_TYPEDEF_P (old)(((enum tree_code) (old)->base.code) == TYPE_DECL &&
((contains_struct_check ((old), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2868, __FUNCTION__))->decl_common.lang_flag_2))
)
2869 {
2870 /* OLD is an implicit typedef. Move it to to_type. */
2871 gcc_checking_assert (!to_type)((void)(!(!to_type) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2871, __FUNCTION__), 0 : 0))
;
2872
2873 to_type = old;
2874 hide_type = hide_value;
2875 old = NULL_TREE(tree) nullptr;
2876 hide_value = false;
2877 }
2878
2879 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2879, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2879, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2880 {
2881 if (!old)
2882 ;
2883 else if (OVL_P (old)(((enum tree_code) (old)->base.code) == FUNCTION_DECL || (
(enum tree_code) (old)->base.code) == OVERLOAD)
)
2884 {
2885 for (ovl_iterator iter (old); iter; ++iter)
2886 {
2887 tree fn = *iter;
2888
2889 if (iter.using_p () && matching_fn_p (fn, decl))
2890 {
2891 gcc_checking_assert (!iter.hidden_p ())((void)(!(!iter.hidden_p ()) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2891, __FUNCTION__), 0 : 0))
;
2892 /* If a function declaration in namespace scope or
2893 block scope has the same name and the same
2894 parameter-type- list (8.3.5) as a function
2895 introduced by a using-declaration, and the
2896 declarations do not declare the same function,
2897 the program is ill-formed. [namespace.udecl]/14 */
2898 if (tree match = duplicate_decls (decl, fn, hiding))
2899 return match;
2900 else
2901 /* FIXME: To preserve existing error behavior, we
2902 still push the decl. This might change. */
2903 diagnose_name_conflict (decl, fn);
2904 }
2905 }
2906 }
2907 else
2908 goto conflict;
2909
2910 if (to_type != old_type
2911 && warn_shadowglobal_options.x_warn_shadow
2912 && MAYBE_CLASS_TYPE_P (TREE_TYPE (to_type))((((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type))->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type))->base.code) == TYPENAME_TYPE
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type))->base.code) == TYPEOF_TYPE
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (((contains_struct_check ((to_type), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type))->base.code) == DECLTYPE_TYPE
) || (((((enum tree_code) (((contains_struct_check ((to_type)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((to_type), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((to_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2912, __FUNCTION__))->type_common.lang_flag_5)))
2913 && !(DECL_IN_SYSTEM_HEADER (decl)(in_system_header_at (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2913, __FUNCTION__))->decl_minimal.locus)))
2914 && DECL_IN_SYSTEM_HEADER (to_type)(in_system_header_at (((contains_struct_check ((to_type), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2914, __FUNCTION__))->decl_minimal.locus)))
))
2915 warning (OPT_Wshadow, "%q#D hides constructor for %q#D",
2916 decl, to_type);
2917
2918 local_overload = old && level && level->kind != sk_namespace;
2919 to_val = ovl_insert (decl, old, -int (hiding));
2920 }
2921 else if (old)
2922 {
2923 if (TREE_CODE (old)((enum tree_code) (old)->base.code) != TREE_CODE (decl)((enum tree_code) (decl)->base.code))
2924 /* Different kinds of decls conflict. */
2925 goto conflict;
2926 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL)
2927 {
2928 if (same_type_p (TREE_TYPE (old), TREE_TYPE (decl))comptypes ((((contains_struct_check ((old), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2928, __FUNCTION__))->typed.type)), (((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2928, __FUNCTION__))->typed.type)), 0)
)
2929 /* Two type decls to the same type. Do nothing. */
2930 return old;
2931 else
2932 goto conflict;
2933 }
2934 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == NAMESPACE_DECL)
2935 {
2936 /* Two maybe-aliased namespaces. If they're to the same target
2937 namespace, that's ok. */
2938 if (ORIGINAL_NAMESPACE (old)(((contains_struct_check (((tree_check ((old), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((old), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__))->decl_common.abstract_origin) : (old
))
!= ORIGINAL_NAMESPACE (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check
(((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__))->decl_common.abstract_origin) : (decl
))
)
2939 goto conflict;
2940
2941 /* The new one must be an alias at this point. */
2942 gcc_assert (DECL_NAMESPACE_ALIAS (decl))((void)(!(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2942, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2942, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2942, __FUNCTION__), 0 : 0))
;
2943 return old;
2944 }
2945 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == VAR_DECL)
2946 {
2947 /* There can be two block-scope declarations of the same
2948 variable, so long as they are `extern' declarations. */
2949 if (!DECL_EXTERNAL (old)((contains_struct_check ((old), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2949, __FUNCTION__))->decl_common.decl_flag_1)
|| !DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2949, __FUNCTION__))->decl_common.decl_flag_1)
)
2950 goto conflict;
2951 else if (tree match = duplicate_decls (decl, old))
2952 {
2953 gcc_checking_assert (!hide_value && !hiding)((void)(!(!hide_value && !hiding) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2953, __FUNCTION__), 0 : 0))
;
2954 return match;
2955 }
2956 else
2957 goto conflict;
2958 }
2959 else
2960 {
2961 conflict:
2962 diagnose_name_conflict (decl, old);
2963 to_val = NULL_TREE(tree) nullptr;
2964 }
2965 }
2966 else if (hiding)
2967 hide_value = true;
2968
2969 done:
2970 if (to_val)
2971 {
2972 if (local_overload)
2973 {
2974 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
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2974, __FUNCTION__), 0 : 0))
;
2975 update_local_overload (binding, to_val);
2976 }
2977 else if (level
2978 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
2979 && !DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2979, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2979, __FUNCTION__))->decl_common.abstract_origin)
))
2980 /* Don't add namespaces here. They're done in
2981 push_namespace. */
2982 add_decl_to_level (level, decl);
2983
2984 if (slot)
2985 {
2986 if (STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2986, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2986, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
2987 {
2988 STAT_TYPE (*slot)((contains_struct_check ((*slot), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2988, __FUNCTION__))->typed.type)
= to_type;
2989 STAT_DECL (*slot)(((struct tree_overload*)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2989, __FUNCTION__, (OVERLOAD))))->function)
= to_val;
2990 STAT_TYPE_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2990, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2990, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
= hide_type;
2991 STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2991, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2991, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= hide_value;
2992 }
2993 else if (to_type || hide_value)
2994 {
2995 *slot = stat_hack (to_val, to_type);
2996 STAT_TYPE_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2996, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2996, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
= hide_type;
2997 STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2997, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2997, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= hide_value;
2998 }
2999 else
3000 {
3001 gcc_checking_assert (!hide_type)((void)(!(!hide_type) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3001, __FUNCTION__), 0 : 0))
;
3002 *slot = to_val;
3003 }
3004 }
3005 else
3006 {
3007 binding->type = to_type;
3008 binding->value = to_val;
3009 HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden) = hide_type || hide_value;
3010 }
3011 }
3012
3013 return decl;
3014}
3015
3016/* Table of identifiers to extern C declarations (or LISTS thereof). */
3017
3018static GTY(()) hash_table<named_decl_hash> *extern_c_decls;
3019
3020/* DECL has C linkage. If we have an existing instance, make sure the
3021 new one is compatible. Make sure it has the same exception
3022 specification [7.5, 7.6]. Add DECL to the map. */
3023
3024static void
3025check_extern_c_conflict (tree decl)
3026{
3027 /* Ignore artificial or system header decls. */
3028 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3028, __FUNCTION__))->decl_common.artificial_flag)
|| DECL_IN_SYSTEM_HEADER (decl)(in_system_header_at (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3028, __FUNCTION__))->decl_minimal.locus)))
)
3029 return;
3030
3031 /* This only applies to decls at namespace scope. */
3032 if (!DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3032, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3032, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3032, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3032, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
3033 return;
3034
3035 if (!extern_c_decls)
3036 extern_c_decls = hash_table<named_decl_hash>::create_ggc (127);
3037
3038 tree *slot = extern_c_decls
3039 ->find_slot_with_hash (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3039, __FUNCTION__))->decl_minimal.name)
,
3040 IDENTIFIER_HASH_VALUE (DECL_NAME (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3040, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3040, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
, INSERT);
3041 if (tree old = *slot)
3042 {
3043 if (TREE_CODE (old)((enum tree_code) (old)->base.code) == OVERLOAD)
3044 old = OVL_FUNCTION (old)(((struct tree_overload*)(tree_check ((old), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3044, __FUNCTION__, (OVERLOAD))))->function)
;
3045
3046 int mismatch = 0;
3047 if (DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3047, __FUNCTION__))->decl_minimal.context)
== DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3047, __FUNCTION__))->decl_minimal.context)
)
3048 ; /* If they're in the same context, we'll have already complained
3049 about a (possible) mismatch, when inserting the decl. */
3050 else if (!decls_match (decl, old))
3051 mismatch = 1;
3052 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3053 && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (old))((tree_class_check (((tree_check2 ((((contains_struct_check (
(old), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3053, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3053, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3053, __FUNCTION__))->type_non_common.lang_1)
,
3054 TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl))((tree_class_check (((tree_check2 ((((contains_struct_check (
(decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3054, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3054, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3054, __FUNCTION__))->type_non_common.lang_1)
,
3055 ce_normal))
3056 mismatch = -1;
3057 else if (DECL_ASSEMBLER_NAME_SET_P (old)(((contains_struct_check ((old), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3057, __FUNCTION__))->decl_with_vis.assembler_name) != (
tree) nullptr)
)
3058 SET_DECL_ASSEMBLER_NAME (decl, DECL_ASSEMBLER_NAME (old))overwrite_decl_assembler_name (decl, decl_assembler_name (old
))
;
3059
3060 if (mismatch)
3061 {
3062 auto_diagnostic_group d;
3063 pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3063, __FUNCTION__))->decl_minimal.locus)
, 0,
3064 "conflicting C language linkage declaration %q#D", decl);
3065 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3065, __FUNCTION__))->decl_minimal.locus)
,
3066 "previous declaration %q#D", old);
3067 if (mismatch < 0)
3068 inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3068, __FUNCTION__))->decl_minimal.locus)
,
3069 "due to different exception specifications");
3070 }
3071 else
3072 {
3073 if (old == *slot)
3074 /* The hash table expects OVERLOADS, so construct one with
3075 OLD as both the function and the chain. This allocate
3076 an excess OVERLOAD node, but it's rare to have multiple
3077 extern "C" decls of the same name. And we save
3078 complicating the hash table logic (which is used
3079 elsewhere). */
3080 *slot = ovl_make (old, old);
3081
3082 slot = &OVL_CHAIN (*slot)(((struct tree_overload*)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3082, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3083
3084 /* Chain it on for c_linkage_binding's use. */
3085 *slot = tree_cons (NULL_TREE(tree) nullptr, decl, *slot);
3086 }
3087 }
3088 else
3089 *slot = decl;
3090}
3091
3092/* Returns a list of C-linkage decls with the name NAME. Used in
3093 c-family/c-pragma.c to implement redefine_extname pragma. */
3094
3095tree
3096c_linkage_bindings (tree name)
3097{
3098 if (extern_c_decls)
3099 if (tree *slot = extern_c_decls
3100 ->find_slot_with_hash (name, IDENTIFIER_HASH_VALUE (name)((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3100, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
, NO_INSERT))
3101 {
3102 tree result = *slot;
3103 if (TREE_CODE (result)((enum tree_code) (result)->base.code) == OVERLOAD)
3104 result = OVL_CHAIN (result)(((struct tree_overload*)(tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3104, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3105 return result;
3106 }
3107
3108 return NULL_TREE(tree) nullptr;
3109}
3110
3111/* Subroutine of check_local_shadow. */
3112
3113static void
3114inform_shadowed (tree shadowed)
3115{
3116 inform (DECL_SOURCE_LOCATION (shadowed)((contains_struct_check ((shadowed), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3116, __FUNCTION__))->decl_minimal.locus)
,
3117 "shadowed declaration is here");
3118}
3119
3120/* DECL is being declared at a local scope. Emit suitable shadow
3121 warnings. */
3122
3123static void
3124check_local_shadow (tree decl)
3125{
3126 /* Don't complain about the parms we push and then pop
3127 while tentatively parsing a function declarator. */
3128 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL && !DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3128, __FUNCTION__))->decl_minimal.context)
)
3129 return;
3130
3131 /* External decls are something else. */
3132 if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3132, __FUNCTION__))->decl_common.decl_flag_1)
)
3133 return;
3134
3135 tree old = NULL_TREE(tree) nullptr;
3136 cp_binding_level *old_scope = NULLnullptr;
3137 if (cxx_binding *binding = outer_binding (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3137, __FUNCTION__))->decl_minimal.name)
, NULLnullptr, true))
3138 {
3139 old = binding->value;
3140 old_scope = binding->scope;
3141 }
3142
3143 if (old
3144 && (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3145 || VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3146 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3147 && (!DECL_ARTIFICIAL (old)((contains_struct_check ((old), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3147, __FUNCTION__))->decl_common.artificial_flag)
3148 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)))
3149 && DECL_FUNCTION_SCOPE_P (old)(((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3149, __FUNCTION__))->decl_minimal.context) && (
(enum tree_code) (((contains_struct_check ((old), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3149, __FUNCTION__))->decl_minimal.context))->base.code
) == FUNCTION_DECL)
3150 && (!DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3150, __FUNCTION__))->decl_common.artificial_flag)
3151 || is_capture_proxy (decl)
3152 || DECL_IMPLICIT_TYPEDEF_P (decl)(((enum tree_code) (decl)->base.code) == TYPE_DECL &&
((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3152, __FUNCTION__))->decl_common.lang_flag_2))
3153 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_ANON_UNION_VAR_P (decl)(((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3153, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3153, __FUNCTION__))->decl_common.lang_flag_4))
)))
3154 {
3155 /* DECL shadows a local thing possibly of interest. */
3156
3157 /* DR 2211: check that captures and parameters
3158 do not have the same name. */
3159 if (is_capture_proxy (decl))
3160 {
3161 if (current_lambda_expr ()
3162 && DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3162, __FUNCTION__))->decl_minimal.context)
== lambda_function (current_lambda_expr ())
3163 && TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3164 && DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3164, __FUNCTION__))->decl_minimal.name)
!= this_identifiercp_global_trees[CPTI_THIS_IDENTIFIER])
3165 {
3166 error_at (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3166, __FUNCTION__))->decl_minimal.locus)
,
3167 "lambda parameter %qD "
3168 "previously declared as a capture", old);
3169 }
3170 return;
3171 }
3172 /* Don't complain if it's from an enclosing function. */
3173 else if (DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3173, __FUNCTION__))->decl_minimal.context)
== current_function_decl
3174 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
3175 && TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL)
3176 {
3177 /* Go to where the parms should be and see if we find
3178 them there. */
3179 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;
3180
3181 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) && (((tree_not_check2 (
((tree_check ((((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__); &lt->u.fn; })->ovl_op_code) ==
OVL_OP_CALL_EXPR) && (((enum tree_code) ((!(! (((contains_struct_check
((current_function_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check
(((!(! (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check
((current_function_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check
(((!(! (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((current_function_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3181, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))))
)
3182 /* Skip the ctor/dtor cleanup level. */
3183 b = b->level_chain;
3184
3185 /* [basic.scope.param] A parameter name shall not be redeclared
3186 in the outermost block of the function definition. */
3187 if (b->kind == sk_function_parms)
3188 {
3189 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3189, __FUNCTION__))->decl_minimal.locus)
,
3190 "declaration of %q#D shadows a parameter", decl);
3191 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3191, __FUNCTION__))->decl_minimal.locus)
,
3192 "%q#D previously declared here", old);
3193 return;
3194 }
3195 }
3196
3197 /* The local structure or class can't use parameters of
3198 the containing function anyway. */
3199 if (DECL_CONTEXT (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3199, __FUNCTION__))->decl_minimal.context)
!= current_function_decl)
3200 {
3201 for (cp_binding_level *scope = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
3202 scope != old_scope; scope = scope->level_chain)
3203 if (scope->kind == sk_class
3204 && !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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check
((scope->this_entity), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check ((scope->this_entity
), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check
((scope->this_entity), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((scope->this_entity), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3204, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))
)
3205 return;
3206 }
3207 /* Error if redeclaring a local declared in a
3208 init-statement or in the condition of an if or
3209 switch statement when the new declaration is in the
3210 outermost block of the controlled statement.
3211 Redeclaring a variable from a for or while condition is
3212 detected elsewhere. */
3213 else if (VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3214 && old_scope == current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain
3215 && (old_scope->kind == sk_cond || old_scope->kind == sk_for))
3216 {
3217 auto_diagnostic_group d;
3218 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3218, __FUNCTION__))->decl_minimal.locus)
,
3219 "redeclaration of %q#D", decl);
3220 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3220, __FUNCTION__))->decl_minimal.locus)
,
3221 "%q#D previously declared here", old);
3222 return;
3223 }
3224 /* C++11:
3225 3.3.3/3: The name declared in an exception-declaration (...)
3226 shall not be redeclared in the outermost block of the handler.
3227 3.3.3/2: A parameter name shall not be redeclared (...) in
3228 the outermost block of any handler associated with a
3229 function-try-block.
3230 3.4.1/15: The function parameter names shall not be redeclared
3231 in the exception-declaration nor in the outermost block of a
3232 handler for the function-try-block. */
3233 else if ((TREE_CODE (old)((enum tree_code) (old)->base.code) == VAR_DECL
3234 && old_scope == current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain
3235 && old_scope->kind == sk_catch)
3236 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3237 && (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_catch
3238 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain->kind == sk_catch)
3239 && in_function_try_handler((cfun + 0)->language)->x_in_function_try_handler))
3240 {
3241 auto_diagnostic_group d;
3242 if (permerror (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3242, __FUNCTION__))->decl_minimal.locus)
,
3243 "redeclaration of %q#D", decl))
3244 inform (DECL_SOURCE_LOCATION (old)((contains_struct_check ((old), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3244, __FUNCTION__))->decl_minimal.locus)
,
3245 "%q#D previously declared here", old);
3246 return;
3247 }
3248
3249 /* If '-Wshadow=compatible-local' is specified without other
3250 -Wshadow= flags, we will warn only when the type of the
3251 shadowing variable (DECL) can be converted to that of the
3252 shadowed parameter (OLD_LOCAL). The reason why we only check
3253 if DECL's type can be converted to OLD_LOCAL's type (but not the
3254 other way around) is because when users accidentally shadow a
3255 parameter, more than often they would use the variable
3256 thinking (mistakenly) it's still the parameter. It would be
3257 rare that users would use the variable in the place that
3258 expects the parameter but thinking it's a new decl.
3259 If either object is a TYPE_DECL, '-Wshadow=compatible-local'
3260 warns regardless of whether one of the types involved
3261 is a subclass of the other, since that is never okay. */
3262
3263 enum opt_code warning_code;
3264 if (warn_shadowglobal_options.x_warn_shadow)
3265 warning_code = OPT_Wshadow;
3266 else if ((TREE_TYPE (old)((contains_struct_check ((old), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3266, __FUNCTION__))->typed.type)
3267 && TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3267, __FUNCTION__))->typed.type)
3268 && same_type_p (TREE_TYPE (old), TREE_TYPE (decl))comptypes ((((contains_struct_check ((old), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3268, __FUNCTION__))->typed.type)), (((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3268, __FUNCTION__))->typed.type)), 0)
)
3269 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
3270 || TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3271 || (!dependent_type_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3271, __FUNCTION__))->typed.type)
)
3272 && !dependent_type_p (TREE_TYPE (old)((contains_struct_check ((old), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3272, __FUNCTION__))->typed.type)
)
3273 /* If the new decl uses auto, we don't yet know
3274 its type (the old type cannot be using auto
3275 at this point, without also being
3276 dependent). This is an indication we're
3277 (now) doing the shadow checking too
3278 early. */
3279 && !type_uses_auto (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3279, __FUNCTION__))->typed.type)
)
3280 && can_convert_arg (TREE_TYPE (old)((contains_struct_check ((old), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3280, __FUNCTION__))->typed.type)
, TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3280, __FUNCTION__))->typed.type)
,
3281 decl, LOOKUP_IMPLICIT(((1 << 0)) | (1 << 2)), tf_none)))
3282 warning_code = OPT_Wshadow_compatible_local;
3283 else
3284 warning_code = OPT_Wshadow_local;
3285
3286 const char *msg;
3287 if (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL)
3288 msg = "declaration of %q#D shadows a parameter";
3289 else if (is_capture_proxy (old))
3290 msg = "declaration of %qD shadows a lambda capture";
3291 else
3292 msg = "declaration of %qD shadows a previous local";
3293
3294 auto_diagnostic_group d;
3295 if (warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3295, __FUNCTION__))->decl_minimal.locus)
, warning_code, msg, decl))
3296 inform_shadowed (old);
3297 return;
3298 }
3299
3300 if (!warn_shadowglobal_options.x_warn_shadow)
3301 return;
3302
3303 /* Don't warn for artificial things that are not implicit typedefs. */
3304 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3304, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3304, __FUNCTION__))->decl_common.lang_flag_2))
)
3305 return;
3306
3307 if (nonlambda_method_basetype ())
3308 if (tree member = lookup_member (current_nonlambda_class_type (),
3309 DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3309, __FUNCTION__))->decl_minimal.name)
, /*protect=*/0,
3310 /*want_type=*/false, tf_warning_or_error))
3311 {
3312 member = MAYBE_BASELINK_FUNCTIONS (member)((((enum tree_code) (member)->base.code) == BASELINK) ? ((
(struct tree_baselink*) (tree_check ((member), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3312, __FUNCTION__, (BASELINK))))->functions) : member)
;
3313
3314 /* Warn if a variable shadows a non-function, or the variable
3315 is a function or a pointer-to-function. */
3316 if (!OVL_P (member)(((enum tree_code) (member)->base.code) == FUNCTION_DECL ||
((enum tree_code) (member)->base.code) == OVERLOAD)
3317 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3318 || TYPE_PTRFN_P (TREE_TYPE (decl))((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3318, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
) && ((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3318, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3318, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
)
3319 || TYPE_PTRMEMFUNC_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3319, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
&& (((tree_class_check (((tree_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3319, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3319, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3319, __FUNCTION__))->type_common.lang_flag_2)))
)
3320 {
3321 auto_diagnostic_group d;
3322 if (warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3322, __FUNCTION__))->decl_minimal.locus)
, OPT_Wshadow,
3323 "declaration of %qD shadows a member of %qT",
3324 decl, current_nonlambda_class_type ())
3325 && DECL_P (member)(tree_code_type[(int) (((enum tree_code) (member)->base.code
))] == tcc_declaration)
)
3326 inform_shadowed (member);
3327 }
3328 return;
3329 }
3330
3331 /* Now look for a namespace shadow. */
3332 old = find_namespace_value (current_namespacescope_chain->old_namespace, DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3332, __FUNCTION__))->decl_minimal.name)
);
3333 if (old
3334 && (VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3335 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3336 && (!DECL_ARTIFICIAL (old)((contains_struct_check ((old), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3336, __FUNCTION__))->decl_common.artificial_flag)
3337 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)))
3338 && !instantiating_current_function_p ())
3339 /* XXX shadow warnings in outer-more namespaces */
3340 {
3341 auto_diagnostic_group d;
3342 if (warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3342, __FUNCTION__))->decl_minimal.locus)
, OPT_Wshadow,
3343 "declaration of %qD shadows a global declaration",
3344 decl))
3345 inform_shadowed (old);
3346 return;
3347 }
3348
3349 return;
3350}
3351
3352/* DECL is being pushed inside function CTX. Set its context, if
3353 needed. */
3354
3355static void
3356set_decl_context_in_fn (tree ctx, tree decl)
3357{
3358 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3359 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3359, __FUNCTION__))->decl_common.decl_flag_1)
))
3360 /* Make sure local externs are marked as such. OMP UDRs really
3361 are nested functions. */
3362 gcc_checking_assert (DECL_LOCAL_DECL_P (decl)((void)(!(((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__), 0 : 0))
3363 && (DECL_NAMESPACE_SCOPE_P (decl)((void)(!(((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__), 0 : 0))
3364 || (TREE_CODE (decl) == FUNCTION_DECL((void)(!(((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__), 0 : 0))
3365 && DECL_OMP_DECLARE_REDUCTION_P (decl))))((void)(!(((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __FUNCTION__))->decl_common.lang_flag_0) &&
((!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3363, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == FUNCTION_DECL || ((
(enum tree_code) ((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__)))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__); &lt->u.fn; })->omp_declare_reduction_p
)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3365, __FUNCTION__), 0 : 0))
;
3366
3367 if (!DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3367, __FUNCTION__))->decl_minimal.context)
3368 /* When parsing the parameter list of a function declarator,
3369 don't set DECL_CONTEXT to an enclosing function. When we
3370 push the PARM_DECLs in order to process the function body,
3371 current_binding_level->this_entity will be set. */
3372 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
3373 && current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_function_parms
3374 && current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->this_entity == NULLnullptr))
3375 DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3375, __FUNCTION__))->decl_minimal.context)
= ctx;
3376}
3377
3378/* DECL is a local extern decl. Find or create the namespace-scope
3379 decl that it aliases. Also, determines the linkage of DECL. */
3380
3381static void
3382push_local_extern_decl_alias (tree decl)
3383{
3384 if (dependent_type_p (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3384, __FUNCTION__))->typed.type)
))
3385 return;
3386 /* EH specs were not part of the function type prior to c++17, but
3387 we still can't go pushing dependent eh specs into the namespace. */
3388 if (cxx_dialect < cxx17
3389 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3390 && (value_dependent_expression_p
3391 (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl))((tree_class_check (((tree_check2 ((((contains_struct_check (
(decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3391, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3391, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3391, __FUNCTION__))->type_non_common.lang_1)
)))
3392 return;
3393
3394 gcc_checking_assert (!DECL_LANG_SPECIFIC (decl)((void)(!(!((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3394, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3395, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3395, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3395, __FUNCTION__), 0 : 0))
3395 || !DECL_TEMPLATE_INFO (decl))((void)(!(!((contains_struct_check ((decl), (TS_DECL_COMMON),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3394, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3395, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3395, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3395, __FUNCTION__), 0 : 0))
;
3396 if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __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),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_specific); if (!(
(((enum tree_code) ((((void)(!(((contains_struct_check (((tree_check2
((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == VAR_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == FUNCTION_DECL
) || ((enum tree_code) ((((void)(!(((contains_struct_check ((
(tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == FIELD_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == CONST_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == TYPE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == TEMPLATE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == USING_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__), 0 : 0)), decl))->base.code) == CONCEPT_DECL
)) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3396, __FUNCTION__); &lt->u.min; })->access)
)
3397 /* We're instantiating a non-dependent local decl, it already
3398 knows the alias. */
3399 return;
3400
3401 tree alias = NULL_TREE(tree) nullptr;
3402
3403 if (DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3403, __FUNCTION__))->decl_common.size)
&& !TREE_CONSTANT (DECL_SIZE (decl))((non_type_check ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3403, __FUNCTION__))->decl_common.size)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3403, __FUNCTION__))->base.constant_flag)
)
3404 /* Do not let a VLA creep into a namespace. Diagnostic will be
3405 emitted in layout_var_decl later. */
3406 alias = error_mark_nodeglobal_trees[TI_ERROR_MARK];
3407 else
3408 {
3409 /* First look for a decl that matches. */
3410 tree ns = CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3410, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3410, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3410, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
3411 tree binding = find_namespace_value (ns, DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3411, __FUNCTION__))->decl_minimal.name)
);
3412
3413 if (binding && TREE_CODE (binding)((enum tree_code) (binding)->base.code) != TREE_LIST)
3414 for (ovl_iterator iter (binding); iter; ++iter)
3415 if (decls_match (*iter, decl))
3416 {
3417 alias = *iter;
3418 break;
3419 }
3420
3421 if (!alias)
3422 {
3423 /* No existing namespace-scope decl. Make one. */
3424 alias = copy_decl (decl);
3425 if (TREE_CODE (alias)((enum tree_code) (alias)->base.code) == FUNCTION_DECL)
3426 {
3427 /* Recontextualize the parms. */
3428 for (tree *chain = &DECL_ARGUMENTS (alias)((tree_check ((alias), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3428, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
;
3429 *chain; chain = &DECL_CHAIN (*chain)(((contains_struct_check (((contains_struct_check ((*chain), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3429, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3429, __FUNCTION__))->common.chain))
)
3430 {
3431 *chain = copy_decl (*chain);
3432 DECL_CONTEXT (*chain)((contains_struct_check ((*chain), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3432, __FUNCTION__))->decl_minimal.context)
= alias;
3433 }
3434
3435 tree type = TREE_TYPE (alias)((contains_struct_check ((alias), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3435, __FUNCTION__))->typed.type)
;
3436 for (tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3436, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
3437 args; args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3437, __FUNCTION__))->common.chain)
)
3438 if (TREE_PURPOSE (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3438, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
3439 {
3440 /* There are default args. Lose them. */
3441 tree nargs = NULL_TREE(tree) nullptr;
3442 tree *chain = &nargs;
3443 for (args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3443, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
3444 args; args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3444, __FUNCTION__))->common.chain)
)
3445 if (args == void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
3446 {
3447 *chain = args;
3448 break;
3449 }
3450 else
3451 {
3452 *chain
3453 = build_tree_list (NULL_TREE(tree) nullptr, TREE_VALUE (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3453, __FUNCTION__, (TREE_LIST)))->list.value)
);
3454 chain = &TREE_CHAIN (*chain)((contains_struct_check ((*chain), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3454, __FUNCTION__))->common.chain)
;
3455 }
3456
3457 tree fn_type = build_function_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3457, __FUNCTION__))->typed.type)
, nargs);
3458
3459 fn_type = apply_memfn_quals
3460 (fn_type, type_memfn_quals (type));
3461
3462 fn_type = build_cp_fntype_variant
3463 (fn_type, type_memfn_rqual (type),
3464 TYPE_RAISES_EXCEPTIONS (type)((tree_class_check (((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3464, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3464, __FUNCTION__))->type_non_common.lang_1)
,
3465 TYPE_HAS_LATE_RETURN_TYPE (type)(((tree_class_check (((tree_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3465, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3465, __FUNCTION__))->type_common.lang_flag_2))
);
3466
3467 TREE_TYPE (alias)((contains_struct_check ((alias), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3467, __FUNCTION__))->typed.type)
= fn_type;
3468 break;
3469 }
3470 }
3471
3472 /* This is the real thing. */
3473 DECL_LOCAL_DECL_P (alias)((contains_struct_check (((tree_check2 ((alias), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3473, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3473, __FUNCTION__))->decl_common.lang_flag_0)
= false;
3474
3475 /* Expected default linkage is from the namespace. */
3476 TREE_PUBLIC (alias)((alias)->base.public_flag) = TREE_PUBLIC (ns)((ns)->base.public_flag);
3477 push_nested_namespace (ns);
3478 alias = do_pushdecl (alias, /* hiding= */true);
3479 pop_nested_namespace (ns);
3480 }
3481 }
3482
3483 retrofit_lang_decl (decl);
3484 DECL_LOCAL_DECL_ALIAS (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((void)(!(((contains_struct_check (((tree_check2 ((decl),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_specific); if (!(
(((enum tree_code) ((((void)(!(((contains_struct_check (((tree_check2
((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == VAR_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == FUNCTION_DECL
) || ((enum tree_code) ((((void)(!(((contains_struct_check ((
(tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == FIELD_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == CONST_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == TYPE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == TEMPLATE_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == USING_DECL
|| ((enum tree_code) ((((void)(!(((contains_struct_check (((
tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__), 0 : 0)), decl))->base.code) == CONCEPT_DECL
)) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3484, __FUNCTION__); &lt->u.min; })->access)
= alias;
3485}
3486
3487/* NS needs to be exported, mark it and all its parents as exported. */
3488
3489static void
3490implicitly_export_namespace (tree ns)
3491{
3492 while (!DECL_MODULE_EXPORT_P (ns)((tree_not_check2 ((ns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3492, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
)
3493 {
3494 DECL_MODULE_EXPORT_P (ns)((tree_not_check2 ((ns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3494, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
= true;
3495 ns = CP_DECL_CONTEXT (ns)(!(! (((contains_struct_check ((ns), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3495, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((ns), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3495, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((ns), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3495, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
3496 }
3497}
3498
3499/* DECL has just been bound at LEVEL. finish up the bookkeeping. */
3500
3501static void
3502newbinding_bookkeeping (tree name, tree decl, cp_binding_level *level)
3503{
3504 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)
3505 {
3506 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3506, __FUNCTION__))->typed.type)
;
3507
3508 if (type != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3509 {
3510 if (TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3510, __FUNCTION__))->type_common.name)
!= decl)
3511 set_underlying_type (decl);
3512
3513 set_identifier_type_value_with_scope (name, decl, level);
3514
3515 if (level->kind != sk_namespace
3516 && !instantiating_current_function_p ())
3517 /* This is a locally defined typedef in a function that
3518 is not a template instantation, record it to implement
3519 -Wunused-local-typedefs. */
3520 record_locally_defined_typedef (decl);
3521 }
3522 }
3523 else
3524 {
3525 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && !DECL_LOCAL_DECL_P (decl)((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3525, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3525, __FUNCTION__))->decl_common.lang_flag_0)
)
3526 maybe_register_incomplete_var (decl);
3527
3528 if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
3529 && DECL_EXTERN_C_P (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3529, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3529, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (decl)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
3530 check_extern_c_conflict (decl);
3531 }
3532}
3533
3534/* DECL is a global or module-purview entity. If it has non-internal
3535 linkage, and we have a module vector, record it in the appropriate
3536 slot. We have already checked for duplicates. */
3537
3538static void
3539maybe_record_mergeable_decl (tree *slot, tree name, tree decl)
3540{
3541 if (TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
3542 return;
3543
3544 if (!TREE_PUBLIC (CP_DECL_CONTEXT (decl))(((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3544, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3544, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3544, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.public_flag)
)
3545 /* Member of internal namespace. */
3546 return;
3547
3548 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3548, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)
;
3549 if ((TREE_CODE (not_tmpl)((enum tree_code) (not_tmpl)->base.code) == FUNCTION_DECL
3550 || TREE_CODE (not_tmpl)((enum tree_code) (not_tmpl)->base.code) == VAR_DECL)
3551 && DECL_THIS_STATIC (not_tmpl)((contains_struct_check (((tree_check3 ((not_tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3551, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL
)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3551, __FUNCTION__))->decl_common.lang_flag_6)
)
3552 /* Internal linkage. */
3553 return;
3554
3555 bool partition = named_module_p ();
3556 tree *gslot = get_fixed_binding_slot
3557 (slot, name, partition ? BINDING_SLOT_PARTITION : BINDING_SLOT_GLOBAL, true);
3558
3559 if (!partition)
3560 {
3561 binding_slot &orig
3562 = BINDING_VECTOR_CLUSTER (*gslot, 0)(((tree_binding_vec *)(tree_check ((*gslot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3562, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_CURRENT];
3563
3564 if (!STAT_HACK_P (tree (orig))((tree (orig)) && ((enum tree_code) (tree (orig))->
base.code) == OVERLOAD && ((tree_not_check2 (((tree_check
((tree (orig)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3564, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3564, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3565 orig = stat_hack (tree (orig));
3566
3567 MODULE_BINDING_GLOBAL_P (tree (orig))((tree_check ((tree (orig)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3567, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
3568 }
3569
3570 add_mergeable_namespace_entity (gslot, decl);
3571}
3572
3573/* DECL is being pushed. Check whether it hides or ambiguates
3574 something seen as an import. This include decls seen in our own
3575 interface, which is OK. Also, check for merging a
3576 global/partition decl. */
3577
3578static tree
3579check_module_override (tree decl, tree mvec, bool hiding,
3580 tree scope, tree name)
3581{
3582 bitmap imports = get_import_bitmap ();
3583 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (mvec)(((tree_binding_vec *)(tree_check ((mvec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3583, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
3584 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (mvec)((tree_check ((mvec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3584, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
3585
3586 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
3587 {
3588 cluster++;
3589 ix--;
3590 }
3591
3592 for (; ix--; cluster++)
3593 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
3594 {
3595 /* Are we importing this module? */
3596 if (cluster->indices[jx].span != 1)
3597 continue;
3598 if (!cluster->indices[jx].base)
3599 continue;
3600 if (!bitmap_bit_p (imports, cluster->indices[jx].base))
3601 continue;
3602 /* Is it loaded? */
3603 if (cluster->slots[jx].is_lazy ())
3604 {
3605 gcc_assert (cluster->indices[jx].span == 1)((void)(!(cluster->indices[jx].span == 1) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3605, __FUNCTION__), 0 : 0))
;
3606 lazy_load_binding (cluster->indices[jx].base,
3607 scope, name, &cluster->slots[jx]);
3608 }
3609 tree bind = cluster->slots[jx];
3610 if (!bind)
3611 /* Errors could cause there to be nothing. */
3612 continue;
3613
3614 if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3614, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3614, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3615 /* We do not have to check STAT_TYPE here, the xref_tag
3616 machinery deals with that problem. */
3617 bind = STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3617, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3618
3619 for (ovl_iterator iter (bind); iter; ++iter)
3620 if (iter.using_p ())
3621 ;
3622 else if (tree match = duplicate_decls (decl, *iter, hiding))
3623 {
3624 if (TREE_CODE (match)((enum tree_code) (match)->base.code) == TYPE_DECL)
3625 /* The IDENTIFIER will have the type referring to the
3626 now-smashed TYPE_DECL, because ...? Reset it. */
3627 SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (match))(((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3627, __FUNCTION__))->typed.type) = (((contains_struct_check
((match), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3627, __FUNCTION__))->typed.type)))
;
3628
3629 return match;
3630 }
3631 }
3632
3633 if (TREE_PUBLIC (scope)((scope)->base.public_flag) && TREE_PUBLIC (decl)((decl)->base.public_flag) && !not_module_p ()
3634 /* Namespaces are dealt with specially in
3635 make_namespace_finish. */
3636 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL && !DECL_NAMESPACE_ALIAS (decl)((contains_struct_check (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3636, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3636, __FUNCTION__))->decl_common.abstract_origin)
))
3637 {
3638 /* Look in the appropriate mergeable decl slot. */
3639 tree mergeable = NULL_TREE(tree) nullptr;
3640 if (named_module_p ())
3641 mergeable = BINDING_VECTOR_CLUSTER (mvec, BINDING_SLOT_PARTITION(((tree_binding_vec *)(tree_check ((mvec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3642, __FUNCTION__, (BINDING_VECTOR))))->vec[BINDING_SLOT_PARTITION
/ 2])
3642 / BINDING_VECTOR_SLOTS_PER_CLUSTER)(((tree_binding_vec *)(tree_check ((mvec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3642, __FUNCTION__, (BINDING_VECTOR))))->vec[BINDING_SLOT_PARTITION
/ 2])
3643 .slots[BINDING_SLOT_PARTITION % BINDING_VECTOR_SLOTS_PER_CLUSTER2];
3644 else
3645 mergeable = BINDING_VECTOR_CLUSTER (mvec, 0)(((tree_binding_vec *)(tree_check ((mvec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3645, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_GLOBAL];
3646
3647 for (ovl_iterator iter (mergeable); iter; ++iter)
3648 {
3649 tree match = *iter;
3650
3651 if (duplicate_decls (decl, match, hiding))
3652 {
3653 if (TREE_CODE (match)((enum tree_code) (match)->base.code) == TYPE_DECL)
3654 SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (match))(((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3654, __FUNCTION__))->typed.type) = (((contains_struct_check
((match), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3654, __FUNCTION__))->typed.type)))
;
3655 return match;
3656 }
3657 }
3658 }
3659
3660 return NULL_TREE(tree) nullptr;
3661}
3662
3663/* Record DECL as belonging to the current lexical scope. Check for
3664 errors (such as an incompatible declaration for the same name
3665 already seen in the same scope). IS_FRIEND is true if DECL is
3666 declared as a friend.
3667
3668 Returns either DECL or an old decl for the same name. If an old
3669 decl is returned, it may have been smashed to agree with what DECL
3670 says. */
3671
3672static tree
3673do_pushdecl (tree decl, bool hiding)
3674{
3675 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3676 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3677
3678 if (!DECL_TEMPLATE_PARM_P (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3678, __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)
3679 set_decl_context_in_fn (current_function_decl, decl);
3680
3681 /* The binding level we will be pushing into. During local class
3682 pushing, we want to push to the containing scope. */
3683 cp_binding_level *level = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
3684 while (level->kind == sk_class
3685 || level->kind == sk_cleanup)
3686 level = level->level_chain;
3687
3688 /* An anonymous namespace has a NULL DECL_NAME, but we still want to
3689 insert it. Other NULL-named decls, not so much. */
3690 tree name = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3690, __FUNCTION__))->decl_minimal.name)
;
3691 if (name ? !IDENTIFIER_ANON_P (name)((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3691, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
: TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL)
3692 {
3693 cxx_binding *binding = NULLnullptr; /* Local scope binding. */
3694 tree ns = NULL_TREE(tree) nullptr; /* Searched namespace. */
3695 tree *slot = NULLnullptr; /* Binding slot in namespace. */
3696 tree *mslot = NULLnullptr; /* Current module slot in namespace. */
3697 tree old = NULL_TREE(tree) nullptr;
3698
3699 if (level->kind == sk_namespace)
3700 {
3701 /* We look in the decl's namespace for an existing
3702 declaration, even though we push into the current
3703 namespace. */
3704 ns = (DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3704, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3704, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3704, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3704, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
3705 ? CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3705, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3705, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3705, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
: current_namespacescope_chain->old_namespace);
3706 /* Create the binding, if this is current namespace, because
3707 that's where we'll be pushing anyway. */
3708 slot = find_namespace_slot (ns, name, ns == current_namespacescope_chain->old_namespace);
3709 if (slot)
3710 {
3711 mslot = get_fixed_binding_slot (slot, name, BINDING_SLOT_CURRENT,
3712 ns == current_namespacescope_chain->old_namespace);
3713 old = MAYBE_STAT_DECL (*mslot)(((*mslot) && ((enum tree_code) (*mslot)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((*mslot
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3713, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3713, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((*mslot
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3713, __FUNCTION__, (OVERLOAD))))->function) : *mslot)
;
3714 }
3715 }
3716 else
3717 {
3718 binding = find_local_binding (level, name);
3719 if (binding)
3720 old = binding->value;
3721 }
3722
3723 if (old == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3724 old = NULL_TREE(tree) nullptr;
3725
3726 for (ovl_iterator iter (old); iter; ++iter)
3727 if (iter.using_p ())
3728 ; /* Ignore using decls here. */
3729 else if (iter.hidden_p ()
3730 && DECL_LANG_SPECIFIC (*iter)((contains_struct_check ((*iter), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3730, __FUNCTION__))->decl_common.lang_specific)
3731 && DECL_MODULE_IMPORT_P (*iter)(((contains_struct_check (((*iter)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3731, __FUNCTION__))->decl_common.lang_specific)->u.base
.module_import_p)
)
3732 ; /* An undeclared builtin imported from elsewhere. */
3733 else if (tree match
3734 = duplicate_decls (decl, *iter, hiding, iter.hidden_p ()))
3735 {
3736 if (match == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3737 ;
3738 else if (TREE_CODE (match)((enum tree_code) (match)->base.code) == TYPE_DECL)
3739 /* The IDENTIFIER will have the type referring to the
3740 now-smashed TYPE_DECL, because ...? Reset it. */
3741 SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (match))(((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3741, __FUNCTION__))->typed.type) = (((contains_struct_check
((match), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3741, __FUNCTION__))->typed.type)))
;
3742 else if (iter.hidden_p () && !hiding)
3743 {
3744 /* Unhiding a previously hidden decl. */
3745 tree head = iter.reveal_node (old);
3746 if (head != old)
3747 {
3748 gcc_checking_assert (ns)((void)(!(ns) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3748, __FUNCTION__), 0 : 0))
;
3749 if (STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3749, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3749, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3750 STAT_DECL (*slot)(((struct tree_overload*)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3750, __FUNCTION__, (OVERLOAD))))->function)
= head;
3751 else
3752 *slot = head;
3753 }
3754 if (DECL_EXTERN_C_P (match)((((contains_struct_check ((match), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3754, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((match), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3754, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (match)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
3755 /* We need to check and register the decl now. */
3756 check_extern_c_conflict (match);
3757 }
3758 else if (slot && !hiding
3759 && STAT_HACK_P (*slot)((*slot) && ((enum tree_code) (*slot)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((*slot)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3759, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3759, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& STAT_DECL_HIDDEN_P (*slot)((tree_not_check2 (((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3759, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3759, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
3760 {
3761 /* Unhide the non-function. */
3762 gcc_checking_assert (old == match)((void)(!(old == match) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3762, __FUNCTION__), 0 : 0))
;
3763 if (!STAT_TYPE (*slot)((contains_struct_check ((*slot), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3763, __FUNCTION__))->typed.type)
)
3764 *slot = match;
3765 else
3766 STAT_DECL (*slot)(((struct tree_overload*)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3766, __FUNCTION__, (OVERLOAD))))->function)
= match;
3767 }
3768 return match;
3769 }
3770
3771 /* Check for redeclaring an import. */
3772 if (slot && *slot && TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) == BINDING_VECTOR)
3773 if (tree match
3774 = check_module_override (decl, *slot, hiding, ns, name))
3775 {
3776 if (match == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3777 return match;
3778
3779 /* We found a decl in an interface, push it into this
3780 binding. */
3781 decl = update_binding (NULLnullptr, binding, mslot, old,
3782 match, hiding);
3783
3784 if (match == decl && DECL_MODULE_EXPORT_P (decl)((tree_not_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3784, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
3785 && !DECL_MODULE_EXPORT_P (level->this_entity)((tree_not_check2 ((level->this_entity), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3785, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
)
3786 implicitly_export_namespace (level->this_entity);
3787
3788 return decl;
3789 }
3790
3791 /* We are pushing a new decl. */
3792
3793 /* Skip a hidden builtin we failed to match already. There can
3794 only be one. */
3795 if (old && anticipated_builtin_p (old))
3796 old = OVL_CHAIN (old)(((struct tree_overload*)(tree_check ((old), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3796, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3797
3798 check_template_shadow (decl);
3799
3800 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3800, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3800, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
3801 {
3802 check_default_args (decl);
3803
3804 if (hiding)
3805 {
3806 if (level->kind != sk_namespace)
3807 {
3808 /* In a local class, a friend function declaration must
3809 find a matching decl in the innermost non-class scope.
3810 [class.friend/11] */
3811 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3811, __FUNCTION__))->decl_minimal.locus)
,
3812 "friend declaration %qD in local class without "
3813 "prior local declaration", decl);
3814 /* Don't attempt to push it. */
3815 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3816 }
3817 }
3818 }
3819
3820 if (level->kind != sk_namespace)
3821 {
3822 check_local_shadow (decl);
3823
3824 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL)
3825 /* A local namespace alias. */
3826 set_identifier_type_value_with_scope (name, NULL_TREE(tree) nullptr, level);
3827
3828 if (!binding)
3829 binding = create_local_binding (level, name);
3830 }
3831 else if (!slot)
3832 {
3833 ns = current_namespacescope_chain->old_namespace;
3834 slot = find_namespace_slot (ns, name, true);
3835 mslot = get_fixed_binding_slot (slot, name, BINDING_SLOT_CURRENT, true);
3836 /* Update OLD to reflect the namespace we're going to be
3837 pushing into. */
3838 old = MAYBE_STAT_DECL (*mslot)(((*mslot) && ((enum tree_code) (*mslot)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((*mslot
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3838, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3838, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((*mslot
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3838, __FUNCTION__, (OVERLOAD))))->function) : *mslot)
;
3839 }
3840
3841 old = update_binding (level, binding, mslot, old, decl, hiding);
3842
3843 if (old != decl)
3844 /* An existing decl matched, use it. */
3845 decl = old;
3846 else
3847 {
3848 newbinding_bookkeeping (name, decl, level);
3849
3850 if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
3851 && DECL_LOCAL_DECL_P (decl)((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3851, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3851, __FUNCTION__))->decl_common.lang_flag_0)
3852 && TREE_CODE (CP_DECL_CONTEXT (decl))((enum tree_code) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3852, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3852, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3852, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code)
== NAMESPACE_DECL)
3853 push_local_extern_decl_alias (decl);
3854
3855 if (level->kind == sk_namespace
3856 && TREE_PUBLIC (level->this_entity)((level->this_entity)->base.public_flag))
3857 {
3858 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != CONST_DECL
3859 && DECL_MODULE_EXPORT_P (decl)((tree_not_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3859, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
3860 && !DECL_MODULE_EXPORT_P (level->this_entity)((tree_not_check2 ((level->this_entity), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3860, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
)
3861 implicitly_export_namespace (level->this_entity);
3862
3863 if (!not_module_p ())
3864 maybe_record_mergeable_decl (slot, name, decl);
3865 }
3866 }
3867 }
3868 else
3869 add_decl_to_level (level, decl);
3870
3871 return decl;
3872}
3873
3874/* Record a decl-node X as belonging to the current lexical scope.
3875 The new binding is hidden if HIDING is true (an anticipated builtin
3876 or hidden friend). */
3877
3878tree
3879pushdecl (tree x, bool hiding)
3880{
3881 bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
3882 tree ret = do_pushdecl (x, hiding);
3883 timevar_cond_stop (TV_NAME_LOOKUP, subtime);
3884 return ret;
3885}
3886
3887/* A mergeable entity is being loaded into namespace NS slot NAME.
3888 Create and return the appropriate vector slot for that. Either a
3889 GMF slot or a module-specific one. */
3890
3891tree *
3892mergeable_namespace_slots (tree ns, tree name, bool is_global, tree *vec)
3893{
3894 tree *mslot = find_namespace_slot (ns, name, true);
3895 tree *vslot = get_fixed_binding_slot
3896 (mslot, name, is_global ? BINDING_SLOT_GLOBAL : BINDING_SLOT_PARTITION, true);
3897
3898 gcc_checking_assert (TREE_CODE (*mslot) == BINDING_VECTOR)((void)(!(((enum tree_code) (*mslot)->base.code) == BINDING_VECTOR
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3898, __FUNCTION__), 0 : 0))
;
3899 *vec = *mslot;
3900
3901 return vslot;
3902}
3903
3904/* DECL is a new mergeable namespace-scope decl. Add it to the
3905 mergeable entities on GSLOT. */
3906
3907void
3908add_mergeable_namespace_entity (tree *gslot, tree decl)
3909{
3910 *gslot = ovl_make (decl, *gslot);
3911}
3912
3913/* A mergeable entity of KLASS called NAME is being loaded. Return
3914 the set of things it could be. All such non-as_base classes have
3915 been given a member vec. */
3916
3917tree
3918lookup_class_binding (tree klass, tree name)
3919{
3920 tree found = NULL_TREE(tree) nullptr;
3921
3922 if (!COMPLETE_TYPE_P (klass)(((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3922, __FUNCTION__))->type_common.size) != (tree) nullptr
)
)
3923 ;
3924 else if (TYPE_LANG_SPECIFIC (klass)((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3924, __FUNCTION__))->type_with_lang_specific.lang_specific
)
)
3925 {
3926 vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (klass)((((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3926, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
3927
3928 found = member_vec_binary_search (member_vec, name);
3929 if (IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3929, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3929, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3929, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3929, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3929, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3929, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
3930 {
3931 gcc_checking_assert (name == conv_op_identifier)((void)(!(name == cp_global_trees[CPTI_CONV_OP_IDENTIFIER]) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3931, __FUNCTION__), 0 : 0))
;
3932 if (found)
3933 found = OVL_CHAIN (found)(((struct tree_overload*)(tree_check ((found), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3933, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3934 }
3935 }
3936 else
3937 {
3938 gcc_checking_assert (IS_FAKE_BASE_TYPE (klass)((void)(!((((enum tree_code) (klass)->base.code) == RECORD_TYPE
&& ((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context) && ((
(((enum tree_code) (((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context))->base.code
)) == RECORD_TYPE || (((enum tree_code) (((tree_class_check (
(klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context))->base.code
)) == UNION_TYPE) && ((tree_class_check ((((tree_class_check
((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.lang_flag_5)) &&
((((tree_class_check ((((tree_class_check ((klass), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_with_lang_specific.lang_specific
))->as_base) == (klass)) || (((enum tree_code) (klass)->
base.code) == RECORD_TYPE && (((tree_class_check (((tree_check
((klass), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3939, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3939, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3939, __FUNCTION__), 0 : 0))
3939 || TYPE_PTRMEMFUNC_P (klass))((void)(!((((enum tree_code) (klass)->base.code) == RECORD_TYPE
&& ((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context) && ((
(((enum tree_code) (((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context))->base.code
)) == RECORD_TYPE || (((enum tree_code) (((tree_class_check (
(klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context))->base.code
)) == UNION_TYPE) && ((tree_class_check ((((tree_class_check
((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.lang_flag_5)) &&
((((tree_class_check ((((tree_class_check ((klass), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3938, __FUNCTION__))->type_with_lang_specific.lang_specific
))->as_base) == (klass)) || (((enum tree_code) (klass)->
base.code) == RECORD_TYPE && (((tree_class_check (((tree_check
((klass), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3939, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3939, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3939, __FUNCTION__), 0 : 0))
;
3940 found = fields_linear_search (klass, name, false);
3941 }
3942
3943 return found;
3944}
3945
3946/* Given a namespace-level binding BINDING, walk it, calling CALLBACK
3947 for all decls of the current module. When partitions are involved,
3948 decls might be mentioned more than once. */
3949
3950unsigned
3951walk_module_binding (tree binding, bitmap partitions,
3952 bool (*callback) (tree decl, WMB_Flags, void *data),
3953 void *data)
3954{
3955 // FIXME: We don't quite deal with using decls naming stat hack
3956 // type. Also using decls exporting something from the same scope.
3957 tree current = binding;
3958 unsigned count = 0;
3959
3960 if (TREE_CODE (binding)((enum tree_code) (binding)->base.code) == BINDING_VECTOR)
3961 current = BINDING_VECTOR_CLUSTER (binding, 0)(((tree_binding_vec *)(tree_check ((binding), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3961, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_CURRENT];
3962
3963 bool decl_hidden = false;
3964 if (tree type = MAYBE_STAT_TYPE (current)(((current) && ((enum tree_code) (current)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((current
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3964, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3964, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? ((contains_struct_check ((current), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3964, __FUNCTION__))->typed.type) : (tree) nullptr)
)
3965 {
3966 WMB_Flags flags = WMB_None;
3967 if (STAT_TYPE_HIDDEN_P (current)((tree_not_check2 (((tree_check ((current), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3967, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3967, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
3968 flags = WMB_Flags (flags | WMB_Hidden);
3969 count += callback (type, flags, data);
3970 decl_hidden = STAT_DECL_HIDDEN_P (current)((tree_not_check2 (((tree_check ((current), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3970, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3970, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
3971 }
3972
3973 for (ovl_iterator iter (MAYBE_STAT_DECL (current)(((current) && ((enum tree_code) (current)->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((current
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3973, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3973, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check ((current
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3973, __FUNCTION__, (OVERLOAD))))->function) : current)
); iter; ++iter)
3974 {
3975 if (iter.hidden_p ())
3976 decl_hidden = true;
3977 if (!(decl_hidden && DECL_IS_UNDECLARED_BUILTIN (*iter)(((contains_struct_check ((*iter), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3977, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
))
3978 {
3979 WMB_Flags flags = WMB_None;
3980 if (decl_hidden)
3981 flags = WMB_Flags (flags | WMB_Hidden);
3982 if (iter.using_p ())
3983 {
3984 flags = WMB_Flags (flags | WMB_Using);
3985 if (iter.exporting_p ())
3986 flags = WMB_Flags (flags | WMB_Export);
3987 }
3988 count += callback (*iter, flags, data);
3989 }
3990 decl_hidden = false;
3991 }
3992
3993 if (partitions && TREE_CODE (binding)((enum tree_code) (binding)->base.code) == BINDING_VECTOR)
3994 {
3995 /* Process partition slots. */
3996 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (binding)(((tree_binding_vec *)(tree_check ((binding), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3996, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
3997 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (binding)((tree_check ((binding), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3997, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
3998 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
3999 {
4000 ix--;
4001 cluster++;
4002 }
4003
4004 bool maybe_dups = BINDING_VECTOR_PARTITION_DUPS_P (binding)((tree_check ((binding), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4004, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
;
4005
4006 for (; ix--; cluster++)
4007 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
4008 if (!cluster->slots[jx].is_lazy ())
4009 if (tree bind = cluster->slots[jx])
4010 {
4011 if (TREE_CODE (bind)((enum tree_code) (bind)->base.code) == NAMESPACE_DECL
4012 && !DECL_NAMESPACE_ALIAS (bind)((contains_struct_check (((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4012, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4012, __FUNCTION__))->decl_common.abstract_origin)
)
4013 {
4014 if (unsigned base = cluster->indices[jx].base)
4015 if (unsigned span = cluster->indices[jx].span)
4016 do
4017 if (bitmap_bit_p (partitions, base))
4018 goto found;
4019 while (++base, --span);
4020 /* Not a partition's namespace. */
4021 continue;
4022 found:
4023
4024 WMB_Flags flags = WMB_None;
4025 if (maybe_dups)
4026 flags = WMB_Flags (flags | WMB_Dups);
4027 count += callback (bind, flags, data);
4028 }
4029 else if (STAT_HACK_P (bind)((bind) && ((enum tree_code) (bind)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((bind),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4029, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4029, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
&& MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4029, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
4030 {
4031 if (tree btype = STAT_TYPE (bind)((contains_struct_check ((bind), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4031, __FUNCTION__))->typed.type)
)
4032 {
4033 WMB_Flags flags = WMB_None;
4034 if (maybe_dups)
4035 flags = WMB_Flags (flags | WMB_Dups);
4036 if (STAT_TYPE_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4036, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4036, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
4037 flags = WMB_Flags (flags | WMB_Hidden);
4038
4039 count += callback (btype, flags, data);
4040 }
4041 bool hidden = STAT_DECL_HIDDEN_P (bind)((tree_not_check2 (((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4041, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4041, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
4042 for (ovl_iterator iter (MAYBE_STAT_DECL (STAT_DECL (bind))((((((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (OVERLOAD))))->function)) &&
((enum tree_code) ((((struct tree_overload*)(tree_check ((bind
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (OVERLOAD))))->function))->base.code
) == OVERLOAD && ((tree_not_check2 (((tree_check ((((
(struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (OVERLOAD))))->function)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? (((struct tree_overload*)(tree_check (((((struct
tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (OVERLOAD))))->function)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (OVERLOAD))))->function) : (((struct
tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4042, __FUNCTION__, (OVERLOAD))))->function))
);
4043 iter; ++iter)
4044 {
4045 if (iter.hidden_p ())
4046 hidden = true;
4047 gcc_checking_assert((void)(!(!(hidden && (((contains_struct_check ((*iter
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4048, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4048, __FUNCTION__), 0 : 0))
4048 (!(hidden && DECL_IS_UNDECLARED_BUILTIN (*iter)))((void)(!(!(hidden && (((contains_struct_check ((*iter
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4048, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4048, __FUNCTION__), 0 : 0))
;
4049
4050 WMB_Flags flags = WMB_None;
4051 if (maybe_dups)
4052 flags = WMB_Flags (flags | WMB_Dups);
4053 if (decl_hidden)
4054 flags = WMB_Flags (flags | WMB_Hidden);
4055 if (iter.using_p ())
4056 {
4057 flags = WMB_Flags (flags | WMB_Using);
4058 if (iter.exporting_p ())
4059 flags = WMB_Flags (flags | WMB_Export);
4060 }
4061 count += callback (*iter, flags, data);
4062 hidden = false;
4063 }
4064 }
4065 }
4066 }
4067
4068 return count;
4069}
4070
4071/* Imported module MOD has a binding to NS::NAME, stored in section
4072 SNUM. */
4073
4074bool
4075import_module_binding (tree ns, tree name, unsigned mod, unsigned snum)
4076{
4077 tree *slot = find_namespace_slot (ns, name, true);
4078 binding_slot *mslot = append_imported_binding_slot (slot, name, mod);
4079
4080 if (mslot->is_lazy () || *mslot)
4081 /* Oops, something was already there. */
4082 return false;
4083
4084 mslot->set_lazy (snum);
4085 return true;
4086}
4087
4088/* An import of MODULE is binding NS::NAME. There should be no
4089 existing binding for >= MODULE. MOD_GLOB indicates whether MODULE
4090 is a header_unit (-1) or part of the current module (+1). VALUE
4091 and TYPE are the value and type bindings. VISIBLE are the value
4092 bindings being exported. */
4093
4094bool
4095set_module_binding (tree ns, tree name, unsigned mod, int mod_glob,
4096 tree value, tree type, tree visible)
4097{
4098 if (!value)
4099 /* Bogus BMIs could give rise to nothing to bind. */
4100 return false;
4101
4102 gcc_assert (TREE_CODE (value) != NAMESPACE_DECL((void)(!(((enum tree_code) (value)->base.code) != NAMESPACE_DECL
|| ((contains_struct_check (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4103, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4103, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4103, __FUNCTION__), 0 : 0))
4103 || DECL_NAMESPACE_ALIAS (value))((void)(!(((enum tree_code) (value)->base.code) != NAMESPACE_DECL
|| ((contains_struct_check (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4103, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4103, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4103, __FUNCTION__), 0 : 0))
;
4104 gcc_checking_assert (mod)((void)(!(mod) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4104, __FUNCTION__), 0 : 0))
;
4105
4106 tree *slot = find_namespace_slot (ns, name, true);
4107 binding_slot *mslot = search_imported_binding_slot (slot, mod);
4108
4109 if (!mslot || !mslot->is_lazy ())
4110 /* Again, bogus BMI could give find to missing or already loaded slot. */
4111 return false;
4112
4113 tree bind = value;
4114 if (type || visible != bind || mod_glob)
4115 {
4116 bind = stat_hack (bind, type);
4117 STAT_VISIBLE (bind)(((struct tree_overload*)(tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4117, __FUNCTION__, (OVERLOAD))))->common.chain)
= visible;
4118 if ((mod_glob > 0 && TREE_PUBLIC (ns)((ns)->base.public_flag))
4119 || (type && DECL_MODULE_EXPORT_P (type)((tree_not_check2 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4119, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
))
4120 STAT_TYPE_VISIBLE_P (bind)(((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4120, __FUNCTION__, (OVERLOAD))))->base.used_flag)
= true;
4121 }
4122
4123 /* Note if this is this-module or global binding. */
4124 if (mod_glob > 0)
4125 MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4125, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
= true;
4126 else if (mod_glob < 0)
4127 MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4127, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
4128
4129 *mslot = bind;
4130
4131 return true;
4132}
4133
4134void
4135note_pending_specializations (tree ns, tree name, bool is_header)
4136{
4137 if (tree *slot = find_namespace_slot (ns, name, false))
4138 if (TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) == BINDING_VECTOR)
4139 {
4140 tree vec = *slot;
4141 BINDING_VECTOR_PENDING_SPECIALIZATIONS_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4141, __FUNCTION__, (BINDING_VECTOR)))->base.public_flag
)
= true;
4142 if (is_header)
4143 BINDING_VECTOR_PENDING_IS_HEADER_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4143, __FUNCTION__, (BINDING_VECTOR)))->base.protected_flag
)
= true;
4144 else
4145 BINDING_VECTOR_PENDING_IS_PARTITION_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4145, __FUNCTION__, (BINDING_VECTOR)))->base.private_flag
)
= true;
4146 }
4147}
4148
4149void
4150load_pending_specializations (tree ns, tree name)
4151{
4152 tree *slot = find_namespace_slot (ns, name, false);
4153
4154 if (!slot || TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR
4155 || !BINDING_VECTOR_PENDING_SPECIALIZATIONS_P (*slot)((tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4155, __FUNCTION__, (BINDING_VECTOR)))->base.public_flag
)
)
4156 return;
4157
4158 tree vec = *slot;
4159 BINDING_VECTOR_PENDING_SPECIALIZATIONS_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4159, __FUNCTION__, (BINDING_VECTOR)))->base.public_flag
)
= false;
4160
4161 bool do_header = BINDING_VECTOR_PENDING_IS_HEADER_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4161, __FUNCTION__, (BINDING_VECTOR)))->base.protected_flag
)
;
4162 bool do_partition = BINDING_VECTOR_PENDING_IS_PARTITION_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4162, __FUNCTION__, (BINDING_VECTOR)))->base.private_flag
)
;
4163 BINDING_VECTOR_PENDING_IS_HEADER_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4163, __FUNCTION__, (BINDING_VECTOR)))->base.protected_flag
)
= false;
4164 BINDING_VECTOR_PENDING_IS_PARTITION_P (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4164, __FUNCTION__, (BINDING_VECTOR)))->base.private_flag
)
= false;
4165
4166 gcc_checking_assert (do_header | do_partition)((void)(!(do_header | do_partition) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4166, __FUNCTION__), 0 : 0))
;
4167 binding_cluster *cluster = BINDING_VECTOR_CLUSTER_BASE (vec)(((tree_binding_vec *)(tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4167, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
4168 unsigned ix = BINDING_VECTOR_NUM_CLUSTERS (vec)((tree_check ((vec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4168, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
4169 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
4170 {
4171 ix--;
4172 cluster++;
4173 }
4174
4175 for (; ix--; cluster++)
4176 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
4177 if (cluster->indices[jx].span
4178 && cluster->slots[jx].is_lazy ()
4179 && lazy_specializations_p (cluster->indices[jx].base,
4180 do_header, do_partition))
4181 lazy_load_binding (cluster->indices[jx].base, ns, name,
4182 &cluster->slots[jx]);
4183}
4184
4185void
4186add_module_decl (tree ns, tree name, tree decl)
4187{
4188 gcc_assert (!DECL_CHAIN (decl))((void)(!(!(((contains_struct_check (((contains_struct_check (
(decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4188, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4188, __FUNCTION__))->common.chain))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4188, __FUNCTION__), 0 : 0))
;
4189 add_decl_to_level (NAMESPACE_LEVEL (ns)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((ns), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4189, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (ns)->base.code) != NAMESPACE_DECL || lt->
u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4189, __FUNCTION__); &lt->u.ns; })->level)
, decl);
4190 newbinding_bookkeeping (name, decl, NAMESPACE_LEVEL (ns)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((ns), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4190, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (ns)->base.code) != NAMESPACE_DECL || lt->
u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4190, __FUNCTION__); &lt->u.ns; })->level)
);
4191}
4192
4193/* Enter DECL into the symbol table, if that's appropriate. Returns
4194 DECL, or a modified version thereof. */
4195
4196tree
4197maybe_push_decl (tree decl)
4198{
4199 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4199, __FUNCTION__))->typed.type)
;
4200
4201 /* Add this decl to the current binding level, but not if it comes
4202 from another scope, e.g. a static member variable. TEM may equal
4203 DECL or it may be a previous decl of the same name. */
4204 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]
4205 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
4206 && DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4206, __FUNCTION__))->decl_minimal.context)
!= NULL_TREE(tree) nullptr
4207 /* Definitions of namespace members outside their namespace are
4208 possible. */
4209 && !DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4209, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4209, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4209, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4209, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
4210 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && !namespace_bindings_p ())
4211 || type == unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE]
4212 /* The declaration of a template specialization does not affect
4213 the functions available for overload resolution, so we do not
4214 call pushdecl. */
4215 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
4216 && DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4216, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
))
4217 return decl;
4218 else
4219 return pushdecl (decl);
4220}
4221
4222/* Bind DECL to ID in the current_binding_level, assumed to be a local
4223 binding level. If IS_USING is true, DECL got here through a
4224 using-declaration. */
4225
4226static void
4227push_local_binding (tree id, tree decl, bool is_using)
4228{
4229 /* Skip over any local classes. This makes sense if we call
4230 push_local_binding with a friend decl of a local class. */
4231 cp_binding_level *b = innermost_nonclass_level ();
4232
4233 gcc_assert (b->kind != sk_namespace)((void)(!(b->kind != sk_namespace) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4233, __FUNCTION__), 0 : 0))
;
4234 if (find_local_binding (b, id))
4235 {
4236 /* Supplement the existing binding. */
4237 if (!supplement_binding (IDENTIFIER_BINDING (id)(((struct lang_identifier*)(tree_check ((id), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4237, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
, decl))
4238 /* It didn't work. Something else must be bound at this
4239 level. Do not add DECL to the list of things to pop
4240 later. */
4241 return;
4242 }
4243 else
4244 /* Create a new binding. */
4245 push_binding (id, decl, b);
4246
4247 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == OVERLOAD || is_using)
4248 /* We must put the OVERLOAD or using into a TREE_LIST since we
4249 cannot use the decl's chain itself. */
4250 decl = build_tree_list (id, decl);
4251
4252 /* And put DECL on the list of things declared by the current
4253 binding level. */
4254 add_decl_to_level (b, decl);
4255}
4256
4257
4258/* true means unconditionally make a BLOCK for the next level pushed. */
4259
4260static bool keep_next_level_flag;
4261
4262static int binding_depth = 0;
4263
4264static void
4265indent (int depth)
4266{
4267 int i;
4268
4269 for (i = 0; i < depth * 2; i++)
4270 putc (' ', stderrstderr);
4271}
4272
4273/* Return a string describing the kind of SCOPE we have. */
4274static const char *
4275cp_binding_level_descriptor (cp_binding_level *scope)
4276{
4277 /* The order of this table must match the "scope_kind"
4278 enumerators. */
4279 static const char* scope_kind_names[] = {
4280 "block-scope",
4281 "cleanup-scope",
4282 "try-scope",
4283 "catch-scope",
4284 "for-scope",
4285 "function-parameter-scope",
4286 "class-scope",
4287 "namespace-scope",
4288 "template-parameter-scope",
4289 "template-explicit-spec-scope"
4290 };
4291 const scope_kind kind = scope->explicit_spec_p
4292 ? sk_template_spec : scope->kind;
4293
4294 return scope_kind_names[kind];
4295}
4296
4297/* Output a debugging information about SCOPE when performing
4298 ACTION at LINE. */
4299static void
4300cp_binding_level_debug (cp_binding_level *scope, int line, const char *action)
4301{
4302 const char *desc = cp_binding_level_descriptor (scope);
4303 if (scope->this_entity)
4304 verbatim ("%s %<%s(%E)%> %p %d", action, desc,
4305 scope->this_entity, (void *) scope, line);
4306 else
4307 verbatim ("%s %s %p %d", action, desc, (void *) scope, line);
4308}
4309
4310/* A chain of binding_level structures awaiting reuse. */
4311
4312static GTY((deletable)) cp_binding_level *free_binding_level;
4313
4314/* Insert SCOPE as the innermost binding level. */
4315
4316void
4317push_binding_level (cp_binding_level *scope)
4318{
4319 /* Add it to the front of currently active scopes stack. */
4320 scope->level_chain = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4321 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= scope;
4322 keep_next_level_flag = false;
4323
4324 if (ENABLE_SCOPE_CHECKING0)
4325 {
4326 scope->binding_depth = binding_depth;
4327 indent (binding_depth);
4328 cp_binding_level_debug (scope, LOCATION_LINE (input_location)((expand_location (input_location)).line),
4329 "push");
4330 binding_depth++;
4331 }
4332}
4333
4334/* Create a new KIND scope and make it the top of the active scopes stack.
4335 ENTITY is the scope of the associated C++ entity (namespace, class,
4336 function, C++0x enumeration); it is NULL otherwise. */
4337
4338cp_binding_level *
4339begin_scope (scope_kind kind, tree entity)
4340{
4341 cp_binding_level *scope;
4342
4343 /* Reuse or create a struct for this binding level. */
4344 if (!ENABLE_SCOPE_CHECKING0 && free_binding_level)
4345 {
4346 scope = free_binding_level;
4347 free_binding_level = scope->level_chain;
4348 memset (scope, 0, sizeof (cp_binding_level));
4349 }
4350 else
4351 scope = ggc_cleared_alloc<cp_binding_level> ();
4352
4353 scope->this_entity = entity;
4354 scope->more_cleanups_ok = true;
4355 switch (kind)
4356 {
4357 case sk_cleanup:
4358 scope->keep = true;
4359 break;
4360
4361 case sk_template_spec:
4362 scope->explicit_spec_p = true;
4363 kind = sk_template_parms;
4364 /* Fall through. */
4365 case sk_template_parms:
4366 case sk_block:
4367 case sk_try:
4368 case sk_catch:
4369 case sk_for:
4370 case sk_cond:
4371 case sk_class:
4372 case sk_scoped_enum:
4373 case sk_transaction:
4374 case sk_omp:
4375 scope->keep = keep_next_level_flag;
4376 break;
4377
4378 case sk_function_parms:
4379 scope->keep = keep_next_level_flag;
4380 if (entity)
4381 scope->immediate_fn_ctx_p = DECL_IMMEDIATE_FUNCTION_P (entity)(((contains_struct_check (((tree_check (((((enum tree_code) (
entity)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((entity
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__, (TEMPLATE_DECL))))))))->result : entity
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__))->decl_common.lang_specific) ? __extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) (entity)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((entity
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__, (TEMPLATE_DECL))))))))->result : entity
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (entity)->base.code) == FUNCTION_DECL ||
(((enum tree_code) (entity)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((entity), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) nullptr && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((entity
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4381, __FUNCTION__); &lt->u.fn; })->immediate_fn_p
: false)
;
4382 break;
4383
4384 case sk_namespace:
4385 NAMESPACE_LEVEL (entity)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((entity), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4385, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (entity)->base.code) != NAMESPACE_DECL || lt
->u.base.selector != lds_ns) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4385, __FUNCTION__); &lt->u.ns; })->level)
= scope;
4386 break;
4387
4388 default:
4389 /* Should not happen. */
4390 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4390, __FUNCTION__))
;
4391 break;
4392 }
4393 scope->kind = kind;
4394
4395 push_binding_level (scope);
4396
4397 return scope;
4398}
4399
4400/* We're about to leave current scope. Pop the top of the stack of
4401 currently active scopes. Return the enclosing scope, now active. */
4402
4403cp_binding_level *
4404leave_scope (void)
4405{
4406 cp_binding_level *scope = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4407
4408 if (scope->kind == sk_namespace && class_binding_levelscope_chain->class_bindings)
4409 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;
4410
4411 /* We cannot leave a scope, if there are none left. */
4412 if (NAMESPACE_LEVEL (global_namespace)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((cp_global_trees[CPTI_GLOBAL]), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4412, __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
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4412, __FUNCTION__); &lt->u.ns; })->level)
)
4413 gcc_assert (!global_scope_p (scope))((void)(!(!((scope) == (__extension__ ({ struct lang_decl *lt
= ((contains_struct_check ((cp_global_trees[CPTI_GLOBAL]), (
TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4413, __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
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4413, __FUNCTION__); &lt->u.ns; })->level))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4413, __FUNCTION__), 0 : 0))
;
4414
4415 if (ENABLE_SCOPE_CHECKING0)
4416 {
4417 indent (--binding_depth);
4418 cp_binding_level_debug (scope, LOCATION_LINE (input_location)((expand_location (input_location)).line),
4419 "leave");
4420 }
4421
4422 /* Move one nesting level up. */
4423 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= scope->level_chain;
4424
4425 /* Namespace-scopes are left most probably temporarily, not
4426 completely; they can be reopened later, e.g. in namespace-extension
4427 or any name binding activity that requires us to resume a
4428 namespace. For classes, we cache some binding levels. For other
4429 scopes, we just make the structure available for reuse. */
4430 if (scope->kind != sk_namespace
4431 && scope != previous_class_levelscope_chain->x_previous_class_level)
4432 {
4433 scope->level_chain = free_binding_level;
4434 gcc_assert (!ENABLE_SCOPE_CHECKING((void)(!(!0 || scope->binding_depth == binding_depth) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4435, __FUNCTION__), 0 : 0))
4435 || scope->binding_depth == binding_depth)((void)(!(!0 || scope->binding_depth == binding_depth) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4435, __FUNCTION__), 0 : 0))
;
4436 free_binding_level = scope;
4437 }
4438
4439 if (scope->kind == sk_class)
4440 {
4441 /* Reset DEFINING_CLASS_P to allow for reuse of a
4442 class-defining scope in a non-defining context. */
4443 scope->defining_class_p = 0;
4444
4445 /* Find the innermost enclosing class scope, and reset
4446 CLASS_BINDING_LEVEL appropriately. */
4447 class_binding_levelscope_chain->class_bindings = NULLnullptr;
4448 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)
4449 if (scope->kind == sk_class)
4450 {
4451 class_binding_levelscope_chain->class_bindings = scope;
4452 break;
4453 }
4454 }
4455
4456 return current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4457}
4458
4459/* When we exit a toplevel class scope, we save its binding level so
4460 that we can restore it quickly. Here, we've entered some other
4461 class, so we must invalidate our cache. */
4462
4463void
4464invalidate_class_lookup_cache (void)
4465{
4466 previous_class_levelscope_chain->x_previous_class_level->level_chain = free_binding_level;
4467 free_binding_level = previous_class_levelscope_chain->x_previous_class_level;
4468 previous_class_levelscope_chain->x_previous_class_level = NULLnullptr;
4469}
4470
4471static void
4472resume_scope (cp_binding_level* b)
4473{
4474 /* Resuming binding levels is meant only for namespaces,
4475 and those cannot nest into classes. */
4476 gcc_assert (!class_binding_level)((void)(!(!scope_chain->class_bindings) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4476, __FUNCTION__), 0 : 0))
;
4477 /* Also, resuming a non-directly nested namespace is a no-no. */
4478 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4478, __FUNCTION__), 0 : 0))
;
4479 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= b;
4480 if (ENABLE_SCOPE_CHECKING0)
4481 {
4482 b->binding_depth = binding_depth;
4483 indent (binding_depth);
4484 cp_binding_level_debug (b, LOCATION_LINE (input_location)((expand_location (input_location)).line), "resume");
4485 binding_depth++;
4486 }
4487}
4488
4489/* Return the innermost binding level that is not for a class scope. */
4490
4491static cp_binding_level *
4492innermost_nonclass_level (void)
4493{
4494 cp_binding_level *b;
4495
4496 b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4497 while (b->kind == sk_class)
4498 b = b->level_chain;
4499
4500 return b;
4501}
4502
4503/* We're defining an object of type TYPE. If it needs a cleanup, but
4504 we're not allowed to add any more objects with cleanups to the current
4505 scope, create a new binding level. */
4506
4507void
4508maybe_push_cleanup_level (tree type)
4509{
4510 if (type != error_mark_nodeglobal_trees[TI_ERROR_MARK]
4511 && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4511, __FUNCTION__))->type_common.lang_flag_4))
4512 && current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->more_cleanups_ok == 0)
4513 {
4514 begin_scope (sk_cleanup, NULLnullptr);
4515 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->statement_list = push_stmt_list ();
4516 }
4517}
4518
4519/* Return true if we are in the global binding level. */
4520
4521bool
4522global_bindings_p (void)
4523{
4524 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4524, __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
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4524, __FUNCTION__); &lt->u.ns; })->level))
;
4525}
4526
4527/* True if we are currently in a toplevel binding level. This
4528 means either the global binding level or a namespace in a toplevel
4529 binding level. Since there are no non-toplevel namespace levels,
4530 this really means any namespace or template parameter level. We
4531 also include a class whose context is toplevel. */
4532
4533bool
4534toplevel_bindings_p (void)
4535{
4536 cp_binding_level *b = innermost_nonclass_level ();
4537
4538 return b->kind == sk_namespace || b->kind == sk_template_parms;