Bug Summary

File:build/gcc/cp/name-lookup.c
Warning:line 2363, column 7
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 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/13.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/11/../../../../include/c++/11 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../include/c++/11/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../include/c++/11/backward -internal-isystem /usr/lib64/clang/13.0.0/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/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 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2021-11-20-133755-20252-1/report-_rT0Wf.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 /* Check monotonicity. */
371 gcc_checking_assert (last[off ? 0 : -1]((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 374, __FUNCTION__), 0 : 0))
372 .indices[off ? off - 1((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 374, __FUNCTION__), 0 : 0))
373 : BINDING_VECTOR_SLOTS_PER_CLUSTER - 1]((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 374, __FUNCTION__), 0 : 0))
374 .base < ix)((void)(!(last[off ? 0 : -1] .indices[off ? off - 1 : 2 - 1] .
base < ix) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 374, __FUNCTION__), 0 : 0))
;
375 return &last->slots[off];
376 }
377
378 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 378, __FUNCTION__))
;
379}
380
381/* Add DECL to the list of things declared in binding level B. */
382
383static void
384add_decl_to_level (cp_binding_level *b, tree decl)
385{
386 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"
, 386, __FUNCTION__), 0 : 0))
;
387
388 /* Make sure we don't create a circular list. xref_tag can end
389 up pushing the same artificial decl more than once. We
390 should have already detected that in update_binding. (This isn't a
391 complete verification of non-circularity.) */
392 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"
, 392, __FUNCTION__), 0 : 0))
;
393
394 /* We build up the list in reverse order, and reverse it later if
395 necessary. */
396 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"
, 396, __FUNCTION__))->common.chain)
= b->names;
397 b->names = decl;
398
399 /* If appropriate, add decl to separate list of statics. We include
400 extern variables because they might turn out to be static later.
401 It's OK for this list to contain a few false positives. */
402 if (b->kind == sk_namespace
403 && ((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"
, 403, __FUNCTION__))->decl_common.decl_flag_1)
))
404 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
405 && (!TREE_PUBLIC (decl)((decl)->base.public_flag)
406 || decl_anon_ns_mem_p (decl)
407 || DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 407, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
))))
408 vec_safe_push (static_decls, decl);
409}
410
411/* Find the binding for NAME in the local binding level B. */
412
413static cxx_binding *
414find_local_binding (cp_binding_level *b, tree name)
415{
416 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"
, 416, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
)
417 for (;; b = b->level_chain)
418 {
419 if (binding->scope == b)
420 return binding;
421
422 /* Cleanup contours are transparent to the language. */
423 if (b->kind != sk_cleanup)
424 break;
425 }
426 return NULLnullptr;
427}
428
429class name_lookup
430{
431public:
432 typedef std::pair<tree, tree> using_pair;
433 typedef vec<using_pair, va_heap, vl_embed> using_queue;
434
435public:
436 tree name; /* The identifier being looked for. */
437
438 /* Usually we just add things to the VALUE binding, but we record
439 (hidden) IMPLICIT_TYPEDEFs on the type binding, which is used for
440 using-decl resolution. */
441 tree value; /* A (possibly ambiguous) set of things found. */
442 tree type; /* A type that has been found. */
443
444 LOOK_want want; /* What kind of entity we want. */
445
446 bool deduping; /* Full deduping is needed because using declarations
447 are in play. */
448 vec<tree, va_heap, vl_embed> *scopes;
449 name_lookup *previous; /* Previously active lookup. */
450
451protected:
452 /* Marked scope stack for outermost name lookup. */
453 static vec<tree, va_heap, vl_embed> *shared_scopes;
454 /* Currently active lookup. */
455 static name_lookup *active;
456
457public:
458 name_lookup (tree n, LOOK_want w = LOOK_want::NORMAL)
459 : name (n), value (NULL_TREE(tree) nullptr), type (NULL_TREE(tree) nullptr),
460 want (w),
461 deduping (false), scopes (NULLnullptr), previous (NULLnullptr)
462 {
463 preserve_state ();
464 }
465 ~name_lookup ()
466 {
467 gcc_checking_assert (!deduping)((void)(!(!deduping) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 467, __FUNCTION__), 0 : 0))
;
468 restore_state ();
469 }
470
471private: /* Uncopyable, unmovable, unassignable. I am a rock. */
472 name_lookup (const name_lookup &);
473 name_lookup &operator= (const name_lookup &);
474
475 public:
476 /* Turn on or off deduping mode. */
477 void dedup (bool state)
478 {
479 if (deduping != state)
480 {
481 deduping = state;
482 lookup_mark (value, state);
483 }
484 }
485
486protected:
487 static bool seen_p (tree scope)
488 {
489 return LOOKUP_SEEN_P (scope)((scope)->base.visited);
490 }
491 static bool found_p (tree scope)
492 {
493 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"
, 493, __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"
, 493, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
;
494 }
495
496 void mark_seen (tree scope); /* Mark and add to scope vector. */
497 static void mark_found (tree scope)
498 {
499 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"
, 499, __FUNCTION__), 0 : 0))
;
500 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"
, 500, __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"
, 500, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
501 }
502 bool see_and_mark (tree scope)
503 {
504 bool ret = seen_p (scope);
505 if (!ret)
506 mark_seen (scope);
507 return ret;
508 }
509 bool find_and_mark (tree scope);
510
511private:
512 void preserve_state ();
513 void restore_state ();
514
515private:
516 static tree ambiguous (tree thing, tree current);
517 void add_overload (tree fns);
518 void add_value (tree new_val);
519 void add_type (tree new_type);
520 bool process_binding (tree val_bind, tree type_bind);
521 unsigned process_module_binding (tree val_bind, tree type_bind, unsigned);
522 /* Look in only namespace. */
523 bool search_namespace_only (tree scope);
524 /* Look in namespace and its (recursive) inlines. Ignore using
525 directives. Return true if something found (inc dups). */
526 bool search_namespace (tree scope);
527 /* Look in the using directives of namespace + inlines using
528 qualified lookup rules. */
529 bool search_usings (tree scope);
530
531private:
532 using_queue *queue_namespace (using_queue *queue, int depth, tree scope);
533 using_queue *do_queue_usings (using_queue *queue, int depth,
534 vec<tree, va_gc> *usings);
535 using_queue *queue_usings (using_queue *queue, int depth,
536 vec<tree, va_gc> *usings)
537 {
538 if (usings)
539 queue = do_queue_usings (queue, depth, usings);
540 return queue;
541 }
542
543private:
544 void add_fns (tree);
545
546 private:
547 void adl_expr (tree);
548 void adl_type (tree);
549 void adl_template_arg (tree);
550 void adl_class (tree);
551 void adl_enum (tree);
552 void adl_bases (tree);
553 void adl_class_only (tree);
554 void adl_namespace (tree);
555 void adl_class_fns (tree);
556 void adl_namespace_fns (tree, bitmap);
557
558public:
559 /* Search namespace + inlines + maybe usings as qualified lookup. */
560 bool search_qualified (tree scope, bool usings = true);
561
562 /* Search namespace + inlines + usings as unqualified lookup. */
563 bool search_unqualified (tree scope, cp_binding_level *);
564
565 /* ADL lookup of ARGS. */
566 tree search_adl (tree fns, vec<tree, va_gc> *args);
567};
568
569/* Scope stack shared by all outermost lookups. This avoids us
570 allocating and freeing on every single lookup. */
571vec<tree, va_heap, vl_embed> *name_lookup::shared_scopes;
572
573/* Currently active lookup. */
574name_lookup *name_lookup::active;
575
576/* Name lookup is recursive, becase ADL can cause template
577 instatiation. This is of course a rare event, so we optimize for
578 it not happening. When we discover an active name-lookup, which
579 must be an ADL lookup, we need to unmark the marked scopes and also
580 unmark the lookup we might have been accumulating. */
581
582void
583name_lookup::preserve_state ()
584{
585 previous = active;
586 if (previous)
587 {
588 unsigned length = vec_safe_length (previous->scopes);
589 vec_safe_reserve (previous->scopes, length * 2);
590 for (unsigned ix = length; ix--;)
591 {
592 tree decl = (*previous->scopes)[ix];
593
594 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"
, 594, __FUNCTION__), 0 : 0))
;
595 LOOKUP_SEEN_P (decl)((decl)->base.visited) = false;
596
597 /* Preserve the FOUND_P state on the interrupted lookup's
598 stack. */
599 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"
, 599, __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"
, 599, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
)
600 {
601 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"
, 601, __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"
, 601, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= false;
602 previous->scopes->quick_push (decl);
603 }
604 }
605
606 /* Unmark the outer partial lookup. */
607 if (previous->deduping)
608 lookup_mark (previous->value, false);
609 }
610 else
611 scopes = shared_scopes;
612 active = this;
613}
614
615/* Restore the marking state of a lookup we interrupted. */
616
617void
618name_lookup::restore_state ()
619{
620 gcc_checking_assert (!deduping)((void)(!(!deduping) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 620, __FUNCTION__), 0 : 0))
;
621
622 /* Unmark and empty this lookup's scope stack. */
623 for (unsigned ix = vec_safe_length (scopes); ix--;)
624 {
625 tree decl = scopes->pop ();
626 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"
, 626, __FUNCTION__), 0 : 0))
;
627 LOOKUP_SEEN_P (decl)((decl)->base.visited) = false;
628 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"
, 628, __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"
, 628, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= false;
629 }
630
631 active = previous;
632 if (previous)
633 {
634 free (scopes);
635
636 unsigned length = vec_safe_length (previous->scopes);
637 for (unsigned ix = 0; ix != length; ix++)
638 {
639 tree decl = (*previous->scopes)[ix];
640 if (LOOKUP_SEEN_P (decl)((decl)->base.visited))
641 {
642 /* The remainder of the scope stack must be recording
643 FOUND_P decls, which we want to pop off. */
644 do
645 {
646 tree decl = previous->scopes->pop ();
647 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"
, 648, __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"
, 648, __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"
, 648, __FUNCTION__), 0 : 0))
648 && !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"
, 648, __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"
, 648, __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"
, 648, __FUNCTION__), 0 : 0))
;
649 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"
, 649, __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"
, 649, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
650 }
651 while (++ix != length);
652 break;
653 }
654
655 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"
, 655, __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"
, 655, __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"
, 655, __FUNCTION__), 0 : 0))
;
656 LOOKUP_SEEN_P (decl)((decl)->base.visited) = true;
657 }
658
659 /* Remark the outer partial lookup. */
660 if (previous->deduping)
661 lookup_mark (previous->value, true);
662 }
663 else
664 shared_scopes = scopes;
665}
666
667void
668name_lookup::mark_seen (tree scope)
669{
670 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"
, 670, __FUNCTION__), 0 : 0))
;
671 LOOKUP_SEEN_P (scope)((scope)->base.visited) = true;
672 vec_safe_push (scopes, scope);
673}
674
675bool
676name_lookup::find_and_mark (tree scope)
677{
678 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"
, 678, __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"
, 678, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
;
679 if (!result)
680 {
681 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"
, 681, __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"
, 681, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
= true;
682 if (!LOOKUP_SEEN_P (scope)((scope)->base.visited))
683 vec_safe_push (scopes, scope);
684 }
685
686 return result;
687}
688
689/* THING and CURRENT are ambiguous, concatenate them. */
690
691tree
692name_lookup::ambiguous (tree thing, tree current)
693{
694 if (TREE_CODE (current)((enum tree_code) (current)->base.code) != TREE_LIST)
695 {
696 current = build_tree_list (NULL_TREE(tree) nullptr, current);
697 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"
, 697, __FUNCTION__))->typed.type)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
698 }
699 current = tree_cons (NULL_TREE(tree) nullptr, thing, current);
700 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"
, 700, __FUNCTION__))->typed.type)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
701
702 return current;
703}
704
705/* FNS is a new overload set to add to the exising set. */
706
707void
708name_lookup::add_overload (tree fns)
709{
710 if (!deduping && TREE_CODE (fns)((enum tree_code) (fns)->base.code) == OVERLOAD)
711 {
712 tree probe = fns;
713 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
714 probe = ovl_skip_hidden (probe);
715 if (probe && TREE_CODE (probe)((enum tree_code) (probe)->base.code) == OVERLOAD
716 && 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"
, 716, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 716, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
717 /* We're about to add something found by multiple paths, so need to
718 engage deduping mode. */
719 dedup (true);
720 }
721
722 value = lookup_maybe_add (fns, value, deduping);
723}
724
725/* Add a NEW_VAL, a found value binding into the current value binding. */
726
727void
728name_lookup::add_value (tree new_val)
729{
730 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)
))
731 add_overload (new_val);
732 else if (!value)
733 value = new_val;
734 else if (value == new_val)
735 ;
736 else if ((TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL
737 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == TYPE_DECL
738 && 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"
, 738, __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"
, 738, __FUNCTION__))->typed.type)), 0)
))
739 /* Typedefs to the same type. */;
740 else if (TREE_CODE (value)((enum tree_code) (value)->base.code) == NAMESPACE_DECL
741 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == NAMESPACE_DECL
742 && 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"
, 742, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 742, __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"
, 742, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 742, __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"
, 742, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 742, __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"
, 742, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 742, __FUNCTION__))->decl_common.abstract_origin) : (new_val
))
)
743 /* Namespace (possibly aliased) to the same namespace. Locate
744 the namespace*/
745 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"
, 745, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 745, __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"
, 745, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 745, __FUNCTION__))->decl_common.abstract_origin) : (value
))
;
746 else
747 {
748 /* Disengage deduping mode. */
749 dedup (false);
750 value = ambiguous (new_val, value);
751 }
752}
753
754/* Add a NEW_TYPE, a found type binding into the current type binding. */
755
756void
757name_lookup::add_type (tree new_type)
758{
759 if (!type)
760 type = new_type;
761 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == TREE_LIST
762 || !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"
, 762, __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"
, 762, __FUNCTION__))->typed.type)), 0)
)
763 type = ambiguous (new_type, type);
764}
765
766/* Process a found binding containing NEW_VAL and NEW_TYPE. Returns
767 true if we actually found something noteworthy. Hiddenness has
768 already been handled in the caller. */
769
770bool
771name_lookup::process_binding (tree new_val, tree new_type)
772{
773 /* Did we really see a type? */
774 if (new_type
775 && (want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::NAMESPACE)
776 new_type = NULL_TREE(tree) nullptr;
777
778 /* Do we really see a value? */
779 if (new_val)
780 switch (TREE_CODE (new_val)((enum tree_code) (new_val)->base.code))
781 {
782 case TEMPLATE_DECL:
783 /* If we expect types or namespaces, and not templates,
784 or this is not a template class. */
785 if (bool (want & LOOK_want::TYPE_NAMESPACE)
786 && !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"
, 786, __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"
, 786, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == TYPE_DECL)
)
787 new_val = NULL_TREE(tree) nullptr;
788 break;
789 case TYPE_DECL:
790 if ((want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::NAMESPACE
791 || (new_type && bool (want & LOOK_want::TYPE)))
792 new_val = NULL_TREE(tree) nullptr;
793 break;
794 case NAMESPACE_DECL:
795 if ((want & LOOK_want::TYPE_NAMESPACE) == LOOK_want::TYPE)
796 new_val = NULL_TREE(tree) nullptr;
797 break;
798 default:
799 if (bool (want & LOOK_want::TYPE_NAMESPACE))
800 new_val = NULL_TREE(tree) nullptr;
801 }
802
803 if (!new_val)
804 {
805 new_val = new_type;
806 new_type = NULL_TREE(tree) nullptr;
807 }
808
809 /* Merge into the lookup */
810 if (new_val)
811 add_value (new_val);
812 if (new_type)
813 add_type (new_type);
814
815 return new_val != NULL_TREE(tree) nullptr;
816}
817
818/* If we're importing a module containing this binding, add it to the
819 lookup set. The trickiness is with namespaces, we only want to
820 find it once. */
821
822unsigned
823name_lookup::process_module_binding (tree new_val, tree new_type,
824 unsigned marker)
825{
826 /* Optimize for (re-)finding a public namespace. We only need to
827 look once. */
828 if (new_val && !new_type
829 && TREE_CODE (new_val)((enum tree_code) (new_val)->base.code) == NAMESPACE_DECL
830 && TREE_PUBLIC (new_val)((new_val)->base.public_flag)
831 && !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"
, 831, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 831, __FUNCTION__))->decl_common.abstract_origin)
)
832 {
833 if (marker & 2)
834 return marker;
835 marker |= 2;
836 }
837
838 if (new_type || new_val)
839 marker |= process_binding (new_val, new_type);
840
841 return marker;
842}
843
844/* Look in exactly namespace SCOPE. */
845
846bool
847name_lookup::search_namespace_only (tree scope)
848{
849 bool found = false;
850 if (tree *binding = find_namespace_slot (scope, name))
851 {
852 tree val = *binding;
853 if (TREE_CODE (val)((enum tree_code) (val)->base.code) == BINDING_VECTOR)
854 {
855 /* I presume the binding list is going to be sparser than
856 the import bitmap. Hence iterate over the former
857 checking for bits set in the bitmap. */
858 bitmap imports = get_import_bitmap ();
859 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"
, 859, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
860 int marker = 0;
861 int dup_detect = 0;
862
863 if (tree bind = cluster->slots[BINDING_SLOT_CURRENT])
864 {
865 if (!deduping)
866 {
867 if (named_module_purview_p ())
868 {
869 dup_detect |= 2;
870
871 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"
, 871, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 871, __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"
, 871, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
872 dup_detect |= 1;
873 }
874 else
875 dup_detect |= 1;
876 }
877 tree type = NULL_TREE(tree) nullptr;
878 tree value = bind;
879
880 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"
, 880, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 880, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
881 {
882 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"
, 882, __FUNCTION__))->typed.type)
;
883 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"
, 883, __FUNCTION__, (OVERLOAD))))->function)
;
884
885 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
886 {
887 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"
, 887, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 887, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
888 type = NULL_TREE(tree) nullptr;
889 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"
, 889, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 889, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
890 value = NULL_TREE(tree) nullptr;
891 else
892 value = ovl_skip_hidden (value);
893 }
894 }
895 else if (!bool (want & LOOK_want::HIDDEN_FRIEND))
896 value = ovl_skip_hidden (value);
897
898 marker = process_module_binding (value, type, marker);
899 }
900
901 /* Scan the imported bindings. */
902 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"
, 902, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
903 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
904 {
905 ix--;
906 cluster++;
907 }
908
909 /* Do this in forward order, so we load modules in an order
910 the user expects. */
911 for (; ix--; cluster++)
912 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
913 {
914 /* Are we importing this module? */
915 if (unsigned base = cluster->indices[jx].base)
916 if (unsigned span = cluster->indices[jx].span)
917 do
918 if (bitmap_bit_p (imports, base))
919 goto found;
920 while (++base, --span);
921 continue;
922
923 found:;
924 /* Is it loaded? */
925 if (cluster->slots[jx].is_lazy ())
926 {
927 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"
, 927, __FUNCTION__), 0 : 0))
;
928 lazy_load_binding (cluster->indices[jx].base,
929 scope, name, &cluster->slots[jx]);
930 }
931 tree bind = cluster->slots[jx];
932 if (!bind)
933 /* Load errors could mean there's nothing here. */
934 continue;
935
936 /* Extract what we can see from here. If there's no
937 stat_hack, then everything was exported. */
938 tree type = NULL_TREE(tree) nullptr;
939
940
941 /* If STAT_HACK_P is false, everything is visible, and
942 there's no duplication possibilities. */
943 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"
, 943, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 943, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
944 {
945 if (!deduping)
946 {
947 /* Do we need to engage deduplication? */
948 int dup = 0;
949 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"
, 949, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
950 dup = 1;
951 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"
, 951, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
952 dup = 2;
953 if (unsigned hit = dup_detect & dup)
954 {
955 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"
, 955, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag)
)
956 || (hit & 2
957 && 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"
, 957, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
))
958 dedup (true);
959 }
960 dup_detect |= dup;
961 }
962
963 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"
, 963, __FUNCTION__, (OVERLOAD))))->base.used_flag)
)
964 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"
, 964, __FUNCTION__))->typed.type)
;
965 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"
, 965, __FUNCTION__, (OVERLOAD))))->common.chain)
;
966 }
967
968 /* And process it. */
969 marker = process_module_binding (bind, type, marker);
970 }
971 found |= marker & 1;
972 }
973 else
974 {
975 /* Only a current module binding, visible from the current module. */
976 tree bind = *binding;
977 tree value = bind, type = NULL_TREE(tree) nullptr;
978
979 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"
, 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_4))
)
980 {
981 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"
, 981, __FUNCTION__))->typed.type)
;
982 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"
, 982, __FUNCTION__, (OVERLOAD))))->function)
;
983
984 if (!bool (want & LOOK_want::HIDDEN_FRIEND))
985 {
986 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"
, 986, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 986, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
987 type = NULL_TREE(tree) nullptr;
988 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"
, 988, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 988, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
989 value = NULL_TREE(tree) nullptr;
990 else
991 value = ovl_skip_hidden (value);
992 }
993 }
994 else if (!bool (want & LOOK_want::HIDDEN_FRIEND))
995 value = ovl_skip_hidden (value);
996
997 found |= process_binding (value, type);
998 }
999 }
1000
1001 return found;
1002}
1003
1004/* Conditionally look in namespace SCOPE and inline children. */
1005
1006bool
1007name_lookup::search_namespace (tree scope)
1008{
1009 if (see_and_mark (scope))
1010 /* We've visited this scope before. Return what we found then. */
1011 return found_p (scope);
1012
1013 /* Look in exactly namespace. */
1014 bool found = search_namespace_only (scope);
1015
1016 /* Don't look into inline children, if we're looking for an
1017 anonymous name -- it must be in the current scope, if anywhere. */
1018 if (name)
1019 /* Recursively look in its inline children. */
1020 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"
, 1020, __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"
, 1020, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1021 for (unsigned ix = inlinees->length (); ix--;)
1022 found |= search_namespace ((*inlinees)[ix]);
1023
1024 if (found)
1025 mark_found (scope);
1026
1027 return found;
1028}
1029
1030/* Recursively follow using directives of SCOPE & its inline children.
1031 Such following is essentially a flood-fill algorithm. */
1032
1033bool
1034name_lookup::search_usings (tree scope)
1035{
1036 /* We do not check seen_p here, as that was already set during the
1037 namespace_only walk. */
1038 if (found_p (scope))
1039 return true;
1040
1041 bool found = false;
1042 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"
, 1042, __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"
, 1042, __FUNCTION__); &lt->u.ns; })->level)
->using_directives)
1043 for (unsigned ix = usings->length (); ix--;)
1044 found |= search_qualified ((*usings)[ix], true);
1045
1046 /* Look in its inline children. */
1047 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"
, 1047, __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"
, 1047, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1048 for (unsigned ix = inlinees->length (); ix--;)
1049 found |= search_usings ((*inlinees)[ix]);
1050
1051 if (found)
1052 mark_found (scope);
1053
1054 return found;
1055}
1056
1057/* Qualified namespace lookup in SCOPE.
1058 1) Look in SCOPE (+inlines). If found, we're done.
1059 2) Otherwise, if USINGS is true,
1060 recurse for every using directive of SCOPE (+inlines).
1061
1062 Trickiness is (a) loops and (b) multiple paths to same namespace.
1063 In both cases we want to not repeat any lookups, and know whether
1064 to stop the caller's step #2. Do this via the FOUND_P marker. */
1065
1066bool
1067name_lookup::search_qualified (tree scope, bool usings)
1068{
1069 bool found = false;
1070
1071 if (seen_p (scope))
1072 found = found_p (scope);
1073 else
1074 {
1075 found = search_namespace (scope);
1076 if (!found && usings)
1077 found = search_usings (scope);
1078 }
1079
1080 dedup (false);
1081
1082 return found;
1083}
1084
1085/* Add SCOPE to the unqualified search queue, recursively add its
1086 inlines and those via using directives. */
1087
1088name_lookup::using_queue *
1089name_lookup::queue_namespace (using_queue *queue, int depth, tree scope)
1090{
1091 if (see_and_mark (scope))
1092 return queue;
1093
1094 /* Record it. */
1095 tree common = scope;
1096 while (SCOPE_DEPTH (common)((tree_check ((common), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1096, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
> depth)
1097 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"
, 1097, __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"
, 1097, __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"
, 1097, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1098 vec_safe_push (queue, using_pair (common, scope));
1099
1100 /* Queue its inline children. */
1101 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"
, 1101, __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"
, 1101, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1102 for (unsigned ix = inlinees->length (); ix--;)
1103 queue = queue_namespace (queue, depth, (*inlinees)[ix]);
1104
1105 /* Queue its using targets. */
1106 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"
, 1106, __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"
, 1106, __FUNCTION__); &lt->u.ns; })->level)
->using_directives);
1107
1108 return queue;
1109}
1110
1111/* Add the namespaces in USINGS to the unqualified search queue. */
1112
1113name_lookup::using_queue *
1114name_lookup::do_queue_usings (using_queue *queue, int depth,
1115 vec<tree, va_gc> *usings)
1116{
1117 for (unsigned ix = usings->length (); ix--;)
1118 queue = queue_namespace (queue, depth, (*usings)[ix]);
1119
1120 return queue;
1121}
1122
1123/* Unqualified namespace lookup in SCOPE.
1124 1) add scope+inlins to worklist.
1125 2) recursively add target of every using directive
1126 3) for each worklist item where SCOPE is common ancestor, search it
1127 4) if nothing find, scope=parent, goto 1. */
1128
1129bool
1130name_lookup::search_unqualified (tree scope, cp_binding_level *level)
1131{
1132 /* Make static to avoid continual reallocation. We're not
1133 recursive. */
1134 static using_queue *queue = NULLnullptr;
1135 bool found = false;
1136 int length = vec_safe_length (queue);
1137
1138 /* Queue local using-directives. */
1139 for (; level->kind != sk_namespace; level = level->level_chain)
1140 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"
, 1140, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
, level->using_directives);
1141
1142 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"
, 1142, __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"
, 1142, __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"
, 1142, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
)
1143 {
1144 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"
, 1144, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1144, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1144, __FUNCTION__), 0 : 0))
;
1145 int depth = SCOPE_DEPTH (scope)((tree_check ((scope), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1145, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
;
1146
1147 /* Queue namespaces reachable from SCOPE. */
1148 queue = queue_namespace (queue, depth, scope);
1149
1150 /* Search every queued namespace where SCOPE is the common
1151 ancestor. Adjust the others. */
1152 unsigned ix = length;
1153 do
1154 {
1155 using_pair &pair = (*queue)[ix];
1156 while (pair.first == scope)
1157 {
1158 found |= search_namespace_only (pair.second);
1159 pair = queue->pop ();
1160 if (ix == queue->length ())
1161 goto done;
1162 }
1163 /* The depth is the same as SCOPE, find the parent scope. */
1164 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"
, 1164, __FUNCTION__, (NAMESPACE_DECL)))->base.u.bits.address_space
)
== depth)
1165 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"
, 1165, __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"
, 1165, __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"
, 1165, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1166 ix++;
1167 }
1168 while (ix < queue->length ());
1169 done:;
1170 if (scope == global_namespacecp_global_trees[CPTI_GLOBAL])
1171 break;
1172
1173 /* If looking for hidden friends, we only look in the innermost
1174 namespace scope. [namespace.memdef]/3 If a friend
1175 declaration in a non-local class first declares a class,
1176 function, class template or function template the friend is a
1177 member of the innermost enclosing namespace. See also
1178 [basic.lookup.unqual]/7 */
1179 if (bool (want & LOOK_want::HIDDEN_FRIEND))
1180 break;
1181 }
1182
1183 dedup (false);
1184
1185 /* Restore to incoming length. */
1186 vec_safe_truncate (queue, length);
1187
1188 return found;
1189}
1190
1191/* FNS is a value binding. If it is a (set of overloaded) functions,
1192 add them into the current value. */
1193
1194void
1195name_lookup::add_fns (tree fns)
1196{
1197 if (!fns)
1198 return;
1199 else if (TREE_CODE (fns)((enum tree_code) (fns)->base.code) == OVERLOAD)
1200 {
1201 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"
, 1201, __FUNCTION__))->typed.type)
!= unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE])
1202 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"
, 1202, __FUNCTION__, (OVERLOAD))))->function)
;
1203 }
1204 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"
, 1204, __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"
, 1204, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
1205 return;
1206
1207 add_overload (fns);
1208}
1209
1210/* Add the overloaded fns of SCOPE. */
1211
1212void
1213name_lookup::adl_namespace_fns (tree scope, bitmap imports)
1214{
1215 if (tree *binding = find_namespace_slot (scope, name))
1216 {
1217 tree val = *binding;
1218 if (TREE_CODE (val)((enum tree_code) (val)->base.code) != BINDING_VECTOR)
1219 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"
, 1219, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1219, __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"
, 1219, __FUNCTION__, (OVERLOAD))))->function) : val)
));
1220 else
1221 {
1222 /* I presume the binding list is going to be sparser than
1223 the import bitmap. Hence iterate over the former
1224 checking for bits set in the bitmap. */
1225 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"
, 1225, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
1226 int dup_detect = 0;
1227
1228 if (tree bind = cluster->slots[BINDING_SLOT_CURRENT])
1229 {
1230 /* The current TU's bindings must be visible, we don't
1231 need to check the bitmaps. */
1232
1233 if (!deduping)
1234 {
1235 if (named_module_purview_p ())
1236 {
1237 dup_detect |= 2;
1238
1239 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"
, 1239, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1239, __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"
, 1239, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
1240 dup_detect |= 1;
1241 }
1242 else
1243 dup_detect |= 1;
1244 }
1245
1246 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"
, 1246, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1246, __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"
, 1246, __FUNCTION__, (OVERLOAD))))->function) : bind)
));
1247 }
1248
1249 /* Scan the imported bindings. */
1250 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"
, 1250, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
1251 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
1252 {
1253 ix--;
1254 cluster++;
1255 }
1256
1257 /* Do this in forward order, so we load modules in an order
1258 the user expects. */
1259 for (; ix--; cluster++)
1260 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
1261 {
1262 /* Functions are never on merged slots. */
1263 if (!cluster->indices[jx].base
1264 || cluster->indices[jx].span != 1)
1265 continue;
1266
1267 /* Is this slot visible? */
1268 if (!bitmap_bit_p (imports, cluster->indices[jx].base))
1269 continue;
1270
1271 /* Is it loaded. */
1272 if (cluster->slots[jx].is_lazy ())
1273 lazy_load_binding (cluster->indices[jx].base,
1274 scope, name, &cluster->slots[jx]);
1275
1276 tree bind = cluster->slots[jx];
1277 if (!bind)
1278 /* Load errors could mean there's nothing here. */
1279 continue;
1280
1281 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"
, 1281, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1281, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1282 {
1283 if (!deduping)
1284 {
1285 /* Do we need to engage deduplication? */
1286 int dup = 0;
1287 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"
, 1287, __FUNCTION__, (OVERLOAD)))->base.static_flag)
)
1288 dup = 1;
1289 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"
, 1289, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
1290 dup = 2;
1291 if (unsigned hit = dup_detect & dup)
1292 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"
, 1292, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag
)
)
1293 || (hit & 2
1294 && 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"
, 1294, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
))
1295 dedup (true);
1296 dup_detect |= dup;
1297 }
1298
1299 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"
, 1299, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1300 }
1301
1302 add_fns (bind);
1303 }
1304 }
1305 }
1306}
1307
1308/* Add the hidden friends of SCOPE. */
1309
1310void
1311name_lookup::adl_class_fns (tree type)
1312{
1313 /* Add friends. */
1314 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"
, 1314, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1314, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1314, __FUNCTION__))->common.chain)))), (TS_DECL_COMMON)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1314, __FUNCTION__))->decl_common.initial))
;
1315 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"
, 1315, __FUNCTION__))->common.chain)
)
1316 if (name == FRIEND_NAME (list)(((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1316, __FUNCTION__, (TREE_LIST)))->list.purpose))
)
1317 {
1318 tree context = NULL_TREE(tree) nullptr; /* Lazily computed. */
1319 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"
, 1319, __FUNCTION__, (TREE_LIST)))->list.value))
; friends;
1320 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"
, 1320, __FUNCTION__))->common.chain)
)
1321 {
1322 tree fn = TREE_VALUE (friends)((tree_check ((friends), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1322, __FUNCTION__, (TREE_LIST)))->list.value)
;
1323
1324 /* Only interested in global functions with potentially hidden
1325 (i.e. unqualified) declarations. */
1326 if (!context)
1327 context = decl_namespace_context (type);
1328 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"
, 1328, __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"
, 1328, __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"
, 1328, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
!= context)
1329 continue;
1330
1331 dedup (true);
1332
1333 /* Template specializations are never found by name lookup.
1334 (Templates themselves can be found, but not template
1335 specializations.) */
1336 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"
, 1336, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
)
1337 continue;
1338
1339 add_fns (fn);
1340 }
1341 }
1342}
1343
1344/* Find the containing non-inlined namespace, add it and all its
1345 inlinees. */
1346
1347void
1348name_lookup::adl_namespace (tree scope)
1349{
1350 if (see_and_mark (scope))
1351 return;
1352
1353 /* Look down into inline namespaces. */
1354 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"
, 1354, __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"
, 1354, __FUNCTION__); &lt->u.ns; })->inlinees)
)
1355 for (unsigned ix = inlinees->length (); ix--;)
1356 adl_namespace ((*inlinees)[ix]);
1357
1358 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"
, 1358, __FUNCTION__, (NAMESPACE_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1358, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
1359 /* Mark parent. */
1360 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"
, 1360, __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"
, 1360, __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"
, 1360, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
);
1361}
1362
1363/* Adds the class and its friends to the lookup structure. */
1364
1365void
1366name_lookup::adl_class_only (tree type)
1367{
1368 /* Backend-built structures, such as __builtin_va_list, aren't
1369 affected by all this. */
1370 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"
, 1370, __FUNCTION__))->type_common.lang_flag_5))
)
1371 return;
1372
1373 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"
, 1373, __FUNCTION__))->type_common.main_variant)
;
1374
1375 if (see_and_mark (type))
1376 return;
1377
1378 tree context = decl_namespace_context (type);
1379 adl_namespace (context);
1380}
1381
1382/* Adds the class and its bases to the lookup structure.
1383 Returns true on error. */
1384
1385void
1386name_lookup::adl_bases (tree type)
1387{
1388 adl_class_only (type);
1389
1390 /* Process baseclasses. */
1391 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"
, 1391, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.maxval)
)
1392 {
1393 tree base_binfo;
1394 int i;
1395
1396 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"
, 1396, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)->
iterate ((i), &(base_binfo)))
; i++)
1397 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"
, 1397, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1397, __FUNCTION__))->typed.type)
);
1398 }
1399}
1400
1401/* Adds everything associated with a class argument type to the lookup
1402 structure.
1403
1404 If T is a class type (including unions), its associated classes are: the
1405 class itself; the class of which it is a member, if any; and its direct
1406 and indirect base classes. Its associated namespaces are the namespaces
1407 of which its associated classes are members. Furthermore, if T is a
1408 class template specialization, its associated namespaces and classes
1409 also include: the namespaces and classes associated with the types of
1410 the template arguments provided for template type parameters (excluding
1411 template template parameters); the namespaces of which any template
1412 template arguments are members; and the classes of which any member
1413 templates used as template template arguments are members. [ Note:
1414 non-type template arguments do not contribute to the set of associated
1415 namespaces. --end note] */
1416
1417void
1418name_lookup::adl_class (tree type)
1419{
1420 /* Backend build structures, such as __builtin_va_list, aren't
1421 affected by all this. */
1422 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"
, 1422, __FUNCTION__))->type_common.lang_flag_5))
)
1423 return;
1424
1425 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"
, 1425, __FUNCTION__))->type_common.main_variant)
;
1426
1427 /* We don't set found here because we have to have set seen first,
1428 which is done in the adl_bases walk. */
1429 if (found_p (type))
1430 return;
1431
1432 complete_type (type);
1433 adl_bases (type);
1434 mark_found (type);
1435
1436 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"
, 1436, __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"
, 1436, __FUNCTION__))->type_common.context))->base.code
))] == tcc_type))
)
1437 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"
, 1437, __FUNCTION__))->type_common.context)
);
1438
1439 /* Process template arguments. */
1440 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"
, 1440, __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"
, 1440, __FUNCTION__))->type_non_common.lang_1))
1441 && 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"
, 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))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1441, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1441, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1441, __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"
, 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))))->tmpl))
)
1442 {
1443 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"
, 1443, __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"
, 1443, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1443, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
;
1444 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"
, 1444, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
1445 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"
, 1445, __FUNCTION__)))))
);
1446 }
1447}
1448
1449void
1450name_lookup::adl_enum (tree type)
1451{
1452 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"
, 1452, __FUNCTION__))->type_common.main_variant)
;
1453 if (see_and_mark (type))
1454 return;
1455
1456 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"
, 1456, __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"
, 1456, __FUNCTION__))->type_common.context))->base.code
))] == tcc_type))
)
1457 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"
, 1457, __FUNCTION__))->type_common.context)
);
1458 else
1459 adl_namespace (decl_namespace_context (type));
1460}
1461
1462void
1463name_lookup::adl_expr (tree expr)
1464{
1465 if (!expr)
1466 return;
1467
1468 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"
, 1468, __FUNCTION__), 0 : 0))
;
1469
1470 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"
, 1470, __FUNCTION__))->typed.type)
!= unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE])
1471 {
1472 adl_type (unlowered_expr_type (expr));
1473 return;
1474 }
1475
1476 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == ADDR_EXPR)
1477 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"
, 1477, __FUNCTION__)))))
;
1478 if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == COMPONENT_REF
1479 || TREE_CODE (expr)((enum tree_code) (expr)->base.code) == OFFSET_REF)
1480 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"
, 1480, __FUNCTION__)))))
;
1481 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"
, 1481, __FUNCTION__, (BASELINK))))->functions) : expr)
;
1482
1483 if (OVL_P (expr)(((enum tree_code) (expr)->base.code) == FUNCTION_DECL || (
(enum tree_code) (expr)->base.code) == OVERLOAD)
)
1484 for (lkp_iterator iter (expr); iter; ++iter)
1485 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"
, 1485, __FUNCTION__))->typed.type)
);
1486 else if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == TEMPLATE_ID_EXPR)
1487 {
1488 /* The working paper doesn't currently say how to handle
1489 template-id arguments. The sensible thing would seem to be
1490 to handle the list of template candidates like a normal
1491 overload set, and handle the template arguments like we do
1492 for class template specializations. */
1493
1494 /* First the templates. */
1495 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"
, 1495, __FUNCTION__)))))
);
1496
1497 /* Now the arguments. */
1498 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"
, 1498, __FUNCTION__)))))
)
1499 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"
, 1499, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ix--;)
1500 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"
, 1500, __FUNCTION__)))))
);
1501 }
1502}
1503
1504void
1505name_lookup::adl_type (tree type)
1506{
1507 if (!type)
1508 return;
1509
1510 if (TYPE_PTRDATAMEM_P (type)(((enum tree_code) (type)->base.code) == OFFSET_TYPE))
1511 {
1512 /* Pointer to member: associate class type and value type. */
1513 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"
, 1513, __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"
, 1513, __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"
, 1513, __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"
, 1513, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1513, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
);
1514 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"
, 1514, __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"
, 1514, __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"
, 1514, __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"
, 1514, __FUNCTION__))->typed.type))
);
1515 return;
1516 }
1517
1518 switch (TREE_CODE (type)((enum tree_code) (type)->base.code))
1519 {
1520 case RECORD_TYPE:
1521 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"
, 1521, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1521, __FUNCTION__))->type_common.lang_flag_2)))
)
1522 {
1523 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"
, 1523, __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"
, 1523, __FUNCTION__))->typed.type)), (cp_type_quals (type
)), tf_warning_or_error))
);
1524 return;
1525 }
1526 /* FALLTHRU */
1527 case UNION_TYPE:
1528 adl_class (type);
1529 return;
1530
1531 case METHOD_TYPE:
1532 /* The basetype is referenced in the first arg type, so just
1533 fall through. */
1534 case FUNCTION_TYPE:
1535 /* Associate the parameter types. */
1536 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"
, 1536, __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"
, 1536, __FUNCTION__))->common.chain)
)
1537 adl_type (TREE_VALUE (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1537, __FUNCTION__, (TREE_LIST)))->list.value)
);
1538 /* FALLTHROUGH */
1539
1540 case POINTER_TYPE:
1541 case REFERENCE_TYPE:
1542 case ARRAY_TYPE:
1543 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"
, 1543, __FUNCTION__))->typed.type)
);
1544 return;
1545
1546 case ENUMERAL_TYPE:
1547 adl_enum (type);
1548 return;
1549
1550 case LANG_TYPE:
1551 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"
, 1552, __FUNCTION__), 0 : 0))
1552 || 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"
, 1552, __FUNCTION__), 0 : 0))
;
1553 return;
1554
1555 case TYPE_PACK_EXPANSION:
1556 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"
, 1556, __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"
, 1556, __FUNCTION__))))))
);
1557 return;
1558
1559 default:
1560 break;
1561 }
1562}
1563
1564/* Adds everything associated with a template argument to the lookup
1565 structure. */
1566
1567void
1568name_lookup::adl_template_arg (tree arg)
1569{
1570 /* [basic.lookup.koenig]
1571
1572 If T is a template-id, its associated namespaces and classes are
1573 ... the namespaces and classes associated with the types of the
1574 template arguments provided for template type parameters
1575 (excluding template template parameters); the namespaces in which
1576 any template template arguments are defined; and the classes in
1577 which any member templates used as template template arguments
1578 are defined. [Note: non-type template arguments do not
1579 contribute to the set of associated namespaces. ] */
1580
1581 /* Consider first template template arguments. */
1582 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_TEMPLATE_PARM
1583 || TREE_CODE (arg)((enum tree_code) (arg)->base.code) == UNBOUND_CLASS_TEMPLATE)
1584 ;
1585 else if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL)
1586 {
1587 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"
, 1587, __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"
, 1587, __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"
, 1587, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1588
1589 /* It's not a member template. */
1590 if (TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) == NAMESPACE_DECL)
1591 adl_namespace (ctx);
1592 /* Otherwise, it must be member template. */
1593 else
1594 adl_class_only (ctx);
1595 }
1596 /* It's an argument pack; handle it recursively. */
1597 else if (ARGUMENT_PACK_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
|| ((enum tree_code) (arg)->base.code) == NONTYPE_ARGUMENT_PACK
)
)
1598 {
1599 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"
, 1599, __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"
, 1599, __FUNCTION__))))))
;
1600 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"
, 1600, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
1601 for (i = 0; i < len; ++i)
1602 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"
, 1602, __FUNCTION__)))))
);
1603 }
1604 /* It's not a template template argument, but it is a type template
1605 argument. */
1606 else if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code)
)] == tcc_type)
)
1607 adl_type (arg);
1608}
1609
1610/* Perform ADL lookup. FNS is the existing lookup result and ARGS are
1611 the call arguments. */
1612
1613tree
1614name_lookup::search_adl (tree fns, vec<tree, va_gc> *args)
1615{
1616 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"
, 1616, __FUNCTION__), 0 : 0))
;
1617
1618 /* Gather each associated entity onto the lookup's scope list. */
1619 unsigned ix;
1620 tree arg;
1621
1622 FOR_EACH_VEC_ELT_REVERSE (*args, ix, arg)for (ix = (*args).length () - 1; (*args).iterate ((ix), &
(arg)); (ix)--)
1623 /* OMP reduction operators put an ADL-significant type as the
1624 first arg. */
1625 if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code)
)] == tcc_type)
)
1626 adl_type (arg);
1627 else
1628 adl_expr (arg);
1629
1630 if (vec_safe_length (scopes))
1631 {
1632 /* Now do the lookups. */
1633 value = fns;
1634 if (fns)
1635 dedup (true);
1636
1637 /* INST_PATH will be NULL, if this is /not/ 2nd-phase ADL. */
1638 bitmap inst_path = NULLnullptr;
1639 /* VISIBLE is the regular import bitmap. */
1640 bitmap visible = visible_instantiation_path (&inst_path);
1641
1642 for (unsigned ix = scopes->length (); ix--;)
1643 {
1644 tree scope = (*scopes)[ix];
1645 if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) == NAMESPACE_DECL)
1646 adl_namespace_fns (scope, visible);
1647 else
1648 {
1649 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)
)
1650 adl_class_fns (scope);
1651
1652 /* During 2nd phase ADL: Any exported declaration D in N
1653 declared within the purview of a named module M
1654 (10.2) is visible if there is an associated entity
1655 attached to M with the same innermost enclosing
1656 non-inline namespace as D.
1657 [basic.lookup.argdep]/4.4 */
1658
1659 if (!inst_path)
1660 /* Not 2nd phase. */
1661 continue;
1662
1663 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"
, 1663, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1663, __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"
, 1663, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1663, __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"
, 1663, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1663, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
1664 if (TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) != NAMESPACE_DECL)
1665 /* Not namespace-scope class. */
1666 continue;
1667
1668 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"
, 1668, __FUNCTION__))->type_common.name)
);
1669 tree not_tmpl = STRIP_TEMPLATE (origin)(((enum tree_code) (origin)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((origin), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1669, __FUNCTION__, (TEMPLATE_DECL))))))))->result : origin
)
;
1670 if (!DECL_LANG_SPECIFIC (not_tmpl)((contains_struct_check ((not_tmpl), (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 (not_tmpl)(((contains_struct_check (((tree_not_check ((not_tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1671, __FUNCTION__, (TEMPLATE_DECL)))), (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 /* We must turn on deduping, because some other class
1695 from this module might also be in this namespace. */
1696 dedup (true);
1697
1698 /* Add the exported fns */
1699 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"
, 1699, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1699, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1700 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"
, 1700, __FUNCTION__, (OVERLOAD))))->common.chain)
);
1701 }
1702 }
1703 }
1704 }
1705
1706 fns = value;
1707 dedup (false);
1708 }
1709
1710 return fns;
1711}
1712
1713static bool qualified_namespace_lookup (tree, name_lookup *);
1714static void consider_binding_level (tree name,
1715 best_match <tree, const char *> &bm,
1716 cp_binding_level *lvl,
1717 bool look_within_fields,
1718 enum lookup_name_fuzzy_kind kind);
1719static void diagnose_name_conflict (tree, tree);
1720
1721/* ADL lookup of NAME. FNS is the result of regular lookup, and we
1722 don't add duplicates to it. ARGS is the vector of call
1723 arguments (which will not be empty). */
1724
1725tree
1726lookup_arg_dependent (tree name, tree fns, vec<tree, va_gc> *args)
1727{
1728 bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
1729 name_lookup lookup (name);
1730 fns = lookup.search_adl (fns, args);
1731 timevar_cond_stop (TV_NAME_LOOKUP, subtime);
1732 return fns;
1733}
1734
1735/* FNS is an overload set of conversion functions. Return the
1736 overloads converting to TYPE. */
1737
1738static tree
1739extract_conversion_operator (tree fns, tree type)
1740{
1741 tree convs = NULL_TREE(tree) nullptr;
1742 tree tpls = NULL_TREE(tree) nullptr;
1743
1744 for (ovl_iterator iter (fns); iter; ++iter)
1745 {
1746 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"
, 1746, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1746, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1746, __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"
, 1746, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1746, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1746, __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"
, 1746, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1746, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1746, __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"
, 1746, __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"
, 1746, __FUNCTION__))->decl_minimal.name))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1746, __FUNCTION__))->typed.type)), (type), 0)
)
1747 convs = lookup_add (*iter, convs);
1748
1749 if (TREE_CODE (*iter)((enum tree_code) (*iter)->base.code) == TEMPLATE_DECL)
1750 tpls = lookup_add (*iter, tpls);
1751 }
1752
1753 if (!convs)
1754 convs = tpls;
1755
1756 return convs;
1757}
1758
1759/* Binary search of (ordered) MEMBER_VEC for NAME. */
1760
1761static tree
1762member_vec_binary_search (vec<tree, va_gc> *member_vec, tree name)
1763{
1764 for (unsigned lo = 0, hi = member_vec->length (); lo < hi;)
1765 {
1766 unsigned mid = (lo + hi) / 2;
1767 tree binding = (*member_vec)[mid];
1768 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"
, 1768, __FUNCTION__))->decl_minimal.name)
;
1769
1770 if (binding_name > name)
1771 hi = mid;
1772 else if (binding_name < name)
1773 lo = mid + 1;
1774 else
1775 return binding;
1776 }
1777
1778 return NULL_TREE(tree) nullptr;
1779}
1780
1781/* Linear search of (unordered) MEMBER_VEC for NAME. */
1782
1783static tree
1784member_vec_linear_search (vec<tree, va_gc> *member_vec, tree name)
1785{
1786 for (int ix = member_vec->length (); ix--;)
1787 if (tree binding = (*member_vec)[ix])
1788 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"
, 1788, __FUNCTION__))->decl_minimal.name)
== name)
1789 return binding;
1790
1791 return NULL_TREE(tree) nullptr;
1792}
1793
1794/* Linear search of (partially ordered) fields of KLASS for NAME. */
1795
1796static tree
1797fields_linear_search (tree klass, tree name, bool want_type)
1798{
1799 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"
, 1799, __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"
, 1799, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1799, __FUNCTION__))->common.chain))
)
1800 {
1801 tree decl = fields;
1802
1803 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL
1804 && 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"
, 1804, __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"
, 1804, __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"
, 1804, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1804, __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"
, 1804, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1804, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
1805 {
1806 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"
, 1806, __FUNCTION__))->typed.type)
, name, want_type))
1807 return temp;
1808 }
1809
1810 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"
, 1810, __FUNCTION__))->decl_minimal.name)
!= name)
1811 continue;
1812
1813 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == USING_DECL)
1814 {
1815 decl = strip_using_decl (decl);
1816 if (is_overloaded_fn (decl))
1817 continue;
1818 }
1819
1820 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"
, 1820, __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"
, 1820, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
1821 /* Functions are found separately. */
1822 continue;
1823
1824 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"
, 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) == TYPE_DECL))
)
1825 return decl;
1826 }
1827
1828 return NULL_TREE(tree) nullptr;
1829}
1830
1831/* Look for NAME member inside of anonymous aggregate ANON. Although
1832 such things should only contain FIELD_DECLs, we check that too
1833 late, and would give very confusing errors if we weren't
1834 permissive here. */
1835
1836tree
1837search_anon_aggr (tree anon, tree name, bool want_type)
1838{
1839 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"
, 1839, __FUNCTION__))->type_common.size) != (tree) nullptr
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1839, __FUNCTION__), 0 : 0))
;
1840 tree ret = get_class_binding_direct (anon, name, want_type);
1841 return ret;
1842}
1843
1844/* Look for NAME as an immediate member of KLASS (including
1845 anon-members or unscoped enum member). TYPE_OR_FNS is zero for
1846 regular search. >0 to get a type binding (if there is one) and <0
1847 if you want (just) the member function binding.
1848
1849 Use this if you do not want lazy member creation. */
1850
1851tree
1852get_class_binding_direct (tree klass, tree name, bool want_type)
1853{
1854 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"
, 1854, __FUNCTION__), 0 : 0))
;
1855
1856 /* Conversion operators can only be found by the marker conversion
1857 operator name. */
1858 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"
, 1858, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1858, __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"
, 1858, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1858, __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"
, 1858, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1858, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
;
1859 tree lookup = conv_op ? conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER] : name;
1860 tree val = NULL_TREE(tree) nullptr;
1861 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"
, 1861, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
1862
1863 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"
, 1863, __FUNCTION__))->type_common.size) != (tree) nullptr
)
&& member_vec)
1864 {
1865 val = member_vec_binary_search (member_vec, lookup);
1866 if (!val)
1867 ;
1868 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"
, 1868, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1868, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
1869 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"
, 1869, __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"
, 1869, __FUNCTION__, (OVERLOAD))))->function)
;
1870 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"
, 1870, __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"
, 1870, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
1871 val = NULL_TREE(tree) nullptr;
1872 }
1873 else
1874 {
1875 if (member_vec && !want_type)
1876 val = member_vec_linear_search (member_vec, lookup);
1877
1878 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"
, 1878, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1878, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
))
1879 /* Dependent using declarations are a 'field', make sure we
1880 return that even if we saw an overload already. */
1881 if (tree field_val = fields_linear_search (klass, lookup, want_type))
1882 {
1883 if (!val)
1884 val = field_val;
1885 else if (TREE_CODE (field_val)((enum tree_code) (field_val)->base.code) == USING_DECL)
1886 val = ovl_make (field_val, val);
1887 }
1888 }
1889
1890 /* Extract the conversion operators asked for, unless the general
1891 conversion operator was requested. */
1892 if (val && conv_op)
1893 {
1894 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"
, 1894, __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"
, 1894, __FUNCTION__), 0 : 0))
;
1895 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"
, 1895, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1896 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"
, 1896, __FUNCTION__))->typed.type)
)
1897 val = extract_conversion_operator (val, type);
1898 }
1899
1900 return val;
1901}
1902
1903/* We're about to lookup NAME in KLASS. Make sure any lazily declared
1904 members are now declared. */
1905
1906static void
1907maybe_lazily_declare (tree klass, tree name)
1908{
1909 /* See big comment anout module_state::write_pendings regarding adding a check
1910 bit. */
1911 if (modules_p ())
1912 lazy_load_pendings (TYPE_NAME (klass)((tree_class_check ((klass), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1912, __FUNCTION__))->type_common.name)
);
1913
1914 /* Lazily declare functions, if we're going to search these. */
1915 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"
, 1915, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1915, __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"
, 1915, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1915, __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"
, 1915, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1915, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1916 {
1917 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"
, 1917, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_default_ctor)
)
1918 lazily_declare_fn (sfk_constructor, klass);
1919 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"
, 1919, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_copy_ctor)
)
1920 lazily_declare_fn (sfk_copy_constructor, klass);
1921 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"
, 1921, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_move_ctor)
)
1922 lazily_declare_fn (sfk_move_constructor, klass);
1923 }
1924 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"
, 1924, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1924, __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"
, 1924, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1924, __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"
, 1924, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1924, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
1925 {
1926 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"
, 1926, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_destructor)
)
1927 lazily_declare_fn (sfk_destructor, klass);
1928 }
1929 else if (name == assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier))
1930 {
1931 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"
, 1931, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_copy_assign)
)
1932 lazily_declare_fn (sfk_copy_assignment, klass);
1933 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"
, 1933, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_move_assign)
)
1934 lazily_declare_fn (sfk_move_assignment, klass);
1935 }
1936}
1937
1938/* Look for NAME's binding in exactly KLASS. See
1939 get_class_binding_direct for argument description. Does lazy
1940 special function creation as necessary. */
1941
1942tree
1943get_class_binding (tree klass, tree name, bool want_type /*=false*/)
1944{
1945 klass = complete_type (klass);
1946
1947 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"
, 1947, __FUNCTION__))->type_common.size) != (tree) nullptr
)
)
1948 maybe_lazily_declare (klass, name);
1949
1950 return get_class_binding_direct (klass, name, want_type);
1951}
1952
1953/* Find the slot containing overloads called 'NAME'. If there is no
1954 such slot and the class is complete, create an empty one, at the
1955 correct point in the sorted member vector. Otherwise return NULL.
1956 Deals with conv_op marker handling. */
1957
1958tree *
1959find_member_slot (tree klass, tree name)
1960{
1961 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"
, 1961, __FUNCTION__))->type_common.size) != (tree) nullptr
)
;
1962
1963 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"
, 1963, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
1964 if (!member_vec)
1965 {
1966 vec_alloc (member_vec, 8);
1967 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)
= member_vec;
1968 if (complete_p)
1969 /* If the class is complete but had no member_vec, we need to
1970 add the TYPE_FIELDS into it. We're also most likely to be
1971 adding ctors & dtors, so ask for 6 spare slots (the
1972 abstract cdtors and their clones). */
1973 member_vec = set_class_bindings (klass, 6);
1974 }
1975
1976 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"
, 1976, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1976, __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"
, 1976, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1976, __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"
, 1976, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 1976, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1977 name = conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER];
1978
1979 unsigned ix, length = member_vec->length ();
1980 for (ix = 0; ix < length; ix++)
1981 {
1982 tree *slot = &(*member_vec)[ix];
1983 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"
, 1983, __FUNCTION__))->decl_minimal.name)
;
1984
1985 if (fn_name == name)
1986 {
1987 /* If we found an existing slot, it must be a function set.
1988 Even with insertion after completion, because those only
1989 happen with artificial fns that have unspellable names.
1990 This means we do not have to deal with the stat hack
1991 either. */
1992 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"
, 1992, __FUNCTION__), 0 : 0))
;
1993 if (name == conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER])
1994 {
1995 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"
, 1995, __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"
, 1995, __FUNCTION__), 0 : 0))
;
1996 /* Skip the conv-op marker. */
1997 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"
, 1997, __FUNCTION__, (OVERLOAD))))->common.chain)
;
1998 }
1999 return slot;
2000 }
2001
2002 if (complete_p && fn_name > name)
2003 break;
2004 }
2005
2006 /* No slot found, add one if the class is complete. */
2007 if (complete_p)
2008 {
2009 /* Do exact allocation, as we don't expect to add many. */
2010 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"
, 2010, __FUNCTION__), 0 : 0))
;
2011 vec_safe_reserve_exact (member_vec, 1);
2012 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"
, 2012, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2013 member_vec->quick_insert (ix, NULL_TREE(tree) nullptr);
2014 return &(*member_vec)[ix];
2015 }
2016
2017 return NULLnullptr;
2018}
2019
2020/* KLASS is an incomplete class to which we're adding a method NAME.
2021 Add a slot and deal with conv_op marker handling. */
2022
2023tree *
2024add_member_slot (tree klass, tree name)
2025{
2026 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"
, 2026, __FUNCTION__))->type_common.size) != (tree) nullptr
)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2026, __FUNCTION__), 0 : 0))
;
2027
2028 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"
, 2028, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2029 vec_safe_push (member_vec, NULL_TREE(tree) nullptr);
2030 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"
, 2030, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2031
2032 tree *slot = &member_vec->last ();
2033 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"
, 2033, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2033, __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"
, 2033, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2033, __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"
, 2033, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2033, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2034 {
2035 /* Install the marker prefix. */
2036 *slot = ovl_make (conv_op_markercp_global_trees[CPTI_CONV_OP_MARKER], NULL_TREE(tree) nullptr);
2037 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"
, 2037, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2038 }
2039
2040 return slot;
2041}
2042
2043/* Comparison function to compare two MEMBER_VEC entries by name.
2044 Because we can have duplicates during insertion of TYPE_FIELDS, we
2045 do extra checking so deduping doesn't have to deal with so many
2046 cases. */
2047
2048static int
2049member_name_cmp (const void *a_p, const void *b_p)
2050{
2051 tree a = *(const tree *)a_p;
2052 tree b = *(const tree *)b_p;
2053 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"
, 2053, __FUNCTION__, (OVERLOAD))))->function) : a), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2053, __FUNCTION__))->decl_minimal.name)
;
2054 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"
, 2054, __FUNCTION__, (OVERLOAD))))->function) : b), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2054, __FUNCTION__))->decl_minimal.name)
;
2055
2056 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"
, 2056, __FUNCTION__), 0 : 0))
;
2057 if (name_a != name_b)
2058 return name_a < name_b ? -1 : +1;
2059
2060 if (name_a == conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER])
2061 {
2062 /* Strip the conv-op markers. */
2063 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"
, 2063, __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"
, 2064, __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"
, 2064, __FUNCTION__), 0 : 0))
2064 && 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"
, 2063, __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"
, 2064, __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"
, 2064, __FUNCTION__), 0 : 0))
;
2065 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"
, 2065, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2066 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"
, 2066, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2067 }
2068
2069 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == OVERLOAD)
2070 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"
, 2070, __FUNCTION__, (OVERLOAD))))->function)
;
2071 if (TREE_CODE (b)((enum tree_code) (b)->base.code) == OVERLOAD)
2072 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"
, 2072, __FUNCTION__, (OVERLOAD))))->function)
;
2073
2074 /* We're in STAT_HACK or USING_DECL territory (or possibly error-land). */
2075 if (TREE_CODE (a)((enum tree_code) (a)->base.code) != TREE_CODE (b)((enum tree_code) (b)->base.code))
2076 {
2077 /* If one of them is a TYPE_DECL, it loses. */
2078 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == TYPE_DECL)
2079 return +1;
2080 else if (TREE_CODE (b)((enum tree_code) (b)->base.code) == TYPE_DECL)
2081 return -1;
2082
2083 /* If one of them is a USING_DECL, it loses. */
2084 if (TREE_CODE (a)((enum tree_code) (a)->base.code) == USING_DECL)
2085 return +1;
2086 else if (TREE_CODE (b)((enum tree_code) (b)->base.code) == USING_DECL)
2087 return -1;
2088
2089 /* There are no other cases with different kinds of decls, as
2090 duplicate detection should have kicked in earlier. However,
2091 some erroneous cases get though. */
2092 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"
, 2092, __FUNCTION__), 0 : 0))
;
2093 }
2094
2095 /* Using source location would be the best thing here, but we can
2096 get identically-located decls in the following circumstances:
2097
2098 1) duplicate artificial type-decls for the same type.
2099
2100 2) pack expansions of using-decls.
2101
2102 We should not be doing #1, but in either case it doesn't matter
2103 how we order these. Use UID as a proxy for source ordering, so
2104 that identically-located decls still have a well-defined stable
2105 ordering. */
2106 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"
, 2106, __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"
, 2106, __FUNCTION__))->decl_minimal.uid)
)
2107 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"
, 2107, __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"
, 2107, __FUNCTION__))->decl_minimal.uid)
? -1 : +1;
2108 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"
, 2108, __FUNCTION__), 0 : 0))
;
2109 return 0;
2110}
2111
2112static struct {
2113 gt_pointer_operator new_value;
2114 void *cookie;
2115} resort_data;
2116
2117/* This routine compares two fields like member_name_cmp but using the
2118 pointer operator in resort_field_decl_data. We don't have to deal
2119 with duplicates here. */
2120
2121static int
2122resort_member_name_cmp (const void *a_p, const void *b_p)
2123{
2124 tree a = *(const tree *)a_p;
2125 tree b = *(const tree *)b_p;
2126 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"
, 2126, __FUNCTION__))->decl_minimal.name)
;
2127 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"
, 2127, __FUNCTION__))->decl_minimal.name)
;
2128
2129 resort_data.new_value (&name_a, resort_data.cookie);
2130 resort_data.new_value (&name_b, resort_data.cookie);
2131
2132 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"
, 2132, __FUNCTION__), 0 : 0))
;
2133
2134 return name_a < name_b ? -1 : +1;
2135}
2136
2137/* Resort CLASSTYPE_MEMBER_VEC because pointers have been reordered. */
2138
2139void
2140resort_type_member_vec (void *obj, void */*orig_obj*/,
2141 gt_pointer_operator new_value, void* cookie)
2142{
2143 if (vec<tree, va_gc> *member_vec = (vec<tree, va_gc> *) obj)
2144 {
2145 resort_data.new_value = new_value;
2146 resort_data.cookie = cookie;
2147 member_vec->qsort (resort_member_name_cmp)qsort (resort_member_name_cmp);
2148 }
2149}
2150
2151/* Recursively count the number of fields in KLASS, including anonymous
2152 union members. */
2153
2154static unsigned
2155count_class_fields (tree klass)
2156{
2157 unsigned n_fields = 0;
2158
2159 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"
, 2159, __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"
, 2159, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2159, __FUNCTION__))->common.chain))
)
2160 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"
, 2160, __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"
, 2160, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2161 /* Functions are dealt with separately. */;
2162 else if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL
2163 && 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"
, 2163, __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"
, 2163, __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"
, 2163, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2163, __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"
, 2163, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2163, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
2164 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"
, 2164, __FUNCTION__))->typed.type)
);
2165 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"
, 2165, __FUNCTION__))->decl_minimal.name)
)
2166 n_fields += 1;
2167
2168 return n_fields;
2169}
2170
2171/* Append all the nonfunction members fields of KLASS to MEMBER_VEC.
2172 Recurse for anonymous members. MEMBER_VEC must have space. */
2173
2174static void
2175member_vec_append_class_fields (vec<tree, va_gc> *member_vec, tree klass)
2176{
2177 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"
, 2177, __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"
, 2177, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2177, __FUNCTION__))->common.chain))
)
2178 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"
, 2178, __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"
, 2178, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2179 /* Functions are handled separately. */;
2180 else if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL
2181 && 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"
, 2181, __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"
, 2181, __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"
, 2181, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2181, __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"
, 2181, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2181, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
2182 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"
, 2182, __FUNCTION__))->typed.type)
);
2183 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"
, 2183, __FUNCTION__))->decl_minimal.name)
)
2184 {
2185 tree field = fields;
2186 /* Mark a conv-op USING_DECL with the conv-op-marker. */
2187 if (TREE_CODE (field)((enum tree_code) (field)->base.code) == USING_DECL
2188 && 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"
, 2188, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2188, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2188, __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"
, 2188, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2188, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2188, __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"
, 2188, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2188, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2188, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2189 field = ovl_make (conv_op_markercp_global_trees[CPTI_CONV_OP_MARKER], field);
2190 member_vec->quick_push (field);
2191 }
2192}
2193
2194/* Append all of the enum values of ENUMTYPE to MEMBER_VEC.
2195 MEMBER_VEC must have space. */
2196
2197static void
2198member_vec_append_enum_values (vec<tree, va_gc> *member_vec, tree enumtype)
2199{
2200 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"
, 2200, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
;
2201 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"
, 2201, __FUNCTION__))->common.chain)
)
2202 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"
, 2202, __FUNCTION__, (TREE_LIST)))->list.value)
);
2203}
2204
2205/* MEMBER_VEC has just had new DECLs added to it, but is sorted.
2206 DeDup adjacent DECLS of the same name. We already dealt with
2207 conflict resolution when adding the fields or methods themselves.
2208 There are three cases (which could all be combined):
2209 1) a TYPE_DECL and non TYPE_DECL. Deploy STAT_HACK as appropriate.
2210 2) a USING_DECL and an overload. If the USING_DECL is dependent,
2211 it wins. Otherwise the OVERLOAD does.
2212 3) two USING_DECLS. ...
2213
2214 member_name_cmp will have ordered duplicates as
2215 <fns><using><type> */
2216
2217static void
2218member_vec_dedup (vec<tree, va_gc> *member_vec)
2219{
2220 unsigned len = member_vec->length ();
2221 unsigned store = 0;
2222
2223 if (!len)
2224 return;
2225
2226 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"
, 2226, __FUNCTION__))->decl_minimal.name)
;
2227 for (unsigned jx, ix = 0; ix < len; ix = jx)
2228 {
2229 tree current = NULL_TREE(tree) nullptr;
2230 tree to_type = NULL_TREE(tree) nullptr;
2231 tree to_using = NULL_TREE(tree) nullptr;
2232 tree marker = NULL_TREE(tree) nullptr;
2233
2234 for (jx = ix; jx < len; jx++)
2235 {
2236 tree next = (*member_vec)[jx];
2237 if (jx != ix)
2238 {
2239 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"
, 2239, __FUNCTION__))->decl_minimal.name)
;
2240 if (next_name != name)
2241 {
2242 name = next_name;
2243 break;
2244 }
2245 }
2246
2247 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"
, 2247, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2247, __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"
, 2247, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2247, __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"
, 2247, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2247, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2248 {
2249 marker = next;
2250 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"
, 2250, __FUNCTION__, (OVERLOAD))))->common.chain)
;
2251 }
2252
2253 if (TREE_CODE (next)((enum tree_code) (next)->base.code) == USING_DECL)
2254 {
2255 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"
, 2255, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2255, __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"
, 2255, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2255, __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"
, 2255, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2255, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
2256 /* Dependent inherited ctor. */
2257 continue;
2258
2259 next = strip_using_decl (next);
2260 if (TREE_CODE (next)((enum tree_code) (next)->base.code) == USING_DECL)
2261 {
2262 to_using = next;
2263 continue;
2264 }
2265
2266 if (is_overloaded_fn (next))
2267 continue;
2268 }
2269
2270 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"
, 2270, __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"
, 2270, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL))
)
2271 {
2272 to_type = next;
2273 continue;
2274 }
2275
2276 if (!current)
2277 current = next;
2278 }
2279
2280 if (to_using)
2281 {
2282 if (!current)
2283 current = to_using;
2284 else
2285 current = ovl_make (to_using, current);
2286 }
2287
2288 if (to_type)
2289 {
2290 if (!current)
2291 current = to_type;
2292 else
2293 current = stat_hack (current, to_type);
2294 }
2295
2296 if (current)
2297 {
2298 if (marker)
2299 {
2300 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"
, 2300, __FUNCTION__, (OVERLOAD))))->common.chain)
= current;
2301 current = marker;
2302 }
2303 (*member_vec)[store++] = current;
2304 }
2305 }
2306
2307 while (store++ < len)
2308 member_vec->pop ();
2309}
2310
2311/* Add the non-function members to CLASSTYPE_MEMBER_VEC. If there is
2312 no existing MEMBER_VEC and fewer than 8 fields, do nothing. We
2313 know there must be at least 1 field -- the self-reference
2314 TYPE_DECL, except for anon aggregates, which will have at least
2315 one field anyway. If EXTRA < 0, always create the vector. */
2316
2317vec<tree, va_gc> *
2318set_class_bindings (tree klass, int extra)
2319{
2320 unsigned n_fields = count_class_fields (klass);
2321 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"
, 2321, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2322
2323 if (member_vec || n_fields >= 8 || extra < 0)
2324 {
2325 /* Append the new fields. */
2326 vec_safe_reserve_exact (member_vec, n_fields + (extra >= 0 ? extra : 0));
2327 member_vec_append_class_fields (member_vec, klass);
2328 }
2329
2330 if (member_vec)
2331 {
2332 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"
, 2332, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
= member_vec;
2333 member_vec->qsort (member_name_cmp)qsort (member_name_cmp);
2334 member_vec_dedup (member_vec);
2335 }
2336
2337 return member_vec;
2338}
2339
2340/* Insert lately defined enum ENUMTYPE into KLASS for the sorted case. */
2341
2342void
2343insert_late_enum_def_bindings (tree klass, tree enumtype)
2344{
2345 int n_fields;
2346 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"
, 2346, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
2347
2348 /* The enum bindings will already be on the TYPE_FIELDS, so don't
2349 count them twice. */
2350 if (!member_vec)
1
Assuming 'member_vec' is non-null
2
Taking false branch
2351 n_fields = count_class_fields (klass);
2352 else
2353 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"
, 2353, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
);
2354
2355 if (member_vec
2.1
'member_vec' is non-null
2.1
'member_vec' is non-null
|| n_fields >= 8)
2356 {
2357 vec_safe_reserve_exact (member_vec, n_fields);
3
Calling 'vec_safe_reserve_exact<tree_node *, va_gc>'
16
Returning from 'vec_safe_reserve_exact<tree_node *, va_gc>'
2358 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"
, 2358, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
)
17
Taking true branch
2359 member_vec_append_enum_values (member_vec, enumtype);
2360 else
2361 member_vec_append_class_fields (member_vec, klass);
2362 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)
= member_vec;
2363 member_vec->qsort (member_name_cmp)qsort (member_name_cmp);
18
Called C++ object pointer is null
2364 member_vec_dedup (member_vec);
2365 }
2366}
2367
2368/* The binding oracle; see cp-tree.h. */
2369
2370cp_binding_oracle_function *cp_binding_oracle;
2371
2372/* If we have a binding oracle, ask it for all namespace-scoped
2373 definitions of NAME. */
2374
2375static inline void
2376query_oracle (tree name)
2377{
2378 if (!cp_binding_oracle)
2379 return;
2380
2381 /* LOOKED_UP holds the set of identifiers that we have already
2382 looked up with the oracle. */
2383 static hash_set<tree> looked_up;
2384 if (looked_up.add (name))
2385 return;
2386
2387 cp_binding_oracle (CP_ORACLE_IDENTIFIER, name);
2388}
2389
2390#ifndef ENABLE_SCOPE_CHECKING0
2391# define ENABLE_SCOPE_CHECKING0 0
2392#else
2393# define ENABLE_SCOPE_CHECKING0 1
2394#endif
2395
2396/* A free list of "cxx_binding"s, connected by their PREVIOUS. */
2397
2398static GTY((deletable)) cxx_binding *free_bindings;
2399
2400/* Initialize VALUE and TYPE field for BINDING, and set the PREVIOUS
2401 field to NULL. */
2402
2403static inline void
2404cxx_binding_init (cxx_binding *binding, tree value, tree type)
2405{
2406 binding->value = value;
2407 binding->type = type;
2408 binding->previous = NULLnullptr;
2409}
2410
2411/* (GC)-allocate a binding object with VALUE and TYPE member initialized. */
2412
2413static cxx_binding *
2414cxx_binding_make (tree value, tree type)
2415{
2416 cxx_binding *binding = free_bindings;
2417
2418 if (binding)
2419 free_bindings = binding->previous;
2420 else
2421 binding = ggc_alloc<cxx_binding> ();
2422
2423 /* Clear flags by default. */
2424 LOCAL_BINDING_P (binding)((binding)->is_local) = false;
2425 INHERITED_VALUE_BINDING_P (binding)((binding)->value_is_inherited) = false;
2426 HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden) = false;
2427
2428 cxx_binding_init (binding, value, type);
2429
2430 return binding;
2431}
2432
2433/* Put BINDING back on the free list. */
2434
2435static inline void
2436cxx_binding_free (cxx_binding *binding)
2437{
2438 binding->scope = NULLnullptr;
2439 binding->previous = free_bindings;
2440 free_bindings = binding;
2441}
2442
2443/* Create a new binding for NAME (with the indicated VALUE and TYPE
2444 bindings) in the class scope indicated by SCOPE. */
2445
2446static cxx_binding *
2447new_class_binding (tree name, tree value, tree type, cp_binding_level *scope)
2448{
2449 cp_class_binding cb = {cxx_binding_make (value, type), name};
2450 cxx_binding *binding = cb.base;
2451 vec_safe_push (scope->class_shadowed, cb);
2452 binding->scope = scope;
2453 return binding;
2454}
2455
2456/* Make DECL the innermost binding for ID. The LEVEL is the binding
2457 level at which this declaration is being bound. */
2458
2459void
2460push_binding (tree id, tree decl, cp_binding_level* level)
2461{
2462 cxx_binding *binding;
2463
2464 if (level != class_binding_levelscope_chain->class_bindings)
2465 {
2466 binding = cxx_binding_make (decl, NULL_TREE(tree) nullptr);
2467 binding->scope = level;
2468 }
2469 else
2470 binding = new_class_binding (id, decl, /*type=*/NULL_TREE(tree) nullptr, level);
2471
2472 /* Now, fill in the binding information. */
2473 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"
, 2473, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
2474 LOCAL_BINDING_P (binding)((binding)->is_local) = (level != class_binding_levelscope_chain->class_bindings);
2475
2476 /* And put it on the front of the list of bindings for ID. */
2477 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)
= binding;
2478}
2479
2480/* Remove the binding for DECL which should be the innermost binding
2481 for ID. */
2482
2483void
2484pop_local_binding (tree id, tree decl)
2485{
2486 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"
, 2486, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
)
2487 /* It's easiest to write the loops that call this function without
2488 checking whether or not the entities involved have names. We
2489 get here for such an entity. */
2490 return;
2491
2492 /* Get the innermost binding for ID. */
2493 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"
, 2493, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
;
2494
2495 /* The name should be bound. */
2496 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"
, 2496, __FUNCTION__), 0 : 0))
;
2497
2498 /* The DECL will be either the ordinary binding or the type binding
2499 for this identifier. Remove that binding. We don't have to
2500 clear HIDDEN_TYPE_BINDING_P, as the whole binding will be going
2501 away. */
2502 if (binding->value == decl)
2503 binding->value = NULL_TREE(tree) nullptr;
2504 else
2505 {
2506 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"
, 2506, __FUNCTION__), 0 : 0))
;
2507 binding->type = NULL_TREE(tree) nullptr;
2508 }
2509
2510 if (!binding->value && !binding->type)
2511 {
2512 /* We're completely done with the innermost binding for this
2513 identifier. Unhook it from the list of bindings. */
2514 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"
, 2514, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
= binding->previous;
2515
2516 /* Add it to the free list. */
2517 cxx_binding_free (binding);
2518 }
2519}
2520
2521/* Remove the bindings for the decls of the current level and leave
2522 the current scope. */
2523
2524void
2525pop_bindings_and_leave_scope (void)
2526{
2527 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"
, 2527, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2527, __FUNCTION__))->common.chain))
)
2528 {
2529 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"
, 2529, __FUNCTION__, (TREE_LIST)))->list.value)
: t;
2530 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"
, 2530, __FUNCTION__))->decl_minimal.name)
;
2531
2532 pop_local_binding (name, decl);
2533 }
2534
2535 leave_scope ();
2536}
2537
2538/* Strip non dependent using declarations. If DECL is dependent,
2539 surreptitiously create a typename_type and return it. */
2540
2541tree
2542strip_using_decl (tree decl)
2543{
2544 if (decl == NULL_TREE(tree) nullptr)
2545 return NULL_TREE(tree) nullptr;
2546
2547 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"
, 2547, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2547, __FUNCTION__))->decl_common.lang_flag_0)
)
2548 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"
, 2548, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2548, __FUNCTION__))->decl_common.initial)
;
2549
2550 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"
, 2550, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2550, __FUNCTION__))->decl_common.lang_flag_0)
2551 && 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"
, 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_1)
)
2552 {
2553 /* We have found a type introduced by a using
2554 declaration at class scope that refers to a dependent
2555 type.
2556
2557 using typename :: [opt] nested-name-specifier unqualified-id ;
2558 */
2559 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"
, 2559, __FUNCTION__, (USING_DECL)))), (TS_DECL_NON_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2559, __FUNCTION__))->decl_non_common.result)
,
2560 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"
, 2560, __FUNCTION__))->decl_minimal.name)
,
2561 typename_type, tf_error);
2562 if (decl != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2563 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"
, 2563, __FUNCTION__))->type_common.name)
;
2564 }
2565
2566 return decl;
2567}
2568
2569/* Return true if OVL is an overload for an anticipated builtin. */
2570
2571static bool
2572anticipated_builtin_p (tree ovl)
2573{
2574 return (TREE_CODE (ovl)((enum tree_code) (ovl)->base.code) == OVERLOAD
2575 && 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"
, 2575, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2575, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
2576 && 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"
, 2576, __FUNCTION__, (OVERLOAD))))->function)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2576, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
);
2577}
2578
2579/* BINDING records an existing declaration for a name in the current scope.
2580 But, DECL is another declaration for that same identifier in the
2581 same scope. This is the `struct stat' hack whereby a non-typedef
2582 class name or enum-name can be bound at the same level as some other
2583 kind of entity.
2584 3.3.7/1
2585
2586 A class name (9.1) or enumeration name (7.2) can be hidden by the
2587 name of an object, function, or enumerator declared in the same scope.
2588 If a class or enumeration name and an object, function, or enumerator
2589 are declared in the same scope (in any order) with the same name, the
2590 class or enumeration name is hidden wherever the object, function, or
2591 enumerator name is visible.
2592
2593 It's the responsibility of the caller to check that
2594 inserting this name is valid here. Returns nonzero if the new binding
2595 was successful. */
2596
2597static bool
2598supplement_binding_1 (cxx_binding *binding, tree decl)
2599{
2600 tree bval = binding->value;
2601 bool ok = true;
2602 tree target_bval = strip_using_decl (bval);
2603 tree target_decl = strip_using_decl (decl);
2604
2605 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"
, 2605, __FUNCTION__))->decl_common.artificial_flag)
2606 && target_decl != target_bval
2607 && (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) != TYPE_DECL
2608 /* We allow pushing an enum multiple times in a class
2609 template in order to handle late matching of underlying
2610 type on an opaque-enum-declaration followed by an
2611 enum-specifier. */
2612 || (processing_template_declscope_chain->x_processing_template_decl
2613 && 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"
, 2613, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
2614 && 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"
, 2614, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE
2615 && (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"
, 2616, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2616, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2616, __FUNCTION__))->typed.type)
2616 (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"
, 2616, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2616, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2616, __FUNCTION__))->typed.type)
)
2617 || 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"
, 2618, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2618, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2618, __FUNCTION__))->typed.type)
2618 (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"
, 2618, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2618, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2618, __FUNCTION__))->typed.type)
)))))
2619 /* The new name is the type name. */
2620 binding->type = decl;
2621 else if (/* TARGET_BVAL is null when push_class_level_binding moves
2622 an inherited type-binding out of the way to make room
2623 for a new value binding. */
2624 !target_bval
2625 /* TARGET_BVAL is error_mark_node when TARGET_DECL's name
2626 has been used in a non-class scope prior declaration.
2627 In that case, we should have already issued a
2628 diagnostic; for graceful error recovery purpose, pretend
2629 this was the intended declaration for that name. */
2630 || target_bval == error_mark_nodeglobal_trees[TI_ERROR_MARK]
2631 /* If TARGET_BVAL is anticipated but has not yet been
2632 declared, pretend it is not there at all. */
2633 || anticipated_builtin_p (target_bval))
2634 binding->value = decl;
2635 else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL
2636 && 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"
, 2636, __FUNCTION__))->decl_common.artificial_flag)
2637 && target_decl != target_bval
2638 && (TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) != TYPE_DECL
2639 || 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"
, 2639, __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"
, 2640, __FUNCTION__))->typed.type)), 0)
2640 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"
, 2639, __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"
, 2640, __FUNCTION__))->typed.type)), 0)
))
2641 {
2642 /* The old binding was a type name. It was placed in
2643 VALUE field because it was thought, at the point it was
2644 declared, to be the only entity with such a name. Move the
2645 type name into the type slot; it is now hidden by the new
2646 binding. */
2647 binding->type = bval;
2648 binding->value = decl;
2649 binding->value_is_inherited = false;
2650 }
2651 else if (TREE_CODE (target_bval)((enum tree_code) (target_bval)->base.code) == TYPE_DECL
2652 && TREE_CODE (target_decl)((enum tree_code) (target_decl)->base.code) == TYPE_DECL
2653 && 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"
, 2653, __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"
, 2653, __FUNCTION__))->decl_minimal.name)
2654 && binding->scope->kind != sk_class
2655 && (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"
, 2655, __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"
, 2655, __FUNCTION__))->typed.type)), 0)
2656 /* If either type involves template parameters, we must
2657 wait until instantiation. */
2658 || 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"
, 2658, __FUNCTION__))->typed.type)
)
2659 || 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"
, 2659, __FUNCTION__))->typed.type)
)))
2660 /* We have two typedef-names, both naming the same type to have
2661 the same name. In general, this is OK because of:
2662
2663 [dcl.typedef]
2664
2665 In a given scope, a typedef specifier can be used to redefine
2666 the name of any type declared in that scope to refer to the
2667 type to which it already refers.
2668
2669 However, in class scopes, this rule does not apply due to the
2670 stricter language in [class.mem] prohibiting redeclarations of
2671 members. */
2672 ok = false;
2673 /* There can be two block-scope declarations of the same variable,
2674 so long as they are `extern' declarations. However, there cannot
2675 be two declarations of the same static data member:
2676
2677 [class.mem]
2678
2679 A member shall not be declared twice in the
2680 member-specification. */
2681 else if (VAR_P (target_decl)(((enum tree_code) (target_decl)->base.code) == VAR_DECL)
2682 && VAR_P (target_bval)(((enum tree_code) (target_bval)->base.code) == VAR_DECL)
2683 && 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"
, 2683, __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"
, 2683, __FUNCTION__))->decl_common.decl_flag_1)
2684 && !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"
, 2684, __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"
, 2684, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
2685 {
2686 duplicate_decls (decl, binding->value);
2687 ok = false;
2688 }
2689 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
2690 && TREE_CODE (bval)((enum tree_code) (bval)->base.code) == NAMESPACE_DECL
2691 && 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"
, 2691, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2691, __FUNCTION__))->decl_common.abstract_origin)
2692 && 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"
, 2692, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2692, __FUNCTION__))->decl_common.abstract_origin)
2693 && 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"
, 2693, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2693, __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"
, 2693, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2693, __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"
, 2693, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2693, __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"
, 2693, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2693, __FUNCTION__))->decl_common.abstract_origin) : (decl
))
)
2694 /* [namespace.alias]
2695
2696 In a declarative region, a namespace-alias-definition can be
2697 used to redefine a namespace-alias declared in that declarative
2698 region to refer only to the namespace to which it already
2699 refers. */
2700 ok = false;
2701 else if (TREE_CODE (bval)((enum tree_code) (bval)->base.code) == USING_DECL
2702 && CONST_DECL_USING_P (decl)(((enum tree_code) (decl)->base.code) == CONST_DECL &&
((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2702, __FUNCTION__))->typed.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"
, 2702, __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"
, 2702, __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"
, 2702, __FUNCTION__))->typed.type))
)
2703 /* Let the clone hide the using-decl that introduced it. */
2704 binding->value = decl;
2705 else
2706 {
2707 if (!error_operand_p (bval))
2708 diagnose_name_conflict (decl, bval);
2709 ok = false;
2710 }
2711
2712 return ok;
2713}
2714
2715/* Diagnose a name conflict between DECL and BVAL. */
2716
2717static void
2718diagnose_name_conflict (tree decl, tree bval)
2719{
2720 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_CODE (bval)((enum tree_code) (bval)->base.code)
2721 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != NAMESPACE_DECL
2722 && !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"
, 2722, __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"
, 2722, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
2723 && (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL
2724 || 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"
, 2724, __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"
, 2724, __FUNCTION__))->decl_common.artificial_flag)
)
2725 && 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"
, 2725, __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"
, 2725, __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"
, 2725, __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"
, 2725, __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"
, 2725, __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"
, 2725, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
)
2726 {
2727 if (concept_definition_p (decl))
2728 error ("redeclaration of %q#D with different template parameters",
2729 decl);
2730 else
2731 error ("redeclaration of %q#D", decl);
2732 }
2733 else
2734 error ("%q#D conflicts with a previous declaration", decl);
2735
2736 inform (location_of (bval), "previous declaration %q#D", bval);
2737}
2738
2739/* Wrapper for supplement_binding_1. */
2740
2741static bool
2742supplement_binding (cxx_binding *binding, tree decl)
2743{
2744 bool ret;
2745 bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
2746 ret = supplement_binding_1 (binding, decl);
2747 timevar_cond_stop (TV_NAME_LOOKUP, subtime);
2748 return ret;
2749}
2750
2751/* Replace BINDING's current value on its scope's name list with
2752 NEWVAL. */
2753
2754static void
2755update_local_overload (cxx_binding *binding, tree newval)
2756{
2757 tree *d;
2758
2759 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"
, 2759, __FUNCTION__))->common.chain)
)
2760 if (*d == binding->value)
2761 {
2762 /* Stitch new list node in. */
2763 *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"
, 2763, __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"
, 2763, __FUNCTION__))->common.chain)
);
2764 break;
2765 }
2766 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"
, 2766, __FUNCTION__, (TREE_LIST)))->list.value)
== binding->value)
2767 break;
2768
2769 TREE_VALUE (*d)((tree_check ((*d), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2769, __FUNCTION__, (TREE_LIST)))->list.value)
= newval;
2770}
2771
2772/* Compares the parameter-type-lists of ONE and TWO and
2773 returns false if they are different. If the DECLs are template
2774 functions, the return types and the template parameter lists are
2775 compared too (DR 565). */
2776
2777static bool
2778matching_fn_p (tree one, tree two)
2779{
2780 if (TREE_CODE (one)((enum tree_code) (one)->base.code) != TREE_CODE (two)((enum tree_code) (two)->base.code))
2781 return false;
2782
2783 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"
, 2783, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2783, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
,
2784 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"
, 2784, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2784, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
))
2785 return false;
2786
2787 if (TREE_CODE (one)((enum tree_code) (one)->base.code) == TEMPLATE_DECL)
2788 {
2789 /* Compare template parms. */
2790 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"
, 2790, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
2791 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"
, 2791, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
))
2792 return false;
2793
2794 /* And return type. */
2795 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"
, 2795, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2795, __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"
, 2796, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2796, __FUNCTION__))->typed.type)), 0)
2796 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"
, 2795, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2795, __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"
, 2796, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2796, __FUNCTION__))->typed.type)), 0)
)
2797 return false;
2798 }
2799
2800 if (!equivalently_constrained (one, two))
2801 return false;
2802
2803 return true;
2804}
2805
2806/* Push DECL into nonclass LEVEL BINDING or SLOT. OLD is the current
2807 binding value (possibly with anticipated builtins stripped).
2808 Diagnose conflicts and return updated decl. */
2809
2810static tree
2811update_binding (cp_binding_level *level, cxx_binding *binding, tree *slot,
2812 tree old, tree decl, bool hiding = false)
2813{
2814 tree old_type = NULL_TREE(tree) nullptr;
2815 bool hide_type = false;
2816 bool hide_value = false;
2817
2818 if (!slot)
2819 {
2820 old_type = binding->type;
2821 hide_type = HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden);
2822 if (!old_type)
2823 hide_value = hide_type, hide_type = false;
2824 }
2825 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"
, 2825, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2825, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
2826 {
2827 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"
, 2827, __FUNCTION__))->typed.type)
;
2828 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"
, 2828, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2828, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
;
2829 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"
, 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_0)
;
2830 }
2831
2832 tree to_val = decl;
2833 tree to_type = old_type;
2834 bool local_overload = false;
2835
2836 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"
, 2837, __FUNCTION__), 0 : 0))
2837 : 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"
, 2837, __FUNCTION__), 0 : 0))
;
2838
2839 if (old == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2840 old = NULL_TREE(tree) nullptr;
2841
2842 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"
, 2842, __FUNCTION__))->decl_common.lang_flag_2))
)
2843 {
2844 /* Pushing an artificial decl. We should not find another
2845 artificial decl here already -- lookup_elaborated_type will
2846 have already found it. */
2847 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"
, 2848, __FUNCTION__))->decl_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2848, __FUNCTION__), 0 : 0))
2848 && !(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"
, 2848, __FUNCTION__))->decl_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2848, __FUNCTION__), 0 : 0))
;
2849
2850 if (old)
2851 {
2852 /* Put DECL into the type slot. */
2853 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"
, 2853, __FUNCTION__), 0 : 0))
;
2854 hide_type = hiding;
2855 to_type = decl;
2856 to_val = old;
2857 }
2858 else
2859 hide_value = hiding;
2860
2861 goto done;
2862 }
2863
2864 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"
, 2864, __FUNCTION__))->decl_common.lang_flag_2))
)
2865 {
2866 /* OLD is an implicit typedef. Move it to to_type. */
2867 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"
, 2867, __FUNCTION__), 0 : 0))
;
2868
2869 to_type = old;
2870 hide_type = hide_value;
2871 old = NULL_TREE(tree) nullptr;
2872 hide_value = false;
2873 }
2874
2875 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"
, 2875, __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"
, 2875, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
2876 {
2877 if (!old)
2878 ;
2879 else if (OVL_P (old)(((enum tree_code) (old)->base.code) == FUNCTION_DECL || (
(enum tree_code) (old)->base.code) == OVERLOAD)
)
2880 {
2881 for (ovl_iterator iter (old); iter; ++iter)
2882 {
2883 tree fn = *iter;
2884
2885 if (iter.using_p () && matching_fn_p (fn, decl))
2886 {
2887 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"
, 2887, __FUNCTION__), 0 : 0))
;
2888 /* If a function declaration in namespace scope or
2889 block scope has the same name and the same
2890 parameter-type- list (8.3.5) as a function
2891 introduced by a using-declaration, and the
2892 declarations do not declare the same function,
2893 the program is ill-formed. [namespace.udecl]/14 */
2894 if (tree match = duplicate_decls (decl, fn, hiding))
2895 return match;
2896 else
2897 /* FIXME: To preserve existing error behavior, we
2898 still push the decl. This might change. */
2899 diagnose_name_conflict (decl, fn);
2900 }
2901 }
2902 }
2903 else
2904 goto conflict;
2905
2906 if (to_type != old_type
2907 && warn_shadowglobal_options.x_warn_shadow
2908 && 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"
, 2908, __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"
, 2908, __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"
, 2908, __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"
, 2908, __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"
, 2908, __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"
, 2908, __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"
, 2908, __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"
, 2908, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2908, __FUNCTION__))->type_common.lang_flag_5)))
2909 && !(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"
, 2909, __FUNCTION__))->decl_minimal.locus)))
2910 && 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"
, 2910, __FUNCTION__))->decl_minimal.locus)))
))
2911 warning (OPT_Wshadow, "%q#D hides constructor for %q#D",
2912 decl, to_type);
2913
2914 local_overload = old && level && level->kind != sk_namespace;
2915 to_val = ovl_insert (decl, old, -int (hiding));
2916 }
2917 else if (old)
2918 {
2919 if (TREE_CODE (old)((enum tree_code) (old)->base.code) != TREE_CODE (decl)((enum tree_code) (decl)->base.code))
2920 /* Different kinds of decls conflict. */
2921 goto conflict;
2922 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL)
2923 {
2924 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"
, 2924, __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"
, 2924, __FUNCTION__))->typed.type)), 0)
)
2925 /* Two type decls to the same type. Do nothing. */
2926 return old;
2927 else
2928 goto conflict;
2929 }
2930 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == NAMESPACE_DECL)
2931 {
2932 /* Two maybe-aliased namespaces. If they're to the same target
2933 namespace, that's ok. */
2934 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"
, 2934, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2934, __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"
, 2934, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2934, __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"
, 2934, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2934, __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"
, 2934, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2934, __FUNCTION__))->decl_common.abstract_origin) : (decl
))
)
2935 goto conflict;
2936
2937 /* The new one must be an alias at this point. */
2938 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"
, 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)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2938, __FUNCTION__), 0 : 0))
;
2939 return old;
2940 }
2941 else if (TREE_CODE (old)((enum tree_code) (old)->base.code) == VAR_DECL)
2942 {
2943 /* There can be two block-scope declarations of the same
2944 variable, so long as they are `extern' declarations. */
2945 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"
, 2945, __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"
, 2945, __FUNCTION__))->decl_common.decl_flag_1)
)
2946 goto conflict;
2947 else if (tree match = duplicate_decls (decl, old))
2948 {
2949 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"
, 2949, __FUNCTION__), 0 : 0))
;
2950 return match;
2951 }
2952 else
2953 goto conflict;
2954 }
2955 else
2956 {
2957 conflict:
2958 diagnose_name_conflict (decl, old);
2959 to_val = NULL_TREE(tree) nullptr;
2960 }
2961 }
2962 else if (hiding)
2963 hide_value = true;
2964
2965 done:
2966 if (to_val)
2967 {
2968 if (local_overload)
2969 {
2970 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"
, 2970, __FUNCTION__), 0 : 0))
;
2971 update_local_overload (binding, to_val);
2972 }
2973 else if (level
2974 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL
2975 && !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"
, 2975, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2975, __FUNCTION__))->decl_common.abstract_origin)
))
2976 /* Don't add namespaces here. They're done in
2977 push_namespace. */
2978 add_decl_to_level (level, decl);
2979
2980 if (slot)
2981 {
2982 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"
, 2982, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2982, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
2983 {
2984 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"
, 2984, __FUNCTION__))->typed.type)
= to_type;
2985 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"
, 2985, __FUNCTION__, (OVERLOAD))))->function)
= to_val;
2986 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"
, 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_2)
= hide_type;
2987 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"
, 2987, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2987, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= hide_value;
2988 }
2989 else if (to_type || hide_value)
2990 {
2991 *slot = stat_hack (to_val, to_type);
2992 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"
, 2992, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2992, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
= hide_type;
2993 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"
, 2993, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 2993, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= hide_value;
2994 }
2995 else
2996 {
2997 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"
, 2997, __FUNCTION__), 0 : 0))
;
2998 *slot = to_val;
2999 }
3000 }
3001 else
3002 {
3003 binding->type = to_type;
3004 binding->value = to_val;
3005 HIDDEN_TYPE_BINDING_P (binding)((binding)->type_is_hidden) = hide_type || hide_value;
3006 }
3007 }
3008
3009 return decl;
3010}
3011
3012/* Table of identifiers to extern C declarations (or LISTS thereof). */
3013
3014static GTY(()) hash_table<named_decl_hash> *extern_c_decls;
3015
3016/* DECL has C linkage. If we have an existing instance, make sure the
3017 new one is compatible. Make sure it has the same exception
3018 specification [7.5, 7.6]. Add DECL to the map. */
3019
3020static void
3021check_extern_c_conflict (tree decl)
3022{
3023 /* Ignore artificial or system header decls. */
3024 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"
, 3024, __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"
, 3024, __FUNCTION__))->decl_minimal.locus)))
)
3025 return;
3026
3027 /* This only applies to decls at namespace scope. */
3028 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"
, 3028, __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"
, 3028, __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"
, 3028, __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"
, 3028, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
3029 return;
3030
3031 if (!extern_c_decls)
3032 extern_c_decls = hash_table<named_decl_hash>::create_ggc (127);
3033
3034 tree *slot = extern_c_decls
3035 ->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"
, 3035, __FUNCTION__))->decl_minimal.name)
,
3036 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"
, 3036, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3036, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
, INSERT);
3037 if (tree old = *slot)
3038 {
3039 if (TREE_CODE (old)((enum tree_code) (old)->base.code) == OVERLOAD)
3040 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"
, 3040, __FUNCTION__, (OVERLOAD))))->function)
;
3041
3042 int mismatch = 0;
3043 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"
, 3043, __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"
, 3043, __FUNCTION__))->decl_minimal.context)
)
3044 ; /* If they're in the same context, we'll have already complained
3045 about a (possible) mismatch, when inserting the decl. */
3046 else if (!decls_match (decl, old))
3047 mismatch = 1;
3048 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3049 && !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"
, 3049, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3049, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3049, __FUNCTION__))->type_non_common.lang_1)
,
3050 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"
, 3050, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3050, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3050, __FUNCTION__))->type_non_common.lang_1)
,
3051 ce_normal))
3052 mismatch = -1;
3053 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"
, 3053, __FUNCTION__))->decl_with_vis.assembler_name) != (
tree) nullptr)
)
3054 SET_DECL_ASSEMBLER_NAME (decl, DECL_ASSEMBLER_NAME (old))overwrite_decl_assembler_name (decl, decl_assembler_name (old
))
;
3055
3056 if (mismatch)
3057 {
3058 auto_diagnostic_group d;
3059 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"
, 3059, __FUNCTION__))->decl_minimal.locus)
, 0,
3060 "conflicting C language linkage declaration %q#D", decl);
3061 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"
, 3061, __FUNCTION__))->decl_minimal.locus)
,
3062 "previous declaration %q#D", old);
3063 if (mismatch < 0)
3064 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"
, 3064, __FUNCTION__))->decl_minimal.locus)
,
3065 "due to different exception specifications");
3066 }
3067 else
3068 {
3069 if (old == *slot)
3070 /* The hash table expects OVERLOADS, so construct one with
3071 OLD as both the function and the chain. This allocate
3072 an excess OVERLOAD node, but it's rare to have multiple
3073 extern "C" decls of the same name. And we save
3074 complicating the hash table logic (which is used
3075 elsewhere). */
3076 *slot = ovl_make (old, old);
3077
3078 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"
, 3078, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3079
3080 /* Chain it on for c_linkage_binding's use. */
3081 *slot = tree_cons (NULL_TREE(tree) nullptr, decl, *slot);
3082 }
3083 }
3084 else
3085 *slot = decl;
3086}
3087
3088/* Returns a list of C-linkage decls with the name NAME. Used in
3089 c-family/c-pragma.c to implement redefine_extname pragma. */
3090
3091tree
3092c_linkage_bindings (tree name)
3093{
3094 if (extern_c_decls)
3095 if (tree *slot = extern_c_decls
3096 ->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"
, 3096, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
, NO_INSERT))
3097 {
3098 tree result = *slot;
3099 if (TREE_CODE (result)((enum tree_code) (result)->base.code) == OVERLOAD)
3100 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"
, 3100, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3101 return result;
3102 }
3103
3104 return NULL_TREE(tree) nullptr;
3105}
3106
3107/* Subroutine of check_local_shadow. */
3108
3109static void
3110inform_shadowed (tree shadowed)
3111{
3112 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"
, 3112, __FUNCTION__))->decl_minimal.locus)
,
3113 "shadowed declaration is here");
3114}
3115
3116/* DECL is being declared at a local scope. Emit suitable shadow
3117 warnings. */
3118
3119static void
3120check_local_shadow (tree decl)
3121{
3122 /* Don't complain about the parms we push and then pop
3123 while tentatively parsing a function declarator. */
3124 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"
, 3124, __FUNCTION__))->decl_minimal.context)
)
3125 return;
3126
3127 /* External decls are something else. */
3128 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"
, 3128, __FUNCTION__))->decl_common.decl_flag_1)
)
3129 return;
3130
3131 tree old = NULL_TREE(tree) nullptr;
3132 cp_binding_level *old_scope = NULLnullptr;
3133 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"
, 3133, __FUNCTION__))->decl_minimal.name)
, NULLnullptr, true))
3134 {
3135 old = binding->value;
3136 old_scope = binding->scope;
3137 }
3138
3139 if (old
3140 && (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3141 || VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3142 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3143 && (!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"
, 3143, __FUNCTION__))->decl_common.artificial_flag)
3144 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)))
3145 && 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"
, 3145, __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"
, 3145, __FUNCTION__))->decl_minimal.context))->base.code
) == FUNCTION_DECL)
3146 && (!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"
, 3146, __FUNCTION__))->decl_common.artificial_flag)
3147 || is_capture_proxy (decl)
3148 || 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"
, 3148, __FUNCTION__))->decl_common.lang_flag_2))
3149 || (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"
, 3149, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3149, __FUNCTION__))->decl_common.lang_flag_4))
)))
3150 {
3151 /* DECL shadows a local thing possibly of interest. */
3152
3153 /* DR 2211: check that captures and parameters
3154 do not have the same name. */
3155 if (is_capture_proxy (decl))
3156 {
3157 if (current_lambda_expr ()
3158 && 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"
, 3158, __FUNCTION__))->decl_minimal.context)
== lambda_function (current_lambda_expr ())
3159 && TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3160 && 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"
, 3160, __FUNCTION__))->decl_minimal.name)
!= this_identifiercp_global_trees[CPTI_THIS_IDENTIFIER])
3161 {
3162 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"
, 3162, __FUNCTION__))->decl_minimal.locus)
,
3163 "lambda parameter %qD "
3164 "previously declared as a capture", old);
3165 }
3166 return;
3167 }
3168 /* Don't complain if it's from an enclosing function. */
3169 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"
, 3169, __FUNCTION__))->decl_minimal.context)
== current_function_decl
3170 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
3171 && TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL)
3172 {
3173 /* Go to where the parms should be and see if we find
3174 them there. */
3175 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;
3176
3177 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"
, 3177, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __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"
, 3177, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3177, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))))
)
3178 /* Skip the ctor/dtor cleanup level. */
3179 b = b->level_chain;
3180
3181 /* [basic.scope.param] A parameter name shall not be redeclared
3182 in the outermost block of the function definition. */
3183 if (b->kind == sk_function_parms)
3184 {
3185 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"
, 3185, __FUNCTION__))->decl_minimal.locus)
,
3186 "declaration of %q#D shadows a parameter", decl);
3187 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"
, 3187, __FUNCTION__))->decl_minimal.locus)
,
3188 "%q#D previously declared here", old);
3189 return;
3190 }
3191 }
3192
3193 /* The local structure or class can't use parameters of
3194 the containing function anyway. */
3195 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"
, 3195, __FUNCTION__))->decl_minimal.context)
!= current_function_decl)
3196 {
3197 for (cp_binding_level *scope = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
3198 scope != old_scope; scope = scope->level_chain)
3199 if (scope->kind == sk_class
3200 && !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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __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"
, 3200, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3200, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))
)
3201 return;
3202 }
3203 /* Error if redeclaring a local declared in a
3204 init-statement or in the condition of an if or
3205 switch statement when the new declaration is in the
3206 outermost block of the controlled statement.
3207 Redeclaring a variable from a for or while condition is
3208 detected elsewhere. */
3209 else if (VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3210 && old_scope == current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain
3211 && (old_scope->kind == sk_cond || old_scope->kind == sk_for))
3212 {
3213 auto_diagnostic_group d;
3214 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"
, 3214, __FUNCTION__))->decl_minimal.locus)
,
3215 "redeclaration of %q#D", decl);
3216 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"
, 3216, __FUNCTION__))->decl_minimal.locus)
,
3217 "%q#D previously declared here", old);
3218 return;
3219 }
3220 /* C++11:
3221 3.3.3/3: The name declared in an exception-declaration (...)
3222 shall not be redeclared in the outermost block of the handler.
3223 3.3.3/2: A parameter name shall not be redeclared (...) in
3224 the outermost block of any handler associated with a
3225 function-try-block.
3226 3.4.1/15: The function parameter names shall not be redeclared
3227 in the exception-declaration nor in the outermost block of a
3228 handler for the function-try-block. */
3229 else if ((TREE_CODE (old)((enum tree_code) (old)->base.code) == VAR_DECL
3230 && old_scope == current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain
3231 && old_scope->kind == sk_catch)
3232 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL
3233 && (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_catch
3234 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->level_chain->kind == sk_catch)
3235 && in_function_try_handler((cfun + 0)->language)->x_in_function_try_handler))
3236 {
3237 auto_diagnostic_group d;
3238 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"
, 3238, __FUNCTION__))->decl_minimal.locus)
,
3239 "redeclaration of %q#D", decl))
3240 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"
, 3240, __FUNCTION__))->decl_minimal.locus)
,
3241 "%q#D previously declared here", old);
3242 return;
3243 }
3244
3245 /* If '-Wshadow=compatible-local' is specified without other
3246 -Wshadow= flags, we will warn only when the type of the
3247 shadowing variable (DECL) can be converted to that of the
3248 shadowed parameter (OLD_LOCAL). The reason why we only check
3249 if DECL's type can be converted to OLD_LOCAL's type (but not the
3250 other way around) is because when users accidentally shadow a
3251 parameter, more than often they would use the variable
3252 thinking (mistakenly) it's still the parameter. It would be
3253 rare that users would use the variable in the place that
3254 expects the parameter but thinking it's a new decl.
3255 If either object is a TYPE_DECL, '-Wshadow=compatible-local'
3256 warns regardless of whether one of the types involved
3257 is a subclass of the other, since that is never okay. */
3258
3259 enum opt_code warning_code;
3260 if (warn_shadowglobal_options.x_warn_shadow)
3261 warning_code = OPT_Wshadow;
3262 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"
, 3262, __FUNCTION__))->typed.type)
3263 && 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"
, 3263, __FUNCTION__))->typed.type)
3264 && 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"
, 3264, __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"
, 3264, __FUNCTION__))->typed.type)), 0)
)
3265 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
3266 || TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3267 || (!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"
, 3267, __FUNCTION__))->typed.type)
)
3268 && !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"
, 3268, __FUNCTION__))->typed.type)
)
3269 /* If the new decl uses auto, we don't yet know
3270 its type (the old type cannot be using auto
3271 at this point, without also being
3272 dependent). This is an indication we're
3273 (now) doing the shadow checking too
3274 early. */
3275 && !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"
, 3275, __FUNCTION__))->typed.type)
)
3276 && 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"
, 3276, __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"
, 3276, __FUNCTION__))->typed.type)
,
3277 decl, LOOKUP_IMPLICIT(((1 << 0)) | (1 << 2)), tf_none)))
3278 warning_code = OPT_Wshadow_compatible_local;
3279 else
3280 warning_code = OPT_Wshadow_local;
3281
3282 const char *msg;
3283 if (TREE_CODE (old)((enum tree_code) (old)->base.code) == PARM_DECL)
3284 msg = "declaration of %q#D shadows a parameter";
3285 else if (is_capture_proxy (old))
3286 msg = "declaration of %qD shadows a lambda capture";
3287 else
3288 msg = "declaration of %qD shadows a previous local";
3289
3290 auto_diagnostic_group d;
3291 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"
, 3291, __FUNCTION__))->decl_minimal.locus)
, warning_code, msg, decl))
3292 inform_shadowed (old);
3293 return;
3294 }
3295
3296 if (!warn_shadowglobal_options.x_warn_shadow)
3297 return;
3298
3299 /* Don't warn for artificial things that are not implicit typedefs. */
3300 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"
, 3300, __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"
, 3300, __FUNCTION__))->decl_common.lang_flag_2))
)
3301 return;
3302
3303 if (nonlambda_method_basetype ())
3304 if (tree member = lookup_member (current_nonlambda_class_type (),
3305 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"
, 3305, __FUNCTION__))->decl_minimal.name)
, /*protect=*/0,
3306 /*want_type=*/false, tf_warning_or_error))
3307 {
3308 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"
, 3308, __FUNCTION__, (BASELINK))))->functions) : member)
;
3309
3310 /* Warn if a variable shadows a non-function, or the variable
3311 is a function or a pointer-to-function. */
3312 if (!OVL_P (member)(((enum tree_code) (member)->base.code) == FUNCTION_DECL ||
((enum tree_code) (member)->base.code) == OVERLOAD)
3313 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3314 || (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"
, 3314, __FUNCTION__))->typed.type)
3315 && (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"
, 3315, __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"
, 3315, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3315, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
)
3316 || 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"
, 3316, __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"
, 3316, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3316, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3316, __FUNCTION__))->type_common.lang_flag_2)))
)))
3317 {
3318 auto_diagnostic_group d;
3319 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"
, 3319, __FUNCTION__))->decl_minimal.locus)
, OPT_Wshadow,
3320 "declaration of %qD shadows a member of %qT",
3321 decl, current_nonlambda_class_type ())
3322 && DECL_P (member)(tree_code_type[(int) (((enum tree_code) (member)->base.code
))] == tcc_declaration)
)
3323 inform_shadowed (member);
3324 }
3325 return;
3326 }
3327
3328 /* Now look for a namespace shadow. */
3329 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"
, 3329, __FUNCTION__))->decl_minimal.name)
);
3330 if (old
3331 && (VAR_P (old)(((enum tree_code) (old)->base.code) == VAR_DECL)
3332 || (TREE_CODE (old)((enum tree_code) (old)->base.code) == TYPE_DECL
3333 && (!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"
, 3333, __FUNCTION__))->decl_common.artificial_flag)
3334 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)))
3335 && !instantiating_current_function_p ())
3336 /* XXX shadow warnings in outer-more namespaces */
3337 {
3338 auto_diagnostic_group d;
3339 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"
, 3339, __FUNCTION__))->decl_minimal.locus)
, OPT_Wshadow,
3340 "declaration of %qD shadows a global declaration",
3341 decl))
3342 inform_shadowed (old);
3343 return;
3344 }
3345
3346 return;
3347}
3348
3349/* DECL is being pushed inside function CTX. Set its context, if
3350 needed. */
3351
3352static void
3353set_decl_context_in_fn (tree ctx, tree decl)
3354{
3355 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3356 || (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"
, 3356, __FUNCTION__))->decl_common.decl_flag_1)
))
3357 /* Make sure local externs are marked as such. OMP UDRs really
3358 are nested functions. */
3359 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"
, 3359, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3359, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__), 0 : 0))
3360 && (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"
, 3359, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3359, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__), 0 : 0))
3361 || (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"
, 3359, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3359, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__), 0 : 0))
3362 && 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"
, 3359, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3359, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3360, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __FUNCTION__))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3362, __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"
, 3362, __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"
, 3362, __FUNCTION__), 0 : 0))
;
3363
3364 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"
, 3364, __FUNCTION__))->decl_minimal.context)
3365 /* When parsing the parameter list of a function declarator,
3366 don't set DECL_CONTEXT to an enclosing function. */
3367 && !(TREE_CODE (decl)((enum tree_code) (decl)->base.code) == PARM_DECL
3368 && parsing_function_declarator ()))
3369 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"
, 3369, __FUNCTION__))->decl_minimal.context)
= ctx;
3370}
3371
3372/* DECL is a local extern decl. Find or create the namespace-scope
3373 decl that it aliases. Also, determines the linkage of DECL. */
3374
3375void
3376push_local_extern_decl_alias (tree decl)
3377{
3378 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"
, 3378, __FUNCTION__))->typed.type)
)
3379 || (processing_template_declscope_chain->x_processing_template_decl
3380 && VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
3381 && CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3381, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3381, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
))
3382 return;
3383 /* EH specs were not part of the function type prior to c++17, but
3384 we still can't go pushing dependent eh specs into the namespace. */
3385 if (cxx_dialect < cxx17
3386 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3387 && (value_dependent_expression_p
3388 (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"
, 3388, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3388, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3388, __FUNCTION__))->type_non_common.lang_1)
)))
3389 return;
3390
3391 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"
, 3391, __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"
, 3392, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3392, __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"
, 3392, __FUNCTION__), 0 : 0))
3392 || !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"
, 3391, __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"
, 3392, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3392, __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"
, 3392, __FUNCTION__), 0 : 0))
;
3393 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"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__), 0 : 0)), decl)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3393, __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"
, 3393, __FUNCTION__); &lt->u.min; })->access)
)
3394 /* We're instantiating a non-dependent local decl, it already
3395 knows the alias. */
3396 return;
3397
3398 tree alias = NULL_TREE(tree) nullptr;
3399
3400 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"
, 3400, __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"
, 3400, __FUNCTION__))->decl_common.size)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3400, __FUNCTION__))->base.constant_flag)
)
3401 /* Do not let a VLA creep into a namespace. Diagnostic will be
3402 emitted in layout_var_decl later. */
3403 alias = error_mark_nodeglobal_trees[TI_ERROR_MARK];
3404 else
3405 {
3406 /* First look for a decl that matches. */
3407 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"
, 3407, __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"
, 3407, __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"
, 3407, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
3408 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"
, 3408, __FUNCTION__))->decl_minimal.name)
);
3409
3410 if (binding && TREE_CODE (binding)((enum tree_code) (binding)->base.code) != TREE_LIST)
3411 for (ovl_iterator iter (binding); iter; ++iter)
3412 if (decls_match (decl, *iter, /*record_versions*/false))
3413 {
3414 alias = *iter;
3415 break;
3416 }
3417
3418 if (!alias)
3419 {
3420 /* No existing namespace-scope decl. Make one. */
3421 alias = copy_decl (decl);
3422 if (TREE_CODE (alias)((enum tree_code) (alias)->base.code) == FUNCTION_DECL)
3423 {
3424 /* Recontextualize the parms. */
3425 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"
, 3425, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
;
3426 *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"
, 3426, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3426, __FUNCTION__))->common.chain))
)
3427 {
3428 *chain = copy_decl (*chain);
3429 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"
, 3429, __FUNCTION__))->decl_minimal.context)
= alias;
3430 }
3431
3432 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"
, 3432, __FUNCTION__))->typed.type)
;
3433 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"
, 3433, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
3434 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"
, 3434, __FUNCTION__))->common.chain)
)
3435 if (TREE_PURPOSE (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3435, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
3436 {
3437 /* There are default args. Lose them. */
3438 tree nargs = NULL_TREE(tree) nullptr;
3439 tree *chain = &nargs;
3440 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"
, 3440, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
3441 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"
, 3441, __FUNCTION__))->common.chain)
)
3442 if (args == void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
3443 {
3444 *chain = args;
3445 break;
3446 }
3447 else
3448 {
3449 *chain
3450 = 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"
, 3450, __FUNCTION__, (TREE_LIST)))->list.value)
);
3451 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"
, 3451, __FUNCTION__))->common.chain)
;
3452 }
3453
3454 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"
, 3454, __FUNCTION__))->typed.type)
, nargs);
3455
3456 fn_type = apply_memfn_quals
3457 (fn_type, type_memfn_quals (type));
3458
3459 fn_type = build_cp_fntype_variant
3460 (fn_type, type_memfn_rqual (type),
3461 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"
, 3461, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3461, __FUNCTION__))->type_non_common.lang_1)
,
3462 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"
, 3462, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3462, __FUNCTION__))->type_common.lang_flag_2))
);
3463
3464 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"
, 3464, __FUNCTION__))->typed.type)
= fn_type;
3465 break;
3466 }
3467 }
3468
3469 /* This is the real thing. */
3470 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"
, 3470, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3470, __FUNCTION__))->decl_common.lang_flag_0)
= false;
3471
3472 /* Expected default linkage is from the namespace. */
3473 TREE_PUBLIC (alias)((alias)->base.public_flag) = TREE_PUBLIC (ns)((ns)->base.public_flag);
3474 push_nested_namespace (ns);
3475 alias = do_pushdecl (alias, /* hiding= */true);
3476 pop_nested_namespace (ns);
3477 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
3478 && CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3478, __FUNCTION__, (VAR_DECL)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3478, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
3479 && alias != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3480 set_decl_tls_model (alias, DECL_TLS_MODEL (decl)decl_tls_model (decl));
3481 }
3482 }
3483
3484 retrofit_lang_decl (decl);
3485 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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__), 0 : 0)), decl)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __FUNCTION__))->decl_common.lang_flag_0)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3485, __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"
, 3485, __FUNCTION__); &lt->u.min; })->access)
= alias;
3486}
3487
3488/* DECL is a global or module-purview entity. If it has non-internal
3489 linkage, and we have a module vector, record it in the appropriate
3490 slot. We have already checked for duplicates. */
3491
3492static void
3493maybe_record_mergeable_decl (tree *slot, tree name, tree decl)
3494{
3495 if (TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) != BINDING_VECTOR)
3496 return;
3497
3498 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"
, 3498, __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"
, 3498, __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"
, 3498, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.public_flag)
)
3499 /* Member of internal namespace. */
3500 return;
3501
3502 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"
, 3502, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)
;
3503 if ((TREE_CODE (not_tmpl)((enum tree_code) (not_tmpl)->base.code) == FUNCTION_DECL
3504 || TREE_CODE (not_tmpl)((enum tree_code) (not_tmpl)->base.code) == VAR_DECL)
3505 && 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"
, 3505, __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"
, 3505, __FUNCTION__))->decl_common.lang_flag_6)
)
3506 /* Internal linkage. */
3507 return;
3508
3509 bool partition = named_module_p ();
3510 tree *gslot = get_fixed_binding_slot
3511 (slot, name, partition ? BINDING_SLOT_PARTITION : BINDING_SLOT_GLOBAL, true);
3512
3513 if (!partition)
3514 {
3515 binding_slot &orig
3516 = BINDING_VECTOR_CLUSTER (*slot, 0)(((tree_binding_vec *)(tree_check ((*slot), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3516, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_CURRENT];
3517
3518 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"
, 3518, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3518, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3519 orig = stat_hack (tree (orig));
3520
3521 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"
, 3521, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
3522 }
3523
3524 add_mergeable_namespace_entity (gslot, decl);
3525}
3526
3527/* DECL is being pushed. Check whether it hides or ambiguates
3528 something seen as an import. This include decls seen in our own
3529 interface, which is OK. Also, check for merging a
3530 global/partition decl. */
3531
3532static tree
3533check_module_override (tree decl, tree mvec, bool hiding,
3534 tree scope, tree name)
3535{
3536 tree match = NULL_TREE(tree) nullptr;
3537 bitmap imports = get_import_bitmap ();
3538 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"
, 3538, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
3539 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"
, 3539, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
3540
3541 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
3542 {
3543 cluster++;
3544 ix--;
3545 }
3546
3547 for (; ix--; cluster++)
3548 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
3549 {
3550 /* Are we importing this module? */
3551 if (cluster->indices[jx].span != 1)
3552 continue;
3553 if (!cluster->indices[jx].base)
3554 continue;
3555 if (!bitmap_bit_p (imports, cluster->indices[jx].base))
3556 continue;
3557 /* Is it loaded? */
3558 if (cluster->slots[jx].is_lazy ())
3559 {
3560 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"
, 3560, __FUNCTION__), 0 : 0))
;
3561 lazy_load_binding (cluster->indices[jx].base,
3562 scope, name, &cluster->slots[jx]);
3563 }
3564 tree bind = cluster->slots[jx];
3565 if (!bind)
3566 /* Errors could cause there to be nothing. */
3567 continue;
3568
3569 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"
, 3569, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3569, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3570 /* We do not have to check STAT_TYPE here, the xref_tag
3571 machinery deals with that problem. */
3572 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"
, 3572, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3573
3574 for (ovl_iterator iter (bind); iter; ++iter)
3575 if (!iter.using_p ())
3576 {
3577 match = duplicate_decls (decl, *iter, hiding);
3578 if (match)
3579 goto matched;
3580 }
3581 }
3582
3583 if (TREE_PUBLIC (scope)((scope)->base.public_flag) && TREE_PUBLIC (STRIP_TEMPLATE (decl))(((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3583, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
))->base.public_flag)
3584 /* Namespaces are dealt with specially in
3585 make_namespace_finish. */
3586 && !(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"
, 3586, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3586, __FUNCTION__))->decl_common.abstract_origin)
))
3587 {
3588 /* Look in the appropriate mergeable decl slot. */
3589 tree mergeable = NULL_TREE(tree) nullptr;
3590 if (named_module_p ())
3591 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"
, 3592, __FUNCTION__, (BINDING_VECTOR))))->vec[BINDING_SLOT_PARTITION
/ 2])
3592 / 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"
, 3592, __FUNCTION__, (BINDING_VECTOR))))->vec[BINDING_SLOT_PARTITION
/ 2])
3593 .slots[BINDING_SLOT_PARTITION % BINDING_VECTOR_SLOTS_PER_CLUSTER2];
3594 else
3595 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"
, 3595, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_GLOBAL];
3596
3597 for (ovl_iterator iter (mergeable); iter; ++iter)
3598 {
3599 match = duplicate_decls (decl, *iter, hiding);
3600 if (match)
3601 goto matched;
3602 }
3603 }
3604
3605 return NULL_TREE(tree) nullptr;
3606
3607 matched:
3608 if (match != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3609 {
3610 if (named_module_p ())
3611 BINDING_VECTOR_PARTITION_DUPS_P (mvec)((tree_check ((mvec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3611, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
= true;
3612 else
3613 BINDING_VECTOR_GLOBAL_DUPS_P (mvec)((tree_check ((mvec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3613, __FUNCTION__, (BINDING_VECTOR)))->base.static_flag
)
= true;
3614 }
3615
3616 return match;
3617
3618
3619}
3620
3621/* Record DECL as belonging to the current lexical scope. Check for
3622 errors (such as an incompatible declaration for the same name
3623 already seen in the same scope). IS_FRIEND is true if DECL is
3624 declared as a friend.
3625
3626 Returns either DECL or an old decl for the same name. If an old
3627 decl is returned, it may have been smashed to agree with what DECL
3628 says. */
3629
3630static tree
3631do_pushdecl (tree decl, bool hiding)
3632{
3633 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3634 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3635
3636 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"
, 3636, __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)
3637 set_decl_context_in_fn (current_function_decl, decl);
3638
3639 /* The binding level we will be pushing into. During local class
3640 pushing, we want to push to the containing scope. */
3641 cp_binding_level *level = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
3642 while (level->kind == sk_class
3643 || level->kind == sk_cleanup)
3644 level = level->level_chain;
3645
3646 /* An anonymous namespace has a NULL DECL_NAME, but we still want to
3647 insert it. Other NULL-named decls, not so much. */
3648 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"
, 3648, __FUNCTION__))->decl_minimal.name)
;
3649 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"
, 3649, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)
: TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL)
3650 {
3651 cxx_binding *binding = NULLnullptr; /* Local scope binding. */
3652 tree ns = NULL_TREE(tree) nullptr; /* Searched namespace. */
3653 tree *slot = NULLnullptr; /* Binding slot in namespace. */
3654 tree *mslot = NULLnullptr; /* Current module slot in namespace. */
3655 tree old = NULL_TREE(tree) nullptr;
3656
3657 if (level->kind == sk_namespace)
3658 {
3659 /* We look in the decl's namespace for an existing
3660 declaration, even though we push into the current
3661 namespace. */
3662 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"
, 3662, __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"
, 3662, __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"
, 3662, __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"
, 3662, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
3663 ? 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"
, 3663, __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"
, 3663, __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"
, 3663, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
: current_namespacescope_chain->old_namespace);
3664 /* Create the binding, if this is current namespace, because
3665 that's where we'll be pushing anyway. */
3666 slot = find_namespace_slot (ns, name, ns == current_namespacescope_chain->old_namespace);
3667 if (slot)
3668 {
3669 mslot = get_fixed_binding_slot (slot, name, BINDING_SLOT_CURRENT,
3670 ns == current_namespacescope_chain->old_namespace);
3671 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"
, 3671, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3671, __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"
, 3671, __FUNCTION__, (OVERLOAD))))->function) : *mslot)
;
3672 }
3673 }
3674 else
3675 {
3676 binding = find_local_binding (level, name);
3677 if (binding)
3678 old = binding->value;
3679 }
3680
3681 if (old == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3682 old = NULL_TREE(tree) nullptr;
3683
3684 for (ovl_iterator iter (old); iter; ++iter)
3685 if (iter.using_p ())
3686 ; /* Ignore using decls here. */
3687 else if (iter.hidden_p ()
3688 && TREE_CODE (*iter)((enum tree_code) (*iter)->base.code) == FUNCTION_DECL
3689 && 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"
, 3689, __FUNCTION__))->decl_common.lang_specific)
3690 && DECL_MODULE_IMPORT_P (*iter)(((contains_struct_check (((tree_not_check ((*iter), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3690, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3690, __FUNCTION__))->decl_common.lang_specific)->u.base
.module_import_p)
)
3691 ; /* An undeclared builtin imported from elsewhere. */
3692 else if (tree match
3693 = duplicate_decls (decl, *iter, hiding, iter.hidden_p ()))
3694 {
3695 if (match == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3696 ;
3697 else if (TREE_CODE (match)((enum tree_code) (match)->base.code) == TYPE_DECL)
3698 gcc_checking_assert (REAL_IDENTIFIER_TYPE_VALUE (name)((void)(!(((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3698, __FUNCTION__))->typed.type) == (level->kind == sk_namespace
? (tree) nullptr : ((contains_struct_check ((match), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3700, __FUNCTION__))->typed.type))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3700, __FUNCTION__), 0 : 0))
3699 == (level->kind == sk_namespace((void)(!(((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3698, __FUNCTION__))->typed.type) == (level->kind == sk_namespace
? (tree) nullptr : ((contains_struct_check ((match), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3700, __FUNCTION__))->typed.type))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3700, __FUNCTION__), 0 : 0))
3700 ? NULL_TREE : TREE_TYPE (match)))((void)(!(((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3698, __FUNCTION__))->typed.type) == (level->kind == sk_namespace
? (tree) nullptr : ((contains_struct_check ((match), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3700, __FUNCTION__))->typed.type))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3700, __FUNCTION__), 0 : 0))
;
3701 else if (iter.hidden_p () && !hiding)
3702 {
3703 /* Unhiding a previously hidden decl. */
3704 tree head = iter.reveal_node (old);
3705 if (head != old)
3706 {
3707 gcc_checking_assert (ns)((void)(!(ns) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3707, __FUNCTION__), 0 : 0))
;
3708 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"
, 3708, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3708, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3709 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"
, 3709, __FUNCTION__, (OVERLOAD))))->function)
= head;
3710 else
3711 *slot = head;
3712 }
3713 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"
, 3713, __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"
, 3713, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (match)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
3714 /* We need to check and register the decl now. */
3715 check_extern_c_conflict (match);
3716 }
3717 else if (slot && !hiding
3718 && 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"
, 3718, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3718, __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"
, 3718, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3718, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
3719 {
3720 /* Unhide the non-function. */
3721 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"
, 3721, __FUNCTION__), 0 : 0))
;
3722 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"
, 3722, __FUNCTION__))->typed.type)
)
3723 *slot = match;
3724 else
3725 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"
, 3725, __FUNCTION__, (OVERLOAD))))->function)
= match;
3726 }
3727 return match;
3728 }
3729
3730 /* Check for redeclaring an import. */
3731 if (slot && *slot && TREE_CODE (*slot)((enum tree_code) (*slot)->base.code) == BINDING_VECTOR)
3732 if (tree match
3733 = check_module_override (decl, *slot, hiding, ns, name))
3734 {
3735 if (match == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3736 return match;
3737
3738 /* We found a decl in an interface, push it into this
3739 binding. */
3740 decl = update_binding (NULLnullptr, binding, mslot, old,
3741 match, hiding);
3742
3743 return decl;
3744 }
3745
3746 /* We are pushing a new decl. */
3747
3748 /* Skip a hidden builtin we failed to match already. There can
3749 only be one. */
3750 if (old && anticipated_builtin_p (old))
3751 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"
, 3751, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3752
3753 check_template_shadow (decl);
3754
3755 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"
, 3755, __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"
, 3755, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL))
)
3756 {
3757 check_default_args (decl);
3758
3759 if (hiding)
3760 {
3761 if (level->kind != sk_namespace)
3762 {
3763 /* In a local class, a friend function declaration must
3764 find a matching decl in the innermost non-class scope.
3765 [class.friend/11] */
3766 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"
, 3766, __FUNCTION__))->decl_minimal.locus)
,
3767 "friend declaration %qD in local class without "
3768 "prior local declaration", decl);
3769 /* Don't attempt to push it. */
3770 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3771 }
3772 }
3773 }
3774
3775 if (level->kind != sk_namespace)
3776 {
3777 check_local_shadow (decl);
3778
3779 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == NAMESPACE_DECL)
3780 /* A local namespace alias. */
3781 set_identifier_type_value_with_scope (name, NULL_TREE(tree) nullptr, level);
3782
3783 if (!binding)
3784 binding = create_local_binding (level, name);
3785 }
3786 else if (!slot)
3787 {
3788 ns = current_namespacescope_chain->old_namespace;
3789 slot = find_namespace_slot (ns, name, true);
3790 mslot = get_fixed_binding_slot (slot, name, BINDING_SLOT_CURRENT, true);
3791 /* Update OLD to reflect the namespace we're going to be
3792 pushing into. */
3793 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"
, 3793, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3793, __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"
, 3793, __FUNCTION__, (OVERLOAD))))->function) : *mslot)
;
3794 }
3795
3796 old = update_binding (level, binding, mslot, old, decl, hiding);
3797
3798 if (old != decl)
3799 /* An existing decl matched, use it. */
3800 decl = old;
3801 else
3802 {
3803 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)
3804 {
3805 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"
, 3805, __FUNCTION__))->typed.type)
;
3806
3807 if (type != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3808 {
3809 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"
, 3809, __FUNCTION__))->type_common.name)
!= decl)
3810 set_underlying_type (decl);
3811
3812 set_identifier_type_value_with_scope (name, decl, level);
3813
3814 if (level->kind != sk_namespace
3815 && !instantiating_current_function_p ())
3816 /* This is a locally defined typedef in a function that
3817 is not a template instantation, record it to implement
3818 -Wunused-local-typedefs. */
3819 record_locally_defined_typedef (decl);
3820 }
3821 }
3822 else if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
)
3823 {
3824 if (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"
, 3824, __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"
, 3824, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (decl)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
3825 check_extern_c_conflict (decl);
3826
3827 if (!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"
, 3827, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3827, __FUNCTION__))->decl_common.lang_flag_0)
3828 && VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
3829 maybe_register_incomplete_var (decl);
3830
3831 if (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"
, 3831, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3831, __FUNCTION__))->decl_common.lang_flag_0)
3832 && NAMESPACE_SCOPE_P (decl)(((tree_code_type[(int) (((enum tree_code) (decl)->base.code
))] == tcc_declaration) && (!(((contains_struct_check
((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3832, __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"
, 3832, __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"
, 3832, __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"
, 3832, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)) || ((tree_code_type
[(int) (((enum tree_code) (decl)->base.code))] == tcc_type
) && (((enum tree_code) ((!(! (((tree_class_check ((decl
), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3832, __FUNCTION__))->type_common.context)) || ((enum tree_code
) (((tree_class_check ((decl), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3832, __FUNCTION__))->type_common.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((decl), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3832, __FUNCTION__))->type_common.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)))
)
3833 push_local_extern_decl_alias (decl);
3834 }
3835
3836 if (level->kind == sk_namespace
3837 && TREE_PUBLIC (level->this_entity)((level->this_entity)->base.public_flag)
3838 && !not_module_p ())
3839 maybe_record_mergeable_decl (slot, name, decl);
3840 }
3841 }
3842 else
3843 add_decl_to_level (level, decl);
3844
3845 return decl;
3846}
3847
3848/* Record a decl-node X as belonging to the current lexical scope.
3849 The new binding is hidden if HIDING is true (an anticipated builtin
3850 or hidden friend). */
3851
3852tree
3853pushdecl (tree x, bool hiding)
3854{
3855 bool subtime = timevar_cond_start (TV_NAME_LOOKUP);
3856 tree ret = do_pushdecl (x, hiding);
3857 timevar_cond_stop (TV_NAME_LOOKUP, subtime);
3858 return ret;
3859}
3860
3861/* A mergeable entity is being loaded into namespace NS slot NAME.
3862 Create and return the appropriate vector slot for that. Either a
3863 GMF slot or a module-specific one. */
3864
3865tree *
3866mergeable_namespace_slots (tree ns, tree name, bool is_global, tree *vec)
3867{
3868 tree *mslot = find_namespace_slot (ns, name, true);
3869 tree *vslot = get_fixed_binding_slot
3870 (mslot, name, is_global ? BINDING_SLOT_GLOBAL : BINDING_SLOT_PARTITION, true);
3871
3872 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"
, 3872, __FUNCTION__), 0 : 0))
;
3873 *vec = *mslot;
3874
3875 return vslot;
3876}
3877
3878/* DECL is a new mergeable namespace-scope decl. Add it to the
3879 mergeable entities on GSLOT. */
3880
3881void
3882add_mergeable_namespace_entity (tree *gslot, tree decl)
3883{
3884 *gslot = ovl_make (decl, *gslot);
3885}
3886
3887/* A mergeable entity of KLASS called NAME is being loaded. Return
3888 the set of things it could be. All such non-as_base classes have
3889 been given a member vec. */
3890
3891tree
3892lookup_class_binding (tree klass, tree name)
3893{
3894 tree found = NULL_TREE(tree) nullptr;
3895
3896 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"
, 3896, __FUNCTION__))->type_common.size) != (tree) nullptr
)
)
3897 ;
3898 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"
, 3898, __FUNCTION__))->type_with_lang_specific.lang_specific
)
)
3899 {
3900 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"
, 3900, __FUNCTION__))->type_with_lang_specific.lang_specific
))->members)
;
3901
3902 found = member_vec_binary_search (member_vec, name);
3903 if (!found)
3904 ;
3905 else if (STAT_HACK_P (found)((found) && ((enum tree_code) (found)->base.code) ==
OVERLOAD && ((tree_not_check2 (((tree_check ((found)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3905, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3905, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4))
)
3906 /* Rearrange the stat hack so that we don't need to expose that
3907 internal detail. */
3908 found = ovl_make (STAT_TYPE (found)((contains_struct_check ((found), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3908, __FUNCTION__))->typed.type)
, STAT_DECL (found)(((struct tree_overload*)(tree_check ((found), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3908, __FUNCTION__, (OVERLOAD))))->function)
);
3909 else 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"
, 3909, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3909, __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"
, 3909, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3909, __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"
, 3909, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3909, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
3910 {
3911 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"
, 3911, __FUNCTION__), 0 : 0))
;
3912 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"
, 3912, __FUNCTION__, (OVERLOAD))))->common.chain)
;
3913 }
3914 }
3915 else
3916 {
3917 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"
, 3917, __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"
, 3917, __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"
, 3917, __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"
, 3917, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3917, __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"
, 3917, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3917, __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"
, 3918, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3918, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3918, __FUNCTION__), 0 : 0))
3918 || 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"
, 3917, __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"
, 3917, __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"
, 3917, __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"
, 3917, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3917, __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"
, 3917, __FUNCTION__))->type_common.context)), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3917, __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"
, 3918, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3918, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3918, __FUNCTION__), 0 : 0))
;
3919 found = fields_linear_search (klass, name, false);
3920 }
3921
3922 return found;
3923}
3924
3925/* Given a namespace-level binding BINDING, walk it, calling CALLBACK
3926 for all decls of the current module. When partitions are involved,
3927 decls might be mentioned more than once. Return the accumulation of
3928 CALLBACK results. */
3929
3930unsigned
3931walk_module_binding (tree binding, bitmap partitions,
3932 bool (*callback) (tree decl, WMB_Flags, void *data),
3933 void *data)
3934{
3935 // FIXME: We don't quite deal with using decls naming stat hack
3936 // type. Also using decls exporting something from the same scope.
3937 tree current = binding;
3938 unsigned count = 0;
3939
3940 if (TREE_CODE (binding)((enum tree_code) (binding)->base.code) == BINDING_VECTOR)
3941 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"
, 3941, __FUNCTION__, (BINDING_VECTOR))))->vec[0])
.slots[BINDING_SLOT_CURRENT];
3942
3943 bool decl_hidden = false;
3944 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"
, 3944, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3944, __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"
, 3944, __FUNCTION__))->typed.type) : (tree) nullptr)
)
3945 {
3946 WMB_Flags flags = WMB_None;
3947 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"
, 3947, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3947, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
3948 flags = WMB_Flags (flags | WMB_Hidden);
3949 count += callback (type, flags, data);
3950 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"
, 3950, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3950, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
3951 }
3952
3953 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"
, 3953, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3953, __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"
, 3953, __FUNCTION__, (OVERLOAD))))->function) : current)
); iter; ++iter)
3954 {
3955 if (iter.hidden_p ())
3956 decl_hidden = true;
3957 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"
, 3957, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
))
3958 {
3959 WMB_Flags flags = WMB_None;
3960 if (decl_hidden)
3961 flags = WMB_Flags (flags | WMB_Hidden);
3962 if (iter.using_p ())
3963 {
3964 flags = WMB_Flags (flags | WMB_Using);
3965 if (iter.exporting_p ())
3966 flags = WMB_Flags (flags | WMB_Export);
3967 }
3968 count += callback (*iter, flags, data);
3969 }
3970 decl_hidden = false;
3971 }
3972
3973 if (partitions && TREE_CODE (binding)((enum tree_code) (binding)->base.code) == BINDING_VECTOR)
3974 {
3975 /* Process partition slots. */
3976 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"
, 3976, __FUNCTION__, (BINDING_VECTOR))))->vec)
;
3977 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"
, 3977, __FUNCTION__, (BINDING_VECTOR)))->base.u.dependence_info
.base)
;
3978 if (BINDING_VECTOR_SLOTS_PER_CLUSTER2 == BINDING_SLOTS_FIXED)
3979 {
3980 ix--;
3981 cluster++;
3982 }
3983
3984 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"
, 3984, __FUNCTION__, (BINDING_VECTOR)))->base.volatile_flag
)
;
3985
3986 for (; ix--; cluster++)
3987 for (unsigned jx = 0; jx != BINDING_VECTOR_SLOTS_PER_CLUSTER2; jx++)
3988 if (!cluster->slots[jx].is_lazy ())
3989 if (tree bind = cluster->slots[jx])
3990 {
3991 if (TREE_CODE (bind)((enum tree_code) (bind)->base.code) == NAMESPACE_DECL
3992 && !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"
, 3992, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 3992, __FUNCTION__))->decl_common.abstract_origin)
)
3993 {
3994 if (unsigned base = cluster->indices[jx].base)
3995 if (unsigned span = cluster->indices[jx].span)
3996 do
3997 if (bitmap_bit_p (partitions, base))
3998 goto found;
3999 while (++base, --span);
4000 /* Not a partition's namespace. */
4001 continue;
4002 found:
4003
4004 WMB_Flags flags = WMB_None;
4005 if (maybe_dups)
4006 flags = WMB_Flags (flags | WMB_Dups);
4007 count += callback (bind, flags, data);
4008 }
4009 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"
, 4009, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4009, __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"
, 4009, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
)
4010 {
4011 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"
, 4011, __FUNCTION__))->typed.type)
)
4012 {
4013 WMB_Flags flags = WMB_None;
4014 if (maybe_dups)
4015 flags = WMB_Flags (flags | WMB_Dups);
4016 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"
, 4016, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4016, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
4017 flags = WMB_Flags (flags | WMB_Hidden);
4018
4019 count += callback (btype, flags, data);
4020 }
4021 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"
, 4021, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4021, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
;
4022 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"
, 4022, __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"
, 4022, __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"
, 4022, __FUNCTION__, (OVERLOAD))))->function)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4022, __FUNCTION__, (OVERLOAD)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4022, __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"
, 4022, __FUNCTION__, (OVERLOAD))))->function)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4022, __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"
, 4022, __FUNCTION__, (OVERLOAD))))->function))
);
4023 iter; ++iter)
4024 {
4025 if (iter.hidden_p ())
4026 hidden = true;
4027 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"
, 4028, __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"
, 4028, __FUNCTION__), 0 : 0))
4028 (!(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"
, 4028, __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"
, 4028, __FUNCTION__), 0 : 0))
;
4029
4030 WMB_Flags flags = WMB_None;
4031 if (maybe_dups)
4032 flags = WMB_Flags (flags | WMB_Dups);
4033 if (decl_hidden)
4034 flags = WMB_Flags (flags | WMB_Hidden);
4035 if (iter.using_p ())
4036 {
4037 flags = WMB_Flags (flags | WMB_Using);
4038 if (iter.exporting_p ())
4039 flags = WMB_Flags (flags | WMB_Export);
4040 }
4041 count += callback (*iter, flags, data);
4042 hidden = false;
4043 }
4044 }
4045 }
4046 }
4047
4048 return count;
4049}
4050
4051/* Imported module MOD has a binding to NS::NAME, stored in section
4052 SNUM. */
4053
4054bool
4055import_module_binding (tree ns, tree name, unsigned mod, unsigned snum)
4056{
4057 tree *slot = find_namespace_slot (ns, name, true);
4058 binding_slot *mslot = append_imported_binding_slot (slot, name, mod);
4059
4060 if (mslot->is_lazy () || *mslot)
4061 /* Oops, something was already there. */
4062 return false;
4063
4064 mslot->set_lazy (snum);
4065 return true;
4066}
4067
4068/* An import of MODULE is binding NS::NAME. There should be no
4069 existing binding for >= MODULE. MOD_GLOB indicates whether MODULE
4070 is a header_unit (-1) or part of the current module (+1). VALUE
4071 and TYPE are the value and type bindings. VISIBLE are the value
4072 bindings being exported. */
4073
4074bool
4075set_module_binding (tree ns, tree name, unsigned mod, int mod_glob,
4076 tree value, tree type, tree visible)
4077{
4078 if (!value)
4079 /* Bogus BMIs could give rise to nothing to bind. */
4080 return false;
4081
4082 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"
, 4083, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4083, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4083, __FUNCTION__), 0 : 0))
4083 || 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"
, 4083, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4083, __FUNCTION__))->decl_common.abstract_origin)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4083, __FUNCTION__), 0 : 0))
;
4084 gcc_checking_assert (mod)((void)(!(mod) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4084, __FUNCTION__), 0 : 0))
;
4085
4086 tree *slot = find_namespace_slot (ns, name, true);
4087 binding_slot *mslot = search_imported_binding_slot (slot, mod);
4088
4089 if (!mslot || !mslot->is_lazy ())
4090 /* Again, bogus BMI could give find to missing or already loaded slot. */
4091 return false;
4092
4093 tree bind = value;
4094 if (type || visible != bind || mod_glob)
4095 {
4096 bind = stat_hack (bind, type);
4097 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"
, 4097, __FUNCTION__, (OVERLOAD))))->common.chain)
= visible;
4098 if ((mod_glob > 0 && TREE_PUBLIC (ns)((ns)->base.public_flag))
4099 || (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"
, 4099, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
))
4100 STAT_TYPE_VISIBLE_P (bind)(((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4100, __FUNCTION__, (OVERLOAD))))->base.used_flag)
= true;
4101 }
4102
4103 /* Note if this is this-module or global binding. */
4104 if (mod_glob > 0)
4105 MODULE_BINDING_PARTITION_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4105, __FUNCTION__, (OVERLOAD)))->base.volatile_flag)
= true;
4106 else if (mod_glob < 0)
4107 MODULE_BINDING_GLOBAL_P (bind)((tree_check ((bind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4107, __FUNCTION__, (OVERLOAD)))->base.static_flag)
= true;
4108
4109 *mslot = bind;
4110
4111 return true;
4112}
4113
4114void
4115add_module_namespace_decl (tree ns, tree decl)
4116{
4117 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"
, 4117, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4117, __FUNCTION__))->common.chain))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4117, __FUNCTION__), 0 : 0))
;
4118 gcc_checking_assert (!(VAR_OR_FUNCTION_DECL_P (decl)((void)(!(!((((enum tree_code) (decl)->base.code) == VAR_DECL
|| ((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
&& ((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4119, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4119, __FUNCTION__))->decl_common.lang_flag_0))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4119, __FUNCTION__), 0 : 0))
4119 && DECL_LOCAL_DECL_P (decl)))((void)(!(!((((enum tree_code) (decl)->base.code) == VAR_DECL
|| ((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
&& ((contains_struct_check (((tree_check2 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4119, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4119, __FUNCTION__))->decl_common.lang_flag_0))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4119, __FUNCTION__), 0 : 0))
;
4120 if (CHECKING_P1)
4121 /* Expensive already-there? check. */
4122 for (auto probe = 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"
, 4122, __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"
, 4122, __FUNCTION__); &lt->u.ns; })->level)
->names; probe;
4123 probe = DECL_CHAIN (probe)(((contains_struct_check (((contains_struct_check ((probe), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4123, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4123, __FUNCTION__))->common.chain))
)
4124 gcc_assert (decl != probe)((void)(!(decl != probe) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4124, __FUNCTION__), 0 : 0))
;
4125
4126 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"
, 4126, __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"
, 4126, __FUNCTION__); &lt->u.ns; })->level)
, decl);
4127
4128 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
4129 maybe_register_incomplete_var (decl);
4130
4131 if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
4132 && 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"
, 4132, __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"
, 4132, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (decl)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
4133 check_extern_c_conflict (decl);
4134}
4135
4136/* Enter DECL into the symbol table, if that's appropriate. Returns
4137 DECL, or a modified version thereof. */
4138
4139tree
4140maybe_push_decl (tree decl)
4141{
4142 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"
, 4142, __FUNCTION__))->typed.type)
;
4143
4144 /* Add this decl to the current binding level, but not if it comes
4145 from another scope, e.g. a static member variable. TEM may equal
4146 DECL or it may be a previous decl of the same name. */
4147 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]
4148 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != PARM_DECL
4149 && 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"
, 4149, __FUNCTION__))->decl_minimal.context)
!= NULL_TREE(tree) nullptr
4150 /* Definitions of namespace members outside their namespace are
4151 possible. */
4152 && !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"
, 4152, __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"
, 4152, __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"
, 4152, __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"
, 4152, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
4153 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && !namespace_bindings_p ())
4154 || type == unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE]
4155 /* The declaration of a template specialization does not affect
4156 the functions available for overload resolution, so we do not
4157 call pushdecl. */
4158 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
4159 && 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"
, 4159, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
))
4160 return decl;
4161 else
4162 return pushdecl (decl);
4163}
4164
4165/* Bind DECL to ID in the current_binding_level, assumed to be a local
4166 binding level. If IS_USING is true, DECL got here through a
4167 using-declaration. */
4168
4169static void
4170push_local_binding (tree id, tree decl, bool is_using)
4171{
4172 /* Skip over any local classes. This makes sense if we call
4173 push_local_binding with a friend decl of a local class. */
4174 cp_binding_level *b = innermost_nonclass_level ();
4175
4176 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"
, 4176, __FUNCTION__), 0 : 0))
;
4177 if (find_local_binding (b, id))
4178 {
4179 /* Supplement the existing binding. */
4180 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"
, 4180, __FUNCTION__, (IDENTIFIER_NODE))))->bindings)
, decl))
4181 /* It didn't work. Something else must be bound at this
4182 level. Do not add DECL to the list of things to pop
4183 later. */
4184 return;
4185 }
4186 else
4187 /* Create a new binding. */
4188 push_binding (id, decl, b);
4189
4190 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == OVERLOAD || is_using)
4191 /* We must put the OVERLOAD or using into a TREE_LIST since we
4192 cannot use the decl's chain itself. */
4193 decl = build_tree_list (id, decl);
4194
4195 /* And put DECL on the list of things declared by the current
4196 binding level. */
4197 add_decl_to_level (b, decl);
4198}
4199
4200
4201/* true means unconditionally make a BLOCK for the next level pushed. */
4202
4203static bool keep_next_level_flag;
4204
4205static int binding_depth = 0;
4206
4207static void
4208indent (int depth)
4209{
4210 int i;
4211
4212 for (i = 0; i < depth * 2; i++)
4213 putc (' ', stderrstderr);
4214}
4215
4216/* Return a string describing the kind of SCOPE we have. */
4217static const char *
4218cp_binding_level_descriptor (cp_binding_level *scope)
4219{
4220 /* The order of this table must match the "scope_kind"
4221 enumerators. */
4222 static const char* scope_kind_names[] = {
4223 "block-scope",
4224 "cleanup-scope",
4225 "try-scope",
4226 "catch-scope",
4227 "for-scope",
4228 "function-parameter-scope",
4229 "class-scope",
4230 "namespace-scope",
4231 "template-parameter-scope",
4232 "template-explicit-spec-scope"
4233 };
4234 const scope_kind kind = scope->explicit_spec_p
4235 ? sk_template_spec : scope->kind;
4236
4237 return scope_kind_names[kind];
4238}
4239
4240/* Output a debugging information about SCOPE when performing
4241 ACTION at LINE. */
4242static void
4243cp_binding_level_debug (cp_binding_level *scope, int line, const char *action)
4244{
4245 const char *desc = cp_binding_level_descriptor (scope);
4246 if (scope->this_entity)
4247 verbatim ("%s %<%s(%E)%> %p %d", action, desc,
4248 scope->this_entity, (void *) scope, line);
4249 else
4250 verbatim ("%s %s %p %d", action, desc, (void *) scope, line);
4251}
4252
4253/* A chain of binding_level structures awaiting reuse. */
4254
4255static GTY((deletable)) cp_binding_level *free_binding_level;
4256
4257/* Insert SCOPE as the innermost binding level. */
4258
4259void
4260push_binding_level (cp_binding_level *scope)
4261{
4262 /* Add it to the front of currently active scopes stack. */
4263 scope->level_chain = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4264 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= scope;
4265 keep_next_level_flag = false;
4266
4267 if (ENABLE_SCOPE_CHECKING0)
4268 {
4269 scope->binding_depth = binding_depth;
4270 indent (binding_depth);
4271 cp_binding_level_debug (scope, LOCATION_LINE (input_location)((expand_location (input_location)).line),
4272 "push");
4273 binding_depth++;
4274 }
4275}
4276
4277/* Create a new KIND scope and make it the top of the active scopes stack.
4278 ENTITY is the scope of the associated C++ entity (namespace, class,
4279 function, C++0x enumeration); it is NULL otherwise. */
4280
4281cp_binding_level *
4282begin_scope (scope_kind kind, tree entity)
4283{
4284 cp_binding_level *scope;
4285
4286 /* Reuse or create a struct for this binding level. */
4287 if (!ENABLE_SCOPE_CHECKING0 && free_binding_level)
4288 {
4289 scope = free_binding_level;
4290 free_binding_level = scope->level_chain;
4291 memset (scope, 0, sizeof (cp_binding_level));
4292 }
4293 else
4294 scope = ggc_cleared_alloc<cp_binding_level> ();
4295
4296 scope->this_entity = entity;
4297 scope->more_cleanups_ok = true;
4298 switch (kind)
4299 {
4300 case sk_cleanup:
4301 scope->keep = true;
4302 break;
4303
4304 case sk_template_spec:
4305 scope->explicit_spec_p = true;
4306 kind = sk_template_parms;
4307 /* Fall through. */
4308 case sk_template_parms:
4309 case sk_block:
4310 case sk_try:
4311 case sk_catch:
4312 case sk_for:
4313 case sk_cond:
4314 case sk_class:
4315 case sk_scoped_enum:
4316 case sk_transaction:
4317 case sk_omp:
4318 scope->keep = keep_next_level_flag;
4319 break;
4320
4321 case sk_function_parms:
4322 scope->keep = keep_next_level_flag;
4323 if (entity)
4324 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"
, 4324, __FUNCTION__, (TEMPLATE_DECL))))))))->result : entity
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4324, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4324, __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"
, 4324, __FUNCTION__, (TEMPLATE_DECL))))))))->result : entity
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4324, __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"
, 4324, __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"
, 4324, __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"
, 4324, __FUNCTION__); &lt->u.fn; })->immediate_fn_p
: false)
;
4325 break;
4326
4327 case sk_namespace:
4328 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"
, 4328, __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"
, 4328, __FUNCTION__); &lt->u.ns; })->level)
= scope;
4329 break;
4330
4331 default:
4332 /* Should not happen. */
4333 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4333, __FUNCTION__))
;
4334 break;
4335 }
4336 scope->kind = kind;
4337
4338 push_binding_level (scope);
4339
4340 return scope;
4341}
4342
4343/* We're about to leave current scope. Pop the top of the stack of
4344 currently active scopes. Return the enclosing scope, now active. */
4345
4346cp_binding_level *
4347leave_scope (void)
4348{
4349 cp_binding_level *scope = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4350
4351 if (scope->kind == sk_namespace && class_binding_levelscope_chain->class_bindings)
4352 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;
4353
4354 /* We cannot leave a scope, if there are none left. */
4355 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"
, 4355, __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"
, 4355, __FUNCTION__); &lt->u.ns; })->level)
)
4356 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"
, 4356, __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"
, 4356, __FUNCTION__); &lt->u.ns; })->level))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/name-lookup.c"
, 4356, __FUNCTION__), 0 : 0))
;
4357
4358 if (ENABLE_SCOPE_CHECKING0)
4359 {
4360 indent (--binding_depth);
4361 cp_binding_level_debug (scope, LOCATION_LINE (input_location)((expand_location (input_location)).line),
4362 "leave");
4363 }
4364
4365 /* Move one nesting level up. */
4366 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= scope->level_chain;
4367
4368 /* Namespace-scopes are left most probably temporarily, not
4369 completely; they can be reopened later, e.g. in namespace-extension
4370 or any name binding activity that requires us to resume a
4371 namespace. For classes, we cache some binding levels. For other
4372 scopes, we just make the structure available for reuse. */
4373 if (scope->kind != sk_namespace
4374 && scope != previous_class_levelscope_chain->x_previous_class_level)
4375 {
4376 scope->level_chain = free_binding_level;
4377 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"
, 4378, __FUNCTION__), 0 : 0))
4378 || 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"
, 4378, __FUNCTION__), 0 : 0))
;
4379 free_binding_level = scope;
4380 }
4381
4382 if (scope->kind == sk_class)
4383 {
4384 /* Reset DEFINING_CLASS_P to allow for reuse of a
4385 class-defining scope in a non-defining context. */
4386 scope->defining_class_p = 0;
4387
4388 /* Find the innermost enclosing class scope, and reset
4389 CLASS_BINDING_LEVEL appropriately. */
4390 class_binding_levelscope_chain->class_bindings = NULLnullptr;
4391 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)
4392 if (scope->kind == sk_class)
4393 {
4394 class_binding_levelscope_chain->class_bindings = scope;
4395 break;
4396 }
4397 }
4398
4399 return current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4400}
4401
4402/* When we exit a toplevel class scope, we save its binding level so
4403 that we can restore it quickly. Here, we've entered some other
4404 class, so we must invalidate our cache. */
4405
4406void
4407invalidate_class_lookup_cache (void)
4408{
4409 previous_class_levelscope_chain->x_previous_class_level->level_chain = free_binding_level;
4410 free_binding_level = previous_class_levelscope_chain->x_previous_class_level;
4411 previous_class_levelscope_chain->x_previous_class_level = NULLnullptr;
4412}
4413
4414static void
4415resume_scope (cp_binding_level* b)
4416{
4417 /* Resuming binding levels is meant only for namespaces,
4418 and those cannot nest into classes. */
4419 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"
, 4419, __FUNCTION__), 0 : 0))
;
4420 /* Also, resuming a non-directly nested namespace is a no-no. */
4421 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"
, 4421, __FUNCTION__), 0 : 0))
;
4422 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
= b;
4423 if (ENABLE_SCOPE_CHECKING0)
4424 {
4425 b->binding_depth = binding_depth;
4426 indent (binding_depth);
4427 cp_binding_level_debug (b, LOCATION_LINE (input_location)((expand_location (input_location)).line), "resume");
4428 binding_depth++;
4429 }
4430}
4431
4432/* Return the innermost binding level that is not for a class scope. */
4433
4434static cp_binding_level *
4435innermost_nonclass_level (void)
4436{
4437 cp_binding_level *b;
4438
4439 b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
4440 while (b->kind == sk_class)
4441 b = b->level_chain;
4442
4443 return b;
4444}
4445
4446/* We're defining an object of type TYPE. If it needs a cleanup, but
4447 we're not allowed to add any more objects with cleanups to the current
4448 scope, create a new binding level. */
4449
4450void
4451maybe_push_cleanup_level (tree type)
4452{
4453 if (type != error_mark_nodeglobal_trees[TI_ERROR_MARK]
4454 && 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"
, 4454, __FUNCTION__))->type_common.lang_flag_4))
4455 && current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->more_cleanups_ok == 0)
4456 {
4457 begin_scope (sk_cleanup, NULLnullptr);
4458 current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->statement_list = push_stmt_list ();
4459 }
4460}
4461
4462/* Return true if we are in the global binding level. */
4463
4464bool
4465global_bindings_p (void)
4466{
4467 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"
, 4467, __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"
, 4467, __FUNCTION__); &lt->u.ns; })->level))
;
4468}
4469
4470/* True if we are currently in a toplevel binding level. This
4471 means either the global binding level or a namespace in a toplevel
4472 binding level. Since there are no non-toplevel namespace levels,
4473 this really means any namespace or template parameter level. We
4474 also include a class whose context is toplevel. */
4475
4476bool
4477toplevel_bindings_p (void)
4478{
4479 cp_binding_level *b = innermost_nonclass_level ();
4480
4481 return b->kind == sk_namespace || b->kind == sk_template_parms;
4482}
4483
4484/* True if this is a namespace scope, or if we are defining a class
4485 which is itself at namespace scope, or whose enclosing class is
4486 such a class, etc. */
4487
4488bool
4489namespace_bindings_p (void)
4490{
4491 cp_binding_level *b = innermost_nonclass_level ();
4492
4493 return b->kind == sk_namespace;
4494}
4495
4496/* True if the innermost non-class scope is a block scope. */
4497
4498bool
4499local_bindings_p (void)
4500{
4501 cp_binding_level *b = innermost_nonclass_level ();
4502 return b->kind < sk_function_parms || b->kind == sk_omp;
4503}
4504
4505/* True if the current level needs to have a BLOCK made. */
4506
4507bool
4508kept_level_p (void)
4509{
4510 return (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->blocks != NULL_TREE(tree) nullptr
4511 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->keep
4512 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_cleanup
4513 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->names != NULL_TREE(tree) nullptr
4514 || current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->using_directives);
4515}
4516
4517/* Returns the kind of the innermost scope. */
4518
4519scope_kind
4520innermost_scope_kind (void)
4521{
4522 return current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind;
4523}
4524
4525/* Returns true if this scope was created to store template parameters. */
4526
4527bool
4528template_parm_scope_p (void)
4529{