Bug Summary

File:build/gcc/cp/decl2.cc
Warning:line 3316, column 4
Value stored to 'class_type' is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-suse-linux -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name decl2.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/15.0.7 -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I cp -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/backward -internal-isystem /usr/lib64/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2023-03-27-141847-20772-1/report-OazWgp.plist -x c++ /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc
1/* Process declarations and variables for C++ compiler.
2 Copyright (C) 1988-2023 Free Software Foundation, Inc.
3 Hacked by Michael Tiemann (tiemann@cygnus.com)
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
22/* Process declarations and symbol lookup for C++ front end.
23 Also constructs types; the standard scalar types at initialization,
24 and structure, union, array and enum types when they are declared. */
25
26/* ??? not all decl nodes are given the most useful possible
27 line numbers. For example, the CONST_DECLs for enum values. */
28
29#include "config.h"
30#include "system.h"
31#include "coretypes.h"
32#include "memmodel.h"
33#include "target.h"
34#include "cp-tree.h"
35#include "c-family/c-common.h"
36#include "timevar.h"
37#include "stringpool.h"
38#include "cgraph.h"
39#include "varasm.h"
40#include "attribs.h"
41#include "stor-layout.h"
42#include "calls.h"
43#include "decl.h"
44#include "toplev.h"
45#include "c-family/c-objc.h"
46#include "c-family/c-pragma.h"
47#include "dumpfile.h"
48#include "intl.h"
49#include "c-family/c-ada-spec.h"
50#include "asan.h"
51#include "optabs-query.h"
52#include "omp-general.h"
53
54/* Id for dumping the raw trees. */
55int raw_dump_id;
56
57extern cpp_reader *parse_in;
58
59static tree start_objects (bool, unsigned, bool);
60static tree finish_objects (bool, unsigned, tree, bool = true);
61static tree start_partial_init_fini_fn (bool, unsigned, unsigned);
62static void finish_partial_init_fini_fn (tree);
63static void emit_partial_init_fini_fn (bool, unsigned, tree,
64 unsigned, location_t);
65static void one_static_initialization_or_destruction (bool, tree, tree);
66static void generate_ctor_or_dtor_function (bool, unsigned, tree, location_t);
67static tree prune_vars_needing_no_initialization (tree *);
68static void write_out_vars (tree);
69static void import_export_class (tree);
70static tree get_guard_bits (tree);
71static void determine_visibility_from_class (tree, tree);
72static bool determine_hidden_inline (tree);
73
74/* A list of static class variables. This is needed, because a
75 static class variable can be declared inside the class without
76 an initializer, and then initialized, statically, outside the class. */
77static GTY(()) vec<tree, va_gc> *pending_statics;
78
79/* A list of functions which were declared inline, but which we
80 may need to emit outline anyway. */
81static GTY(()) vec<tree, va_gc> *deferred_fns;
82
83/* A list of decls that use types with no linkage, which we need to make
84 sure are defined. */
85static GTY(()) vec<tree, va_gc> *no_linkage_decls;
86
87/* A vector of alternating decls and identifiers, where the latter
88 is to be an alias for the former if the former is defined. */
89static GTY(()) vec<tree, va_gc> *mangling_aliases;
90
91/* hash traits for declarations. Hashes single decls via
92 DECL_ASSEMBLER_NAME_RAW. */
93
94struct mangled_decl_hash : ggc_remove <tree>
95{
96 typedef tree value_type; /* A DECL. */
97 typedef tree compare_type; /* An identifier. */
98
99 static hashval_t hash (const value_type decl)
100 {
101 return IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME_RAW (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 101, __FUNCTION__))->decl_with_vis.assembler_name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 101, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)
;
102 }
103 static bool equal (const value_type existing, compare_type candidate)
104 {
105 tree name = DECL_ASSEMBLER_NAME_RAW (existing)((contains_struct_check ((existing), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 105, __FUNCTION__))->decl_with_vis.assembler_name)
;
106 return candidate == name;
107 }
108
109 static const bool empty_zero_p = true;
110 static inline void mark_empty (value_type &p) {p = NULL_TREE(tree) __null;}
111 static inline bool is_empty (value_type p) {return !p;}
112
113 static bool is_deleted (value_type e)
114 {
115 return e == reinterpret_cast <value_type> (1);
116 }
117 static void mark_deleted (value_type &e)
118 {
119 e = reinterpret_cast <value_type> (1);
120 }
121};
122
123/* A hash table of decls keyed by mangled name. Used to figure out if
124 we need compatibility aliases. */
125static GTY(()) hash_table<mangled_decl_hash> *mangled_decls;
126
127// Hash table mapping priority to lists of variables or functions.
128struct priority_map_traits
129{
130 typedef unsigned key_type;
131 typedef tree value_type;
132 static const bool maybe_mx = true;
133 static hashval_t hash (key_type v)
134 {
135 return hashval_t (v);
136 }
137 static bool equal_keys (key_type k1, key_type k2)
138 {
139 return k1 == k2;
140 }
141 template <typename T> static void remove (T &)
142 {
143 }
144 // Zero is not a priority
145 static const bool empty_zero_p = true;
146 template <typename T> static bool is_empty (const T &entry)
147 {
148 return entry.m_key == 0;
149 }
150 template <typename T> static void mark_empty (T &entry)
151 {
152 entry.m_key = 0;
153 }
154 // Entries are not deleteable
155 template <typename T> static bool is_deleted (const T &)
156 {
157 return false;
158 }
159 template <typename T> static void mark_deleted (T &)
160 {
161 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 161, __FUNCTION__))
;
162 }
163};
164
165typedef hash_map<unsigned/*Priority*/, tree/*List*/,
166 priority_map_traits> priority_map_t;
167
168/* A pair of such hash tables, indexed by initp -- one for fini and
169 one for init. The fini table is only ever used when !cxa_atexit. */
170static GTY(()) priority_map_t *static_init_fini_fns[2];
171
172/* Nonzero if we're done parsing and into end-of-file activities. */
173
174int at_eof;
175
176/* True if note_mangling_alias should enqueue mangling aliases for
177 later generation, rather than emitting them right away. */
178
179bool defer_mangling_aliases = true;
180
181
182/* Return a member function type (a METHOD_TYPE), given FNTYPE (a
183 FUNCTION_TYPE), CTYPE (class type), and QUALS (the cv-qualifiers
184 that apply to the function). */
185
186tree
187build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals,
188 cp_ref_qualifier rqual)
189{
190 if (fntype == error_mark_nodeglobal_trees[TI_ERROR_MARK] || ctype == error_mark_nodeglobal_trees[TI_ERROR_MARK])
191 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
192
193 gcc_assert (FUNC_OR_METHOD_TYPE_P (fntype))((void)(!((((enum tree_code) (fntype)->base.code) == FUNCTION_TYPE
|| ((enum tree_code) (fntype)->base.code) == METHOD_TYPE)
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 193, __FUNCTION__), 0 : 0))
;
194
195 cp_cv_quals type_quals = quals & ~TYPE_QUAL_RESTRICT;
196 ctype = cp_build_qualified_type (ctype, type_quals);
197
198 tree newtype
199 = build_method_type_directly (ctype, TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 199, __FUNCTION__))->typed.type)
,
200 (TREE_CODE (fntype)((enum tree_code) (fntype)->base.code) == METHOD_TYPE
201 ? TREE_CHAIN (TYPE_ARG_TYPES (fntype))((contains_struct_check ((((tree_check2 ((fntype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 201, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 201, __FUNCTION__))->common.chain)
202 : TYPE_ARG_TYPES (fntype)((tree_check2 ((fntype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 202, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
));
203 if (tree attrs = TYPE_ATTRIBUTES (fntype)((tree_class_check ((fntype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 203, __FUNCTION__))->type_common.attributes)
)
204 newtype = cp_build_type_attribute_variant (newtype, attrs);
205 newtype = build_cp_fntype_variant (newtype, rqual,
206 TYPE_RAISES_EXCEPTIONS (fntype)((tree_class_check (((tree_check2 ((fntype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 206, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 206, __FUNCTION__))->type_non_common.lang_1)
,
207 TYPE_HAS_LATE_RETURN_TYPE (fntype)(((tree_class_check (((tree_check2 ((fntype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 207, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 207, __FUNCTION__))->type_common.lang_flag_2))
);
208
209 return newtype;
210}
211
212/* Return a variant of FNTYPE, a FUNCTION_TYPE or METHOD_TYPE, with its
213 return type changed to NEW_RET. */
214
215tree
216change_return_type (tree new_ret, tree fntype)
217{
218 if (new_ret == error_mark_nodeglobal_trees[TI_ERROR_MARK])
219 return fntype;
220
221 if (same_type_p (new_ret, TREE_TYPE (fntype))comptypes ((new_ret), (((contains_struct_check ((fntype), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 221, __FUNCTION__))->typed.type)), 0)
)
222 return fntype;
223
224 tree newtype;
225 tree args = TYPE_ARG_TYPES (fntype)((tree_check2 ((fntype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 225, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
226
227 if (TREE_CODE (fntype)((enum tree_code) (fntype)->base.code) == FUNCTION_TYPE)
228 {
229 newtype = build_function_type (new_ret, args);
230 newtype = apply_memfn_quals (newtype,
231 type_memfn_quals (fntype));
232 }
233 else
234 newtype = build_method_type_directly
235 (class_of_this_parm (fntype), new_ret, TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 235, __FUNCTION__))->common.chain)
);
236
237 if (tree attrs = TYPE_ATTRIBUTES (fntype)((tree_class_check ((fntype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 237, __FUNCTION__))->type_common.attributes)
)
238 newtype = cp_build_type_attribute_variant (newtype, attrs);
239 newtype = cxx_copy_lang_qualifiers (newtype, fntype);
240
241 return newtype;
242}
243
244/* Build a PARM_DECL of FN with NAME and TYPE, and set DECL_ARG_TYPE
245 appropriately. */
246
247tree
248cp_build_parm_decl (tree fn, tree name, tree type)
249{
250 tree parm = build_decl (input_location,
251 PARM_DECL, name, type);
252 DECL_CONTEXT (parm)((contains_struct_check ((parm), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 252, __FUNCTION__))->decl_minimal.context)
= fn;
253
254 /* DECL_ARG_TYPE is only used by the back end and the back end never
255 sees templates. */
256 if (!processing_template_declscope_chain->x_processing_template_decl)
257 DECL_ARG_TYPE (parm)((tree_check ((parm), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 257, __FUNCTION__, (PARM_DECL)))->decl_common.initial)
= type_passed_as (type);
258
259 return parm;
260}
261
262/* Returns a PARM_DECL of FN for a parameter of the indicated TYPE, with the
263 indicated NAME. */
264
265tree
266build_artificial_parm (tree fn, tree name, tree type)
267{
268 tree parm = cp_build_parm_decl (fn, name, type);
269 DECL_ARTIFICIAL (parm)((contains_struct_check ((parm), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 269, __FUNCTION__))->decl_common.artificial_flag)
= 1;
270 /* All our artificial parms are implicitly `const'; they cannot be
271 assigned to. */
272 TREE_READONLY (parm)((non_type_check ((parm), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 272, __FUNCTION__))->base.readonly_flag)
= 1;
273 return parm;
274}
275
276/* Constructors for types with virtual baseclasses need an "in-charge" flag
277 saying whether this constructor is responsible for initialization of
278 virtual baseclasses or not. All destructors also need this "in-charge"
279 flag, which additionally determines whether or not the destructor should
280 free the memory for the object.
281
282 This function adds the "in-charge" flag to member function FN if
283 appropriate. It is called from grokclassfn and tsubst.
284 FN must be either a constructor or destructor.
285
286 The in-charge flag follows the 'this' parameter, and is followed by the
287 VTT parm (if any), then the user-written parms. */
288
289void
290maybe_retrofit_in_chrg (tree fn)
291{
292 tree basetype, arg_types, parms, parm, fntype;
293
294 /* If we've already add the in-charge parameter don't do it again. */
295 if (DECL_HAS_IN_CHARGE_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 295, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn))
, (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 295, __FUNCTION__))->decl_common.lang_specific); if (!((
(enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum
tree_code) (fn)->base.code) == TEMPLATE_DECL && (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 295, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 295, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 295, __FUNCTION__); &lt->u.fn; })->has_in_charge_parm_p
)
)
296 return;
297
298 /* When processing templates we can't know, in general, whether or
299 not we're going to have virtual baseclasses. */
300 if (processing_template_declscope_chain->x_processing_template_decl)
301 return;
302
303 /* We don't need an in-charge parameter for constructors that don't
304 have virtual bases. */
305 if (DECL_CONSTRUCTOR_P (fn)((tree_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 305, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn))
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 305, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
306 && !CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn))((((tree_class_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 306, __FUNCTION__))->decl_minimal.context)), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 306, __FUNCTION__))->type_with_lang_specific.lang_specific
))->vbases)
)
307 return;
308
309 arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 309, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 309, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
310 basetype = TREE_TYPE (TREE_VALUE (arg_types))((contains_struct_check ((((tree_check ((arg_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 310, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 310, __FUNCTION__))->typed.type)
;
311 arg_types = TREE_CHAIN (arg_types)((contains_struct_check ((arg_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 311, __FUNCTION__))->common.chain)
;
312
313 parms = DECL_CHAIN (DECL_ARGUMENTS (fn))(((contains_struct_check (((contains_struct_check ((((tree_check
((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 313, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 313, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 313, __FUNCTION__))->common.chain))
;
314
315 /* If this is a subobject constructor or destructor, our caller will
316 pass us a pointer to our VTT. */
317 if (CLASSTYPE_VBASECLASSES (DECL_CONTEXT (fn))((((tree_class_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 317, __FUNCTION__))->decl_minimal.context)), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 317, __FUNCTION__))->type_with_lang_specific.lang_specific
))->vbases)
)
318 {
319 parm = build_artificial_parm (fn, vtt_parm_identifiercp_global_trees[CPTI_VTT_PARM_IDENTIFIER], vtt_parm_typecp_global_trees[CPTI_VTT_PARM_TYPE]);
320
321 /* First add it to DECL_ARGUMENTS between 'this' and the real args... */
322 DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 322, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 322, __FUNCTION__))->common.chain))
= parms;
323 parms = parm;
324
325 /* ...and then to TYPE_ARG_TYPES. */
326 arg_types = hash_tree_chain (vtt_parm_typecp_global_trees[CPTI_VTT_PARM_TYPE], arg_types);
327
328 DECL_HAS_VTT_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 328, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn))
, (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 328, __FUNCTION__))->decl_common.lang_specific); if (!((
(enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum
tree_code) (fn)->base.code) == TEMPLATE_DECL && (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 328, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 328, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 328, __FUNCTION__); &lt->u.fn; })->has_vtt_parm_p
)
= 1;
329 }
330
331 /* Then add the in-charge parm (before the VTT parm). */
332 parm = build_artificial_parm (fn, in_charge_identifiercp_global_trees[CPTI_IN_CHARGE_IDENTIFIER], integer_type_nodeinteger_types[itk_int]);
333 DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 333, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 333, __FUNCTION__))->common.chain))
= parms;
334 parms = parm;
335 arg_types = hash_tree_chain (integer_type_nodeinteger_types[itk_int], arg_types);
336
337 /* Insert our new parameter(s) into the list. */
338 DECL_CHAIN (DECL_ARGUMENTS (fn))(((contains_struct_check (((contains_struct_check ((((tree_check
((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 338, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 338, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 338, __FUNCTION__))->common.chain))
= parms;
339
340 /* And rebuild the function type. */
341 fntype = build_method_type_directly (basetype, TREE_TYPE (TREE_TYPE (fn))((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 341, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 341, __FUNCTION__))->typed.type)
,
342 arg_types);
343 if (TYPE_ATTRIBUTES (TREE_TYPE (fn))((tree_class_check ((((contains_struct_check ((fn), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 343, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 343, __FUNCTION__))->type_common.attributes)
)
344 fntype = (cp_build_type_attribute_variant
345 (fntype, TYPE_ATTRIBUTES (TREE_TYPE (fn))((tree_class_check ((((contains_struct_check ((fn), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 345, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 345, __FUNCTION__))->type_common.attributes)
));
346 fntype = cxx_copy_lang_qualifiers (fntype, TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 346, __FUNCTION__))->typed.type)
);
347 TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 347, __FUNCTION__))->typed.type)
= fntype;
348
349 /* Now we've got the in-charge parameter. */
350 DECL_HAS_IN_CHARGE_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 350, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn))
, (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 350, __FUNCTION__))->decl_common.lang_specific); if (!((
(enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum
tree_code) (fn)->base.code) == TEMPLATE_DECL && (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 350, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 350, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 350, __FUNCTION__); &lt->u.fn; })->has_in_charge_parm_p
)
= 1;
351}
352
353/* Classes overload their constituent function names automatically.
354 When a function name is declared in a record structure,
355 its name is changed to it overloaded name. Since names for
356 constructors and destructors can conflict, we place a leading
357 '$' for destructors.
358
359 CNAME is the name of the class we are grokking for.
360
361 FUNCTION is a FUNCTION_DECL. It was created by `grokdeclarator'.
362
363 FLAGS contains bits saying what's special about today's
364 arguments. DTOR_FLAG == DESTRUCTOR.
365
366 If FUNCTION is a destructor, then we must add the `auto-delete' field
367 as a second parameter. There is some hair associated with the fact
368 that we must "declare" this variable in the manner consistent with the
369 way the rest of the arguments were declared.
370
371 QUALS are the qualifiers for the this pointer. */
372
373void
374grokclassfn (tree ctype, tree function, enum overload_flags flags)
375{
376 tree fn_name = DECL_NAME (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 376, __FUNCTION__))->decl_minimal.name)
;
377
378 /* Even within an `extern "C"' block, members get C++ linkage. See
379 [dcl.link] for details. */
380 SET_DECL_LANGUAGE (function, lang_cplusplus)(((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 380, __FUNCTION__))->decl_common.lang_specific)->u.base
.language = (lang_cplusplus))
;
381
382 if (fn_name == NULL_TREE(tree) __null)
383 {
384 error ("name missing for member function");
385 fn_name = get_identifier ("<anonymous>")(__builtin_constant_p ("<anonymous>") ? get_identifier_with_length
(("<anonymous>"), strlen ("<anonymous>")) : get_identifier
("<anonymous>"))
;
386 DECL_NAME (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 386, __FUNCTION__))->decl_minimal.name)
= fn_name;
387 }
388
389 DECL_CONTEXT (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 389, __FUNCTION__))->decl_minimal.context)
= ctype;
390
391 if (flags == DTOR_FLAG)
392 DECL_CXX_DESTRUCTOR_P (function)((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 392, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)
= 1;
393
394 if (flags == DTOR_FLAG || DECL_CONSTRUCTOR_P (function)((tree_check (((((enum tree_code) (function)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 394, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 394, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
)
395 maybe_retrofit_in_chrg (function);
396}
397
398/* Create an ARRAY_REF, checking for the user doing things backwards
399 along the way.
400 If INDEX_EXP is non-NULL, then that is the index expression,
401 otherwise INDEX_EXP_LIST is the list of index expressions. */
402
403tree
404grok_array_decl (location_t loc, tree array_expr, tree index_exp,
405 vec<tree, va_gc> **index_exp_list, tsubst_flags_t complain)
406{
407 tree type;
408 tree expr;
409 tree orig_array_expr = array_expr;
410 tree orig_index_exp = index_exp;
411 vec<tree, va_gc> *orig_index_exp_list
412 = index_exp_list ? *index_exp_list : NULL__null;
413 tree overload = NULL_TREE(tree) __null;
414
415 if (error_operand_p (array_expr) || error_operand_p (index_exp))
416 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
417
418 if (processing_template_declscope_chain->x_processing_template_decl)
419 {
420 if (type_dependent_expression_p (array_expr)
421 || (index_exp ? type_dependent_expression_p (index_exp)
422 : any_type_dependent_arguments_p (*index_exp_list)))
423 {
424 if (index_exp == NULL__null)
425 index_exp = build_min_nt_call_vec (ovl_op_identifier (ARRAY_REF),
426 *index_exp_list);
427 return build_min_nt_loc (loc, ARRAY_REF, array_expr, index_exp,
428 NULL_TREE(tree) __null, NULL_TREE(tree) __null);
429 }
430 array_expr = build_non_dependent_expr (array_expr);
431 if (index_exp)
432 index_exp = build_non_dependent_expr (index_exp);
433 else
434 {
435 orig_index_exp_list = make_tree_vector_copy (*index_exp_list);
436 make_args_non_dependent (*index_exp_list);
437 }
438 }
439
440 type = TREE_TYPE (array_expr)((contains_struct_check ((array_expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 440, __FUNCTION__))->typed.type)
;
441 gcc_assert (type)((void)(!(type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 441, __FUNCTION__), 0 : 0))
;
442 type = non_reference (type);
443
444 /* If they have an `operator[]', use that. */
445 if (MAYBE_CLASS_TYPE_P (type)((((enum tree_code) (type)->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (type)->base.code) == TYPENAME_TYPE ||
((enum tree_code) (type)->base.code) == TYPEOF_TYPE || ((
enum tree_code) (type)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (type)->base.code) == DECLTYPE_TYPE ||
((enum tree_code) (type)->base.code) == TRAIT_TYPE || ((enum
tree_code) (type)->base.code) == DEPENDENT_OPERATOR_TYPE)
|| (((((enum tree_code) (type)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 445, __FUNCTION__))->type_common.lang_flag_5)))
446 || (index_exp && MAYBE_CLASS_TYPE_P (TREE_TYPE (index_exp))((((enum tree_code) (((contains_struct_check ((index_exp), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (((contains_struct_check ((index_exp), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code) == TYPENAME_TYPE
|| ((enum tree_code) (((contains_struct_check ((index_exp), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code) == TYPEOF_TYPE
|| ((enum tree_code) (((contains_struct_check ((index_exp), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (((contains_struct_check ((index_exp), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code) == DECLTYPE_TYPE
|| ((enum tree_code) (((contains_struct_check ((index_exp), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code) == TRAIT_TYPE
|| ((enum tree_code) (((contains_struct_check ((index_exp), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code) == DEPENDENT_OPERATOR_TYPE
) || (((((enum tree_code) (((contains_struct_check ((index_exp
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((index_exp),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((index_exp
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 446, __FUNCTION__))->type_common.lang_flag_5)))
)
447 || (index_exp == NULL_TREE(tree) __null
448 && !(*index_exp_list)->is_empty ()
449 && MAYBE_CLASS_TYPE_P (TREE_TYPE ((*index_exp_list)->last ()))((((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code) == TYPENAME_TYPE
|| ((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code) == TYPEOF_TYPE
|| ((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code) == DECLTYPE_TYPE
|| ((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code) == TRAIT_TYPE
|| ((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code) == DEPENDENT_OPERATOR_TYPE
) || (((((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check (((*index_exp_list
)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check (((
*index_exp_list)->last ()), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 449, __FUNCTION__))->type_common.lang_flag_5)))
))
450 {
451 if (index_exp)
452 expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL((1 << 0)), array_expr,
453 index_exp, NULL_TREE(tree) __null, NULL_TREE(tree) __null,
454 &overload, complain);
455 else if ((*index_exp_list)->is_empty ())
456 expr = build_op_subscript (loc, array_expr, index_exp_list, &overload,
457 complain);
458 else
459 {
460 expr = build_op_subscript (loc, array_expr, index_exp_list,
461 &overload, complain & tf_decltype);
462 if (expr == error_mark_nodeglobal_trees[TI_ERROR_MARK])
463 {
464 tree idx = build_x_compound_expr_from_vec (*index_exp_list, NULL__null,
465 tf_none);
466 if (idx != error_mark_nodeglobal_trees[TI_ERROR_MARK])
467 expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL((1 << 0)), array_expr,
468 idx, NULL_TREE(tree) __null, NULL_TREE(tree) __null, &overload,
469 complain & tf_decltype);
470 if (expr == error_mark_nodeglobal_trees[TI_ERROR_MARK])
471 {
472 overload = NULL_TREE(tree) __null;
473 expr = build_op_subscript (loc, array_expr, index_exp_list,
474 &overload, complain);
475 }
476 else
477 /* If it would be valid albeit deprecated expression in C++20,
478 just pedwarn on it and treat it as if wrapped in (). */
479 pedwarn (loc, OPT_Wcomma_subscript,
480 "top-level comma expression in array subscript "
481 "changed meaning in C++23");
482 }
483 }
484 }
485 else
486 {
487 tree p1, p2, i1, i2;
488 bool swapped = false;
489
490 /* Otherwise, create an ARRAY_REF for a pointer or array type.
491 It is a little-known fact that, if `a' is an array and `i' is
492 an int, you can write `i[a]', which means the same thing as
493 `a[i]'. */
494 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE || VECTOR_TYPE_P (type)(((enum tree_code) (type)->base.code) == VECTOR_TYPE))
495 p1 = array_expr;
496 else
497 p1 = build_expr_type_conversion (WANT_POINTER8, array_expr, false);
498
499 if (index_exp == NULL_TREE(tree) __null)
500 {
501 if ((*index_exp_list)->is_empty ())
502 {
503 error_at (loc, "built-in subscript operator without expression "
504 "list");
505 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
506 }
507 tree idx = build_x_compound_expr_from_vec (*index_exp_list, NULL__null,
508 tf_none);
509 if (idx != error_mark_nodeglobal_trees[TI_ERROR_MARK])
510 /* If it would be valid albeit deprecated expression in C++20,
511 just pedwarn on it and treat it as if wrapped in (). */
512 pedwarn (loc, OPT_Wcomma_subscript,
513 "top-level comma expression in array subscript "
514 "changed meaning in C++23");
515 else
516 {
517 error_at (loc, "built-in subscript operator with more than one "
518 "expression in expression list");
519 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
520 }
521 index_exp = idx;
522 }
523
524 if (TREE_CODE (TREE_TYPE (index_exp))((enum tree_code) (((contains_struct_check ((index_exp), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 524, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
525 p2 = index_exp;
526 else
527 p2 = build_expr_type_conversion (WANT_POINTER8, index_exp, false);
528
529 i1 = build_expr_type_conversion (WANT_INT1 | WANT_ENUM4, array_expr,
530 false);
531 i2 = build_expr_type_conversion (WANT_INT1 | WANT_ENUM4, index_exp,
532 false);
533
534 if ((p1 && i2) && (i1 && p2))
535 error ("ambiguous conversion for array subscript");
536
537 if (p1 && i2)
538 array_expr = p1, index_exp = i2;
539 else if (i1 && p2)
540 swapped = true, array_expr = p2, index_exp = i1;
541 else
542 {
543 error_at (loc, "invalid types %<%T[%T]%> for array subscript",
544 type, TREE_TYPE (index_exp)((contains_struct_check ((index_exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 544, __FUNCTION__))->typed.type)
);
545 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
546 }
547
548 if (array_expr == error_mark_nodeglobal_trees[TI_ERROR_MARK] || index_exp == error_mark_nodeglobal_trees[TI_ERROR_MARK])
549 error ("ambiguous conversion for array subscript");
550
551 if (TYPE_PTR_P (TREE_TYPE (array_expr))(((enum tree_code) (((contains_struct_check ((array_expr), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 551, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
)
)
552 array_expr = mark_rvalue_use (array_expr);
553 else
554 array_expr = mark_lvalue_use_nonread (array_expr);
555 index_exp = mark_rvalue_use (index_exp);
556 if (swapped
557 && flag_strong_eval_orderglobal_options.x_flag_strong_eval_order == 2
558 && (TREE_SIDE_EFFECTS (array_expr)((non_type_check ((array_expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 558, __FUNCTION__))->base.side_effects_flag)
|| TREE_SIDE_EFFECTS (index_exp)((non_type_check ((index_exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 558, __FUNCTION__))->base.side_effects_flag)
))
559 expr = build_array_ref (input_location, index_exp, array_expr);
560 else
561 expr = build_array_ref (input_location, array_expr, index_exp);
562 }
563 if (processing_template_declscope_chain->x_processing_template_decl && expr != error_mark_nodeglobal_trees[TI_ERROR_MARK])
564 {
565 if (overload != NULL_TREE(tree) __null)
566 {
567 if (orig_index_exp == NULL_TREE(tree) __null)
568 {
569 expr = build_min_non_dep_op_overload (expr, overload,
570 orig_array_expr,
571 orig_index_exp_list);
572 release_tree_vector (orig_index_exp_list);
573 return expr;
574 }
575 return build_min_non_dep_op_overload (ARRAY_REF, expr, overload,
576 orig_array_expr,
577 orig_index_exp);
578 }
579
580 if (orig_index_exp == NULL_TREE(tree) __null)
581 {
582 orig_index_exp
583 = build_min_nt_call_vec (ovl_op_identifier (ARRAY_REF),
584 orig_index_exp_list);
585 release_tree_vector (orig_index_exp_list);
586 }
587
588 return build_min_non_dep (ARRAY_REF, expr, orig_array_expr,
589 orig_index_exp, NULL_TREE(tree) __null, NULL_TREE(tree) __null);
590 }
591 return expr;
592}
593
594/* Given the cast expression EXP, checking out its validity. Either return
595 an error_mark_node if there was an unavoidable error, return a cast to
596 void for trying to delete a pointer w/ the value 0, or return the
597 call to delete. If DOING_VEC is true, we handle things differently
598 for doing an array delete.
599 Implements ARM $5.3.4. This is called from the parser. */
600
601tree
602delete_sanity (location_t loc, tree exp, tree size, bool doing_vec,
603 int use_global_delete, tsubst_flags_t complain)
604{
605 tree t, type;
606
607 if (exp == error_mark_nodeglobal_trees[TI_ERROR_MARK])
608 return exp;
609
610 if (processing_template_declscope_chain->x_processing_template_decl)
611 {
612 t = build_min (DELETE_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], exp, size);
613 DELETE_EXPR_USE_GLOBAL (t)((tree_not_check2 (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 613, __FUNCTION__, (DELETE_EXPR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 613, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= use_global_delete;
614 DELETE_EXPR_USE_VEC (t)((tree_not_check2 (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 614, __FUNCTION__, (DELETE_EXPR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 614, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
= doing_vec;
615 TREE_SIDE_EFFECTS (t)((non_type_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 615, __FUNCTION__))->base.side_effects_flag)
= 1;
616 SET_EXPR_LOCATION (t, loc)(expr_check (((t)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 616, __FUNCTION__))->exp.locus = (loc)
;
617 return t;
618 }
619
620 location_t exp_loc = cp_expr_loc_or_loc (exp, loc);
621
622 /* An array can't have been allocated by new, so complain. */
623 if (TREE_CODE (TREE_TYPE (exp))((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 623, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE
624 && (complain & tf_warning))
625 warning_at (exp_loc, 0, "deleting array %q#E", exp);
626
627 t = build_expr_type_conversion (WANT_POINTER8, exp, true);
628
629 if (t == NULL_TREE(tree) __null || t == error_mark_nodeglobal_trees[TI_ERROR_MARK])
630 {
631 if (complain & tf_error)
632 error_at (exp_loc,
633 "type %q#T argument given to %<delete%>, expected pointer",
634 TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 634, __FUNCTION__))->typed.type)
);
635 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
636 }
637
638 type = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 638, __FUNCTION__))->typed.type)
;
639
640 /* As of Valley Forge, you can delete a pointer to const. */
641
642 /* You can't delete functions. */
643 if (TREE_CODE (TREE_TYPE (type))((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 643, __FUNCTION__))->typed.type))->base.code)
== FUNCTION_TYPE)
644 {
645 if (complain & tf_error)
646 error_at (exp_loc,
647 "cannot delete a function. Only pointer-to-objects are "
648 "valid arguments to %<delete%>");
649 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
650 }
651
652 /* Deleting ptr to void is undefined behavior [expr.delete/3]. */
653 if (VOID_TYPE_P (TREE_TYPE (type))(((enum tree_code) (((contains_struct_check ((type), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 653, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
654 {
655 if (complain & tf_warning)
656 warning_at (exp_loc, OPT_Wdelete_incomplete,
657 "deleting %qT is undefined", type);
658 doing_vec = 0;
659 }
660
661 /* Deleting a pointer with the value zero is valid and has no effect. */
662 if (integer_zerop (t))
663 return build1_loc (loc, NOP_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], t);
664
665 if (doing_vec)
666 return build_vec_delete (loc, t, /*maxindex=*/NULL_TREE(tree) __null,
667 sfk_deleting_destructor,
668 use_global_delete, complain);
669 else
670 return build_delete (loc, type, t, sfk_deleting_destructor,
671 LOOKUP_NORMAL((1 << 0)), use_global_delete,
672 complain);
673}
674
675/* Report an error if the indicated template declaration is not the
676 sort of thing that should be a member template. */
677
678void
679check_member_template (tree tmpl)
680{
681 tree decl;
682
683 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL)((void)(!(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 683, __FUNCTION__), 0 : 0))
;
684 decl = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 684, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
685
686 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
687 || DECL_ALIAS_TEMPLATE_P (tmpl)((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 687, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 687, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == TYPE_DECL) && !((contains_struct_check ((((
struct tree_template_decl *)(const_cast<union tree_node *>
((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 687, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 687, __FUNCTION__))->decl_common.artificial_flag))
688 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
689 && MAYBE_CLASS_TYPE_P (TREE_TYPE (decl))((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code) == TYPENAME_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code) == TYPEOF_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code) == DECLTYPE_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code) == TRAIT_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code) == DEPENDENT_OPERATOR_TYPE
) || (((((enum tree_code) (((contains_struct_check ((decl), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((decl
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 689, __FUNCTION__))->type_common.lang_flag_5)))
))
690 {
691 /* The parser rejects template declarations in local classes
692 (with the exception of generic lambdas). */
693 gcc_assert (!current_function_decl || LAMBDA_FUNCTION_P (decl))((void)(!(!current_function_decl || ((((enum tree_code) (decl
)->base.code) == FUNCTION_DECL || (((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && (((tree_not_check2 (((tree_check
((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) && ((__extension__ ({ struct lang_decl
*lt = ((contains_struct_check (((((enum tree_code) (decl)->
base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_common.lang_specific); if (!((
(enum tree_code) (decl)->base.code) == FUNCTION_DECL || ((
(enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__); &lt->u.fn; })->ovl_op_code) ==
OVL_OP_CALL_EXPR) && (((enum tree_code) ((!(! (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == RECORD_TYPE && ((((
tree_class_check ((((tree_class_check (((!(! (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check (((!(! (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check (((!(! (((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 693, __FUNCTION__), 0 : 0))
;
694 /* The parser rejects any use of virtual in a function template. */
695 gcc_assert (!(TREE_CODE (decl) == FUNCTION_DECL((void)(!(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL
&& ((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 696, __FUNCTION__))->decl_common.virtual_flag))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 696, __FUNCTION__), 0 : 0))
696 && DECL_VIRTUAL_P (decl)))((void)(!(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL
&& ((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 696, __FUNCTION__))->decl_common.virtual_flag))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 696, __FUNCTION__), 0 : 0))
;
697
698 /* The debug-information generating code doesn't know what to do
699 with member templates. */
700 DECL_IGNORED_P (tmpl)((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 700, __FUNCTION__))->decl_common.ignored_flag)
= 1;
701 }
702 else if (variable_template_p (tmpl))
703 /* OK */;
704 else
705 error ("template declaration of %q#D", decl);
706}
707
708/* Sanity check: report error if this function FUNCTION is not
709 really a member of the class (CTYPE) it is supposed to belong to.
710 TEMPLATE_PARMS is used to specify the template parameters of a member
711 template passed as FUNCTION_DECL. If the member template is passed as a
712 TEMPLATE_DECL, it can be NULL since the parameters can be extracted
713 from the declaration. If the function is not a function template, it
714 must be NULL.
715 It returns the original declaration for the function, NULL_TREE if
716 no declaration was found, error_mark_node if an error was emitted. */
717
718tree
719check_classfn (tree ctype, tree function, tree template_parms)
720{
721 if (DECL_USE_TEMPLATE (function)(((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 721, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
722 && !(TREE_CODE (function)((enum tree_code) (function)->base.code) == TEMPLATE_DECL
723 && DECL_TEMPLATE_SPECIALIZATION (function)((((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 723, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
724 && DECL_MEMBER_TEMPLATE_P (DECL_TI_TEMPLATE (function))(((contains_struct_check (((tree_check ((((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 724, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 724, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 724, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 724, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 724, __FUNCTION__))->decl_common.lang_flag_1))
)
725 /* Since this is a specialization of a member template,
726 we're not going to find the declaration in the class.
727 For example, in:
728
729 struct S { template <typename T> void f(T); };
730 template <> void S::f(int);
731
732 we're not going to find `S::f(int)', but there's no
733 reason we should, either. We let our callers know we didn't
734 find the method, but we don't complain. */
735 return NULL_TREE(tree) __null;
736
737 /* Basic sanity check: for a template function, the template parameters
738 either were not passed, or they are the same of DECL_TEMPLATE_PARMS. */
739 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == TEMPLATE_DECL)
740 {
741 if (template_parms
742 && !comp_template_parms (template_parms,
743 DECL_TEMPLATE_PARMS (function)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 743, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
))
744 {
745 error ("template parameter lists provided don%'t match the "
746 "template parameters of %qD", function);
747 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
748 }
749 template_parms = DECL_TEMPLATE_PARMS (function)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 749, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
;
750 }
751
752 /* OK, is this a definition of a member template? */
753 bool is_template = (template_parms != NULL_TREE(tree) __null);
754
755 /* [temp.mem]
756
757 A destructor shall not be a member template. */
758 if (DECL_DESTRUCTOR_P (function)((tree_check (((((enum tree_code) (function)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 758, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 758, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)
&& is_template)
759 {
760 error ("destructor %qD declared as member template", function);
761 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
762 }
763
764 /* We must enter the scope here, because conversion operators are
765 named by target type, and type equivalence relies on typenames
766 resolving within the scope of CTYPE. */
767 tree pushed_scope = push_scope (ctype);
768 tree matched = NULL_TREE(tree) __null;
769 tree fns = get_class_binding (ctype, DECL_NAME (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 769, __FUNCTION__))->decl_minimal.name)
);
770 bool saw_template = false;
771
772 for (ovl_iterator iter (fns); !matched && iter; ++iter)
773 {
774 tree fndecl = *iter;
775
776 if (TREE_CODE (fndecl)((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL)
777 saw_template = true;
778
779 /* A member template definition only matches a member template
780 declaration. */
781 if (is_template != (TREE_CODE (fndecl)((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL))
782 continue;
783
784 if (!DECL_DECLARES_FUNCTION_P (fndecl)(((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL ||
(((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 784, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fndecl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 784, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL))
)
785 continue;
786
787 tree p1 = TYPE_ARG_TYPES (TREE_TYPE (function))((tree_check2 ((((contains_struct_check ((function), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 787, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 787, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
788 tree p2 = TYPE_ARG_TYPES (TREE_TYPE (fndecl))((tree_check2 ((((contains_struct_check ((fndecl), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 788, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 788, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
789
790 /* We cannot simply call decls_match because this doesn't work
791 for static member functions that are pretending to be
792 methods, and because the name may have been changed by
793 asm("new_name"). */
794
795 /* Get rid of the this parameter on functions that become
796 static. */
797 if (DECL_STATIC_FUNCTION_P (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 797, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 797, __FUNCTION__))->decl_common.lang_specific); if (!((
(enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 797, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fndecl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 797, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 797, __FUNCTION__); &lt->u.fn; })->static_function
)
798 && TREE_CODE (TREE_TYPE (function))((enum tree_code) (((contains_struct_check ((function), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 798, __FUNCTION__))->typed.type))->base.code)
== METHOD_TYPE)
799 p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 799, __FUNCTION__))->common.chain)
;
800
801 /* ref-qualifier or absence of same must match. */
802 if (type_memfn_rqual (TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 802, __FUNCTION__))->typed.type)
)
803 != type_memfn_rqual (TREE_TYPE (fndecl)((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 803, __FUNCTION__))->typed.type)
))
804 continue;
805
806 // Include constraints in the match.
807 tree c1 = get_constraints (function);
808 tree c2 = get_constraints (fndecl);
809
810 /* While finding a match, same types and params are not enough
811 if the function is versioned. Also check version ("target")
812 attributes. */
813 if (same_type_p (TREE_TYPE (TREE_TYPE (function)),comptypes ((((contains_struct_check ((((contains_struct_check
((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 813, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 813, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 814, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 814, __FUNCTION__))->typed.type)), 0)
814 TREE_TYPE (TREE_TYPE (fndecl)))comptypes ((((contains_struct_check ((((contains_struct_check
((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 813, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 813, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 814, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 814, __FUNCTION__))->typed.type)), 0)
815 && compparms (p1, p2)
816 && !targetm.target_option.function_versions (function, fndecl)
817 && (!is_template
818 || comp_template_parms (template_parms,
819 DECL_TEMPLATE_PARMS (fndecl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 819, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
))
820 && equivalent_constraints (c1, c2)
821 && (DECL_TEMPLATE_SPECIALIZATION (function)((((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 821, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
822 == DECL_TEMPLATE_SPECIALIZATION (fndecl)((((contains_struct_check ((fndecl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 822, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
823 && (!DECL_TEMPLATE_SPECIALIZATION (function)((((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 823, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
824 || (DECL_TI_TEMPLATE (function)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 824, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 824, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 824, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
== DECL_TI_TEMPLATE (fndecl)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 824, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 824, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 824, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
)))
825 matched = fndecl;
826 }
827
828 if (!matched && !is_template && saw_template
829 && !processing_template_declscope_chain->x_processing_template_decl && DECL_UNIQUE_FRIEND_P (function)(((contains_struct_check (((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 829, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 829, __FUNCTION__))->decl_common.lang_specific) ->u.base
.friend_or_tls)
)
830 {
831 /* "[if no non-template match is found,] each remaining function template
832 is replaced with the specialization chosen by deduction from the
833 friend declaration or discarded if deduction fails."
834
835 So tell check_explicit_specialization to look for a match. */
836 SET_DECL_IMPLICIT_INSTANTIATION (function)((((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 836, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 1)
;
837 matched = function;
838 }
839
840 if (!matched)
841 {
842 if (!COMPLETE_TYPE_P (ctype)(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 842, __FUNCTION__))->type_common.size) != (tree) __null)
)
843 cxx_incomplete_type_error (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 843, __FUNCTION__))->decl_minimal.locus)
,
844 function, ctype);
845 else
846 {
847 if (DECL_CONV_FN_P (function)((((tree_not_check2 (((tree_check ((((contains_struct_check (
(function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 847, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
848 fns = get_class_binding (ctype, conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER]);
849
850 error_at (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 850, __FUNCTION__))->decl_minimal.locus)
,
851 "no declaration matches %q#D", function);
852 if (fns)
853 print_candidates (fns);
854 else if (DECL_CONV_FN_P (function)((((tree_not_check2 (((tree_check ((((contains_struct_check (
(function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 854, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
855 inform (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 855, __FUNCTION__))->decl_minimal.locus)
,
856 "no conversion operators declared");
857 else
858 inform (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 858, __FUNCTION__))->decl_minimal.locus)
,
859 "no functions named %qD", function);
860 inform (DECL_SOURCE_LOCATION (TYPE_NAME (ctype))((contains_struct_check ((((tree_class_check ((ctype), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 860, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 860, __FUNCTION__))->decl_minimal.locus)
,
861 "%#qT defined here", ctype);
862 }
863 matched = error_mark_nodeglobal_trees[TI_ERROR_MARK];
864 }
865
866 if (pushed_scope)
867 pop_scope (pushed_scope);
868
869 return matched;
870}
871
872/* DECL is a function with vague linkage. Remember it so that at the
873 end of the translation unit we can decide whether or not to emit
874 it. */
875
876void
877note_vague_linkage_fn (tree decl)
878{
879 if (processing_template_declscope_chain->x_processing_template_decl)
880 return;
881
882 DECL_DEFER_OUTPUT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 882, __FUNCTION__))->decl_with_vis.defer_output)
= 1;
883 vec_safe_push (deferred_fns, decl);
884}
885
886/* As above, but for variable template instantiations. */
887
888void
889note_variable_template_instantiation (tree decl)
890{
891 vec_safe_push (pending_statics, decl);
892}
893
894/* We have just processed the DECL, which is a static data member.
895 The other parameters are as for cp_finish_decl. */
896
897void
898finish_static_data_member_decl (tree decl,
899 tree init, bool init_const_expr_p,
900 tree asmspec_tree,
901 int flags)
902{
903 if (DECL_TEMPLATE_INSTANTIATED (decl)((contains_struct_check (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 903, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 903, __FUNCTION__))->decl_common.lang_flag_1)
)
904 /* We already needed to instantiate this, so the processing in this
905 function is unnecessary/wrong. */
906 return;
907
908 DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 908, __FUNCTION__))->decl_minimal.context)
= current_class_typescope_chain->class_type;
909
910 /* We cannot call pushdecl here, because that would fill in the
911 TREE_CHAIN of our decl. Instead, we modify cp_finish_decl to do
912 the right thing, namely, to put this decl out straight away. */
913
914 if (! processing_template_declscope_chain->x_processing_template_decl)
915 vec_safe_push (pending_statics, decl);
916
917 if (LOCAL_CLASS_P (current_class_type)(decl_function_context (((((contains_struct_check (((tree_class_check
((((tree_class_check ((scope_chain->class_type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 917, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 917, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 917, __FUNCTION__))->common.chain)))) != (tree) __null)
918 /* We already complained about the template definition. */
919 && !DECL_TEMPLATE_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 919, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) & 1)
)
920 permerror (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 920, __FUNCTION__))->decl_minimal.locus)
,
921 "local class %q#T shall not have static data member %q#D",
922 current_class_typescope_chain->class_type, decl);
923 else
924 for (tree t = current_class_typescope_chain->class_type; TYPE_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (t)->base.code))] == tcc_type)
;
925 t = CP_TYPE_CONTEXT (t)(!(! (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 925, __FUNCTION__))->type_common.context)) || ((enum tree_code
) (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 925, __FUNCTION__))->type_common.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((t), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 925, __FUNCTION__))->type_common.context) : cp_global_trees
[CPTI_GLOBAL])
)
926 if (TYPE_UNNAMED_P (t)((((((tree_class_check ((((tree_class_check ((t), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check ((t), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag
)) && !((tree_check ((((((tree_class_check ((((tree_class_check
((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 926, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))
)
927 {
928 auto_diagnostic_group d;
929 if (permerror (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 929, __FUNCTION__))->decl_minimal.locus)
,
930 "static data member %qD in unnamed class", decl))
931 inform (DECL_SOURCE_LOCATION (TYPE_NAME (t))((contains_struct_check ((((tree_class_check ((t), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 931, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 931, __FUNCTION__))->decl_minimal.locus)
,
932 "unnamed class defined here");
933 break;
934 }
935
936 if (DECL_INLINE_VAR_P (decl)((((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__))->decl_common.lang_specific)->u.base
.var_declared_inline_p : false) || (cxx_dialect >= cxx17 &&
((contains_struct_check (((tree_check2 (((((enum tree_code) (
decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__))->decl_common.lang_flag_8) &&
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__))->decl_minimal.context) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))))
&& !DECL_TEMPLATE_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 936, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) & 1)
)
937 /* An inline variable is immediately defined, so don't set DECL_IN_AGGR_P.
938 Except that if decl is a template instantiation, it isn't defined until
939 instantiate_decl. */;
940 else
941 DECL_IN_AGGR_P (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 941, __FUNCTION__))->decl_common.lang_flag_3))
= 1;
942
943 if (TREE_CODE (TREE_TYPE (decl))((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 943, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE
944 && TYPE_DOMAIN (TREE_TYPE (decl))((tree_check ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 944, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 944, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
== NULL_TREE(tree) __null)
945 SET_VAR_HAD_UNKNOWN_BOUND (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 945, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 945, __FUNCTION__))->decl_common.lang_specific)->u.base
.unknown_bound_p = true)
;
946
947 if (init)
948 {
949 /* Similarly to start_decl_1, we want to complete the type in order
950 to do the right thing in cp_apply_type_quals_to_decl, possibly
951 clear TYPE_QUAL_CONST (c++/65579). */
952 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 952, __FUNCTION__))->typed.type)
= complete_type (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 952, __FUNCTION__))->typed.type)
);
953 cp_apply_type_quals_to_decl (cp_type_quals (type), decl);
954 }
955
956 cp_finish_decl (decl, init, init_const_expr_p, asmspec_tree, flags);
957}
958
959/* DECLARATOR and DECLSPECS correspond to a class member. The other
960 parameters are as for cp_finish_decl. Return the DECL for the
961 class member declared. */
962
963tree
964grokfield (const cp_declarator *declarator,
965 cp_decl_specifier_seq *declspecs,
966 tree init, bool init_const_expr_p,
967 tree asmspec_tree,
968 tree attrlist)
969{
970 tree value;
971 const char *asmspec = 0;
972 int flags;
973
974 if (init
975 && TREE_CODE (init)((enum tree_code) (init)->base.code) == TREE_LIST
976 && TREE_VALUE (init)((tree_check ((init), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 976, __FUNCTION__, (TREE_LIST)))->list.value)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
977 && TREE_CHAIN (init)((contains_struct_check ((init), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 977, __FUNCTION__))->common.chain)
== NULL_TREE(tree) __null)
978 init = NULL_TREE(tree) __null;
979
980 int initialized;
981 if (init == ridpointers[(int)RID_DELETE])
982 initialized = SD_DELETED4;
983 else if (init == ridpointers[(int)RID_DEFAULT])
984 initialized = SD_DEFAULTED3;
985 else if (init)
986 initialized = SD_INITIALIZED1;
987 else
988 initialized = SD_UNINITIALIZED0;
989
990 value = grokdeclarator (declarator, declspecs, FIELD, initialized, &attrlist);
991 if (! value || value == error_mark_nodeglobal_trees[TI_ERROR_MARK])
992 /* friend or constructor went bad. */
993 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
994 if (TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 994, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
995 return value;
996
997 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL && init)
998 {
999 error_at (cp_expr_loc_or_loc (init, DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 999, __FUNCTION__))->decl_minimal.locus)
),
1000 "typedef %qD is initialized (use %qs instead)",
1001 value, "decltype");
1002 init = NULL_TREE(tree) __null;
1003 }
1004
1005 /* Pass friendly classes back. */
1006 if (value == void_type_nodeglobal_trees[TI_VOID_TYPE])
1007 return value;
1008
1009 if (DECL_NAME (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1009, __FUNCTION__))->decl_minimal.name)
1010 && TREE_CODE (DECL_NAME (value))((enum tree_code) (((contains_struct_check ((value), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1010, __FUNCTION__))->decl_minimal.name))->base.code)
== TEMPLATE_ID_EXPR)
1011 {
1012 error_at (declarator->id_loc,
1013 "explicit template argument list not allowed");
1014 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1015 }
1016
1017 /* Stash away type declarations. */
1018 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL)
1019 {
1020 DECL_NONLOCAL (value)((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1020, __FUNCTION__))->decl_common.nonlocal_flag)
= 1;
1021 DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1021, __FUNCTION__))->decl_minimal.context)
= current_class_typescope_chain->class_type;
1022
1023 if (attrlist)
1024 {
1025 int attrflags = 0;
1026
1027 /* If this is a typedef that names the class for linkage purposes
1028 (7.1.3p8), apply any attributes directly to the type. */
1029 if (OVERLOAD_TYPE_P (TREE_TYPE (value))((((((enum tree_code) (((contains_struct_check ((value), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1029, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((value), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1029, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((value
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1029, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1029, __FUNCTION__))->type_common.lang_flag_5)) || ((enum
tree_code) (((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1029, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
)
1030 && value == TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value)))((tree_class_check ((((tree_class_check ((((contains_struct_check
((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1030, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1030, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1030, __FUNCTION__))->type_common.name)
)
1031 attrflags = ATTR_FLAG_TYPE_IN_PLACE;
1032
1033 cplus_decl_attributes (&value, attrlist, attrflags);
1034 }
1035
1036 if (decl_spec_seq_has_spec_p (declspecs, ds_typedef)
1037 && TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1037, __FUNCTION__))->typed.type)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK]
1038 && TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value)))((tree_class_check ((((tree_class_check ((((contains_struct_check
((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1038, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1038, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1038, __FUNCTION__))->type_common.name)
!= value)
1039 set_underlying_type (value);
1040
1041 /* It's important that push_template_decl below follows
1042 set_underlying_type above so that the created template
1043 carries the properly set type of VALUE. */
1044 if (processing_template_declscope_chain->x_processing_template_decl)
1045 value = push_template_decl (value);
1046
1047 record_locally_defined_typedef (value);
1048 return value;
1049 }
1050
1051 int friendp = decl_spec_seq_has_spec_p (declspecs, ds_friend);
1052
1053 if (!friendp && DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1053, __FUNCTION__))->decl_common.lang_flag_3))
)
1054 {
1055 error ("%qD is already defined in %qT", value, DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1055, __FUNCTION__))->decl_minimal.context)
);
1056 return void_type_nodeglobal_trees[TI_VOID_TYPE];
1057 }
1058
1059 if (asmspec_tree && asmspec_tree != error_mark_nodeglobal_trees[TI_ERROR_MARK])
1060 asmspec = TREE_STRING_POINTER (asmspec_tree)((const char *)((tree_check ((asmspec_tree), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1060, __FUNCTION__, (STRING_CST)))->string.str))
;
1061
1062 if (init)
1063 {
1064 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == FUNCTION_DECL)
1065 {
1066 if (init == ridpointers[(int)RID_DELETE])
1067 {
1068 DECL_DELETED_FN (value)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (value)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1068, __FUNCTION__, (TEMPLATE_DECL))))))))->result : value
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1068, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (value)->base.code) == FUNCTION_DECL || (
((enum tree_code) (value)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1068, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((value
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1068, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1068, __FUNCTION__); &lt->u.fn; })->min.base.threadprivate_or_deleted_p
)
= 1;
1069 DECL_DECLARED_INLINE_P (value)((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1069, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
= 1;
1070 }
1071 else if (init == ridpointers[(int)RID_DEFAULT])
1072 {
1073 if (defaultable_fn_check (value))
1074 {
1075 DECL_DEFAULTED_FN (value)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (value)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1075, __FUNCTION__, (TEMPLATE_DECL))))))))->result : value
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1075, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (value)->base.code) == FUNCTION_DECL || (
((enum tree_code) (value)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1075, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((value
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1075, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1075, __FUNCTION__); &lt->u.fn; })->defaulted_p)
= 1;
1076 DECL_INITIALIZED_IN_CLASS_P (value)(((contains_struct_check (((tree_check2 ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1076, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1076, __FUNCTION__))->decl_common.lang_specific) ->u.
base.initialized_in_class)
= 1;
1077 DECL_DECLARED_INLINE_P (value)((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1077, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
= 1;
1078 /* grokfndecl set this to error_mark_node, but we want to
1079 leave it unset until synthesize_method. */
1080 DECL_INITIAL (value)((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1080, __FUNCTION__))->decl_common.initial)
= NULL_TREE(tree) __null;
1081 }
1082 }
1083 else if (TREE_CODE (init)((enum tree_code) (init)->base.code) == DEFERRED_PARSE)
1084 error ("invalid initializer for member function %qD", value);
1085 else if (TREE_CODE (TREE_TYPE (value))((enum tree_code) (((contains_struct_check ((value), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1085, __FUNCTION__))->typed.type))->base.code)
== METHOD_TYPE)
1086 {
1087 if (integer_zerop (init))
1088 DECL_PURE_VIRTUAL_P (value)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (value)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1088, __FUNCTION__, (TEMPLATE_DECL))))))))->result : value
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1088, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (value)->base.code) == FUNCTION_DECL || (
((enum tree_code) (value)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1088, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((value
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1088, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1088, __FUNCTION__); &lt->u.fn; })->pure_virtual)
= 1;
1089 else if (error_operand_p (init))
1090 ; /* An error has already been reported. */
1091 else
1092 error ("invalid initializer for member function %qD",
1093 value);
1094 }
1095 else
1096 {
1097 gcc_assert (TREE_CODE (TREE_TYPE (value)) == FUNCTION_TYPE)((void)(!(((enum tree_code) (((contains_struct_check ((value)
, (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1097, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1097, __FUNCTION__), 0 : 0))
;
1098 location_t iloc
1099 = cp_expr_loc_or_loc (init, DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1099, __FUNCTION__))->decl_minimal.locus)
);
1100 if (friendp)
1101 error_at (iloc, "initializer specified for friend "
1102 "function %qD", value);
1103 else
1104 error_at (iloc, "initializer specified for static "
1105 "member function %qD", value);
1106 }
1107 }
1108 else if (TREE_CODE (value)((enum tree_code) (value)->base.code) == FIELD_DECL)
1109 /* C++11 NSDMI, keep going. */;
1110 else if (!VAR_P (value)(((enum tree_code) (value)->base.code) == VAR_DECL))
1111 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1111, __FUNCTION__))
;
1112 }
1113
1114 /* Pass friend decls back. */
1115 if ((TREE_CODE (value)((enum tree_code) (value)->base.code) == FUNCTION_DECL
1116 || TREE_CODE (value)((enum tree_code) (value)->base.code) == TEMPLATE_DECL)
1117 && DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1117, __FUNCTION__))->decl_minimal.context)
!= current_class_typescope_chain->class_type)
1118 {
1119 if (attrlist)
1120 cplus_decl_attributes (&value, attrlist, 0);
1121 return value;
1122 }
1123
1124 /* Need to set this before push_template_decl. */
1125 if (VAR_P (value)(((enum tree_code) (value)->base.code) == VAR_DECL))
1126 DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1126, __FUNCTION__))->decl_minimal.context)
= current_class_typescope_chain->class_type;
1127
1128 if (processing_template_declscope_chain->x_processing_template_decl && VAR_OR_FUNCTION_DECL_P (value)(((enum tree_code) (value)->base.code) == VAR_DECL || ((enum
tree_code) (value)->base.code) == FUNCTION_DECL)
)
1129 {
1130 value = push_template_decl (value);
1131 if (error_operand_p (value))
1132 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1133 }
1134
1135 if (attrlist)
1136 cplus_decl_attributes (&value, attrlist, 0);
1137
1138 if (init && DIRECT_LIST_INIT_P (init)((((enum tree_code) (init)->base.code) == CONSTRUCTOR &&
((contains_struct_check ((init), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1138, __FUNCTION__))->typed.type) == cp_global_trees[CPTI_INIT_LIST_TYPE
]) && (((tree_not_check2 (((tree_check ((init), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1138, __FUNCTION__, (CONSTRUCTOR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1138, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1139 flags = LOOKUP_NORMAL((1 << 0));
1140 else
1141 flags = LOOKUP_IMPLICIT(((1 << 0)) | (1 << 2));
1142
1143 switch (TREE_CODE (value)((enum tree_code) (value)->base.code))
1144 {
1145 case VAR_DECL:
1146 finish_static_data_member_decl (value, init, init_const_expr_p,
1147 asmspec_tree, flags);
1148 return value;
1149
1150 case FIELD_DECL:
1151 if (asmspec)
1152 error ("%<asm%> specifiers are not permitted on non-static data members");
1153 if (DECL_INITIAL (value)((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1153, __FUNCTION__))->decl_common.initial)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
1154 init = error_mark_nodeglobal_trees[TI_ERROR_MARK];
1155 cp_finish_decl (value, init, /*init_const_expr_p=*/false,
1156 NULL_TREE(tree) __null, flags);
1157 DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1157, __FUNCTION__))->decl_common.lang_flag_3))
= 1;
1158 return value;
1159
1160 case FUNCTION_DECL:
1161 if (asmspec)
1162 set_user_assembler_name (value, asmspec);
1163
1164 cp_finish_decl (value,
1165 /*init=*/NULL_TREE(tree) __null,
1166 /*init_const_expr_p=*/false,
1167 asmspec_tree, flags);
1168
1169 /* Pass friends back this way. */
1170 if (DECL_UNIQUE_FRIEND_P (value)(((contains_struct_check (((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1170, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1170, __FUNCTION__))->decl_common.lang_specific) ->u.
base.friend_or_tls)
)
1171 return void_type_nodeglobal_trees[TI_VOID_TYPE];
1172
1173 DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1173, __FUNCTION__))->decl_common.lang_flag_3))
= 1;
1174 return value;
1175
1176 default:
1177 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1177, __FUNCTION__))
;
1178 }
1179 return NULL_TREE(tree) __null;
1180}
1181
1182/* Like `grokfield', but for bitfields.
1183 WIDTH is the width of the bitfield, a constant expression.
1184 The other parameters are as for grokfield. */
1185
1186tree
1187grokbitfield (const cp_declarator *declarator,
1188 cp_decl_specifier_seq *declspecs, tree width, tree init,
1189 tree attrlist)
1190{
1191 tree value = grokdeclarator (declarator, declspecs, BITFIELD,
1192 init != NULL_TREE(tree) __null, &attrlist);
1193
1194 if (value == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1195 return NULL_TREE(tree) __null; /* friends went bad. */
1196
1197 tree type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1197, __FUNCTION__))->typed.type)
;
1198 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1199 return value;
1200
1201 /* Pass friendly classes back. */
1202 if (VOID_TYPE_P (value)(((enum tree_code) (value)->base.code) == VOID_TYPE))
1203 return void_type_nodeglobal_trees[TI_VOID_TYPE];
1204
1205 if (!INTEGRAL_OR_ENUMERATION_TYPE_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (
((enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((
enum tree_code) (type)->base.code) == INTEGER_TYPE))
1206 && (INDIRECT_TYPE_P (type)((((enum tree_code) (type)->base.code) == POINTER_TYPE) ||
(((enum tree_code) (type)->base.code) == REFERENCE_TYPE))
|| !dependent_type_p (type)))
1207 {
1208 error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1208, __FUNCTION__))->decl_minimal.locus)
,
1209 "bit-field %qD with non-integral type %qT",
1210 value, type);
1211 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1212 }
1213
1214 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == TYPE_DECL)
1215 {
1216 error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1216, __FUNCTION__))->decl_minimal.locus)
,
1217 "cannot declare %qD to be a bit-field type", value);
1218 return NULL_TREE(tree) __null;
1219 }
1220
1221 /* Usually, finish_struct_1 catches bitfields with invalid types.
1222 But, in the case of bitfields with function type, we confuse
1223 ourselves into thinking they are member functions, so we must
1224 check here. */
1225 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == FUNCTION_DECL)
1226 {
1227 error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1227, __FUNCTION__))->decl_minimal.locus)
,
1228 "cannot declare bit-field %qD with function type", value);
1229 return NULL_TREE(tree) __null;
1230 }
1231
1232 if (TYPE_WARN_IF_NOT_ALIGN (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1232, __FUNCTION__))->type_common.warn_if_not_align ? ((
unsigned)1) << ((type)->type_common.warn_if_not_align
- 1) : 0)
)
1233 {
1234 error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1234, __FUNCTION__))->decl_minimal.locus)
, "cannot declare bit-field "
1235 "%qD with %<warn_if_not_aligned%> type", value);
1236 return NULL_TREE(tree) __null;
1237 }
1238
1239 if (DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1239, __FUNCTION__))->decl_common.lang_flag_3))
)
1240 {
1241 error ("%qD is already defined in the class %qT", value,
1242 DECL_CONTEXT (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1242, __FUNCTION__))->decl_minimal.context)
);
1243 return void_type_nodeglobal_trees[TI_VOID_TYPE];
1244 }
1245
1246 if (TREE_STATIC (value)((value)->base.static_flag))
1247 {
1248 error_at (DECL_SOURCE_LOCATION (value)((contains_struct_check ((value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1248, __FUNCTION__))->decl_minimal.locus)
,
1249 "static member %qD cannot be a bit-field", value);
1250 return NULL_TREE(tree) __null;
1251 }
1252
1253 int flags = LOOKUP_IMPLICIT(((1 << 0)) | (1 << 2));
1254 if (init && DIRECT_LIST_INIT_P (init)((((enum tree_code) (init)->base.code) == CONSTRUCTOR &&
((contains_struct_check ((init), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1254, __FUNCTION__))->typed.type) == cp_global_trees[CPTI_INIT_LIST_TYPE
]) && (((tree_not_check2 (((tree_check ((init), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1254, __FUNCTION__, (CONSTRUCTOR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1254, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
1255 flags = LOOKUP_NORMAL((1 << 0));
1256 cp_finish_decl (value, init, false, NULL_TREE(tree) __null, flags);
1257
1258 if (width != error_mark_nodeglobal_trees[TI_ERROR_MARK])
1259 {
1260 /* The width must be an integer type. */
1261 if (!type_dependent_expression_p (width)
1262 && !INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (width))((((enum tree_code) (((contains_struct_check ((width), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1262, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
&& !((tree_check ((((contains_struct_check ((width),
(TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1262, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1262, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
) || (((enum tree_code) (((contains_struct_check ((width), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1262, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((width), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1262, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
))
)
1263 error ("width of bit-field %qD has non-integral type %qT", value,
1264 TREE_TYPE (width)((contains_struct_check ((width), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1264, __FUNCTION__))->typed.type)
);
1265 else if (!check_for_bare_parameter_packs (width))
1266 {
1267 /* Temporarily stash the width in DECL_BIT_FIELD_REPRESENTATIVE.
1268 check_bitfield_decl picks it from there later and sets DECL_SIZE
1269 accordingly. */
1270 DECL_BIT_FIELD_REPRESENTATIVE (value)((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1270, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier
)
= width;
1271 SET_DECL_C_BIT_FIELD (value)(((contains_struct_check (((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1271, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1271, __FUNCTION__))->decl_common.lang_flag_4) = 1)
;
1272 }
1273 }
1274
1275 DECL_IN_AGGR_P (value)(((contains_struct_check ((value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1275, __FUNCTION__))->decl_common.lang_flag_3))
= 1;
1276
1277 if (attrlist)
1278 cplus_decl_attributes (&value, attrlist, /*flags=*/0);
1279
1280 return value;
1281}
1282
1283
1284/* Returns true iff ATTR is an attribute which needs to be applied at
1285 instantiation time rather than template definition time. */
1286
1287static bool
1288is_late_template_attribute (tree attr, tree decl)
1289{
1290 tree name = get_attribute_name (attr);
1291 tree args = TREE_VALUE (attr)((tree_check ((attr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1291, __FUNCTION__, (TREE_LIST)))->list.value)
;
1292 const struct attribute_spec *spec = lookup_attribute_spec (name);
1293 tree arg;
1294
1295 if (!spec)
1296 /* Unknown attribute. */
1297 return false;
1298
1299 /* Attribute weak handling wants to write out assembly right away. */
1300 if (is_attribute_p ("weak", name))
1301 return true;
1302
1303 /* Attributes used and unused are applied directly to typedefs for the
1304 benefit of maybe_warn_unused_local_typedefs. */
1305 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
1306 && (is_attribute_p ("unused", name)
1307 || is_attribute_p ("used", name)))
1308 return false;
1309
1310 /* Attribute tls_model wants to modify the symtab. */
1311 if (is_attribute_p ("tls_model", name))
1312 return true;
1313
1314 /* #pragma omp declare simd attribute needs to be always deferred. */
1315 if (flag_openmpglobal_options.x_flag_openmp
1316 && is_attribute_p ("omp declare simd", name))
1317 return true;
1318
1319 if (args == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1320 return false;
1321
1322 /* An attribute pack is clearly dependent. */
1323 if (args && PACK_EXPANSION_P (args)(((enum tree_code) (args)->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (args)->base.code) == EXPR_PACK_EXPANSION
)
)
1324 return true;
1325
1326 /* If any of the arguments are dependent expressions, we can't evaluate
1327 the attribute until instantiation time. */
1328 for (arg = args; arg; arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1328, __FUNCTION__))->common.chain)
)
1329 {
1330 tree t = TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1330, __FUNCTION__, (TREE_LIST)))->list.value)
;
1331
1332 /* If the first attribute argument is an identifier, only consider
1333 second and following arguments. Attributes like mode, format,
1334 cleanup and several target specific attributes aren't late
1335 just because they have an IDENTIFIER_NODE as first argument. */
1336 if (arg == args && attribute_takes_identifier_p (name)
1337 && identifier_p (t))
1338 continue;
1339
1340 if (value_dependent_expression_p (t))
1341 return true;
1342 }
1343
1344 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
1345 || TYPE_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_type)
1346 || spec->type_required)
1347 {
1348 tree type = TYPE_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_type)
? decl : TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1348, __FUNCTION__))->typed.type)
;
1349
1350 if (!type)
1351 return true;
1352
1353 /* We can't apply any attributes to a completely unknown type until
1354 instantiation time. */
1355 enum tree_code code = TREE_CODE (type)((enum tree_code) (type)->base.code);
1356 if (code == TEMPLATE_TYPE_PARM
1357 || code == BOUND_TEMPLATE_TEMPLATE_PARM
1358 || code == TYPENAME_TYPE)
1359 return true;
1360 /* Also defer most attributes on dependent types. This is not
1361 necessary in all cases, but is the better default. */
1362 else if (dependent_type_p (type)
1363 /* But some attributes specifically apply to templates. */
1364 && !is_attribute_p ("abi_tag", name)
1365 && !is_attribute_p ("deprecated", name)
1366 && !is_attribute_p ("unavailable", name)
1367 && !is_attribute_p ("visibility", name))
1368 return true;
1369 else
1370 return false;
1371 }
1372 else
1373 return false;
1374}
1375
1376/* ATTR_P is a list of attributes. Remove any attributes which need to be
1377 applied at instantiation time and return them. If IS_DEPENDENT is true,
1378 the declaration itself is dependent, so all attributes should be applied
1379 at instantiation time. */
1380
1381tree
1382splice_template_attributes (tree *attr_p, tree decl)
1383{
1384 tree *p = attr_p;
1385 tree late_attrs = NULL_TREE(tree) __null;
1386 tree *q = &late_attrs;
1387
1388 if (!p || *p == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1389 return NULL_TREE(tree) __null;
1390
1391 for (; *p; )
1392 {
1393 if (is_late_template_attribute (*p, decl))
1394 {
1395 ATTR_IS_DEPENDENT (*p)((tree_not_check2 (((tree_check ((*p), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1395, __FUNCTION__, (TREE_LIST)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1395, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= 1;
1396 *q = *p;
1397 *p = TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1397, __FUNCTION__))->common.chain)
;
1398 q = &TREE_CHAIN (*q)((contains_struct_check ((*q), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1398, __FUNCTION__))->common.chain)
;
1399 *q = NULL_TREE(tree) __null;
1400 }
1401 else
1402 p = &TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1402, __FUNCTION__))->common.chain)
;
1403 }
1404
1405 return late_attrs;
1406}
1407
1408/* Attach any LATE_ATTRS to DECL_P, after the non-dependent attributes have
1409 been applied by a previous call to decl_attributes. */
1410
1411static void
1412save_template_attributes (tree late_attrs, tree *decl_p, int flags)
1413{
1414 tree *q;
1415
1416 if (!late_attrs)
1417 return;
1418
1419 if (DECL_P (*decl_p)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (*decl_p)->base.code))] == tcc_declaration)
)
1420 q = &DECL_ATTRIBUTES (*decl_p)((contains_struct_check ((*decl_p), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1420, __FUNCTION__))->decl_common.attributes)
;
1421 else
1422 q = &TYPE_ATTRIBUTES (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1422, __FUNCTION__))->type_common.attributes)
;
1423
1424 tree old_attrs = *q;
1425
1426 /* Place the late attributes at the beginning of the attribute
1427 list. */
1428 late_attrs = chainon (late_attrs, *q);
1429 if (*q != late_attrs
1430 && !DECL_P (*decl_p)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (*decl_p)->base.code))] == tcc_declaration)
1431 && !(flags & ATTR_FLAG_TYPE_IN_PLACE))
1432 {
1433 if (!dependent_type_p (*decl_p))
1434 *decl_p = cp_build_type_attribute_variant (*decl_p, late_attrs);
1435 else
1436 {
1437 *decl_p = build_variant_type_copy (*decl_p);
1438 TYPE_ATTRIBUTES (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1438, __FUNCTION__))->type_common.attributes)
= late_attrs;
1439 }
1440 }
1441 else
1442 *q = late_attrs;
1443
1444 if (!DECL_P (*decl_p)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (*decl_p)->base.code))] == tcc_declaration)
&& *decl_p == TYPE_MAIN_VARIANT (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1444, __FUNCTION__))->type_common.main_variant)
)
1445 {
1446 /* We've added new attributes directly to the main variant, so
1447 now we need to update all of the other variants to include
1448 these new attributes. */
1449 tree variant;
1450 for (variant = TYPE_NEXT_VARIANT (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1450, __FUNCTION__))->type_common.next_variant)
; variant;
1451 variant = TYPE_NEXT_VARIANT (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1451, __FUNCTION__))->type_common.next_variant)
)
1452 {
1453 gcc_assert (TYPE_ATTRIBUTES (variant) == old_attrs)((void)(!(((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1453, __FUNCTION__))->type_common.attributes) == old_attrs
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1453, __FUNCTION__), 0 : 0))
;
1454 TYPE_ATTRIBUTES (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1454, __FUNCTION__))->type_common.attributes)
= TYPE_ATTRIBUTES (*decl_p)((tree_class_check ((*decl_p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1454, __FUNCTION__))->type_common.attributes)
;
1455 }
1456 }
1457}
1458
1459/* True if ATTRS contains any dependent attributes that affect type
1460 identity. */
1461
1462bool
1463any_dependent_type_attributes_p (tree attrs)
1464{
1465 for (tree a = attrs; a; a = TREE_CHAIN (a)((contains_struct_check ((a), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1465, __FUNCTION__))->common.chain)
)
1466 if (ATTR_IS_DEPENDENT (a)((tree_not_check2 (((tree_check ((a), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1466, __FUNCTION__, (TREE_LIST)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1466, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
1467 {
1468 const attribute_spec *as = lookup_attribute_spec (TREE_PURPOSE (a)((tree_check ((a), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1468, __FUNCTION__, (TREE_LIST)))->list.purpose)
);
1469 if (as && as->affects_type_identity)
1470 return true;
1471 }
1472 return false;
1473}
1474
1475/* Return true iff ATTRS are acceptable attributes to be applied in-place
1476 to a typedef which gives a previously unnamed class or enum a name for
1477 linkage purposes. */
1478
1479bool
1480attributes_naming_typedef_ok (tree attrs)
1481{
1482 for (; attrs; attrs = TREE_CHAIN (attrs)((contains_struct_check ((attrs), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1482, __FUNCTION__))->common.chain)
)
1483 {
1484 tree name = get_attribute_name (attrs);
1485 if (is_attribute_p ("vector_size", name))
1486 return false;
1487 }
1488 return true;
1489}
1490
1491/* Like reconstruct_complex_type, but handle also template trees. */
1492
1493tree
1494cp_reconstruct_complex_type (tree type, tree bottom)
1495{
1496 tree inner, outer;
1497
1498 if (TYPE_PTR_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE))
1499 {
1500 inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1500, __FUNCTION__))->typed.type)
, bottom);
1501 outer = build_pointer_type_for_mode (inner, TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1501, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
,
1502 TYPE_REF_CAN_ALIAS_ALL (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1502, __FUNCTION__, (POINTER_TYPE), (REFERENCE_TYPE)))->
base.static_flag)
);
1503 }
1504 else if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE))
1505 {
1506 inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1506, __FUNCTION__))->typed.type)
, bottom);
1507 outer = build_reference_type_for_mode (inner, TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1507, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
,
1508 TYPE_REF_CAN_ALIAS_ALL (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1508, __FUNCTION__, (POINTER_TYPE), (REFERENCE_TYPE)))->
base.static_flag)
);
1509 }
1510 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE)
1511 {
1512 inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1512, __FUNCTION__))->typed.type)
, bottom);
1513 outer = build_cplus_array_type (inner, TYPE_DOMAIN (type)((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1513, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
);
1514 /* Don't call cp_build_qualified_type on ARRAY_TYPEs, the
1515 element type qualification will be handled by the recursive
1516 cp_reconstruct_complex_type call and cp_build_qualified_type
1517 for ARRAY_TYPEs changes the element type. */
1518 return outer;
1519 }
1520 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == FUNCTION_TYPE)
1521 {
1522 inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1522, __FUNCTION__))->typed.type)
, bottom);
1523 outer = build_function_type (inner, TYPE_ARG_TYPES (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1523, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
);
1524 outer = apply_memfn_quals (outer, type_memfn_quals (type));
1525 }
1526 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == METHOD_TYPE)
1527 {
1528 inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1528, __FUNCTION__))->typed.type)
, bottom);
1529 /* The build_method_type_directly() routine prepends 'this' to argument list,
1530 so we must compensate by getting rid of it. */
1531 outer
1532 = build_method_type_directly
1533 (class_of_this_parm (type), inner,
1534 TREE_CHAIN (TYPE_ARG_TYPES (type))((contains_struct_check ((((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1534, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1534, __FUNCTION__))->common.chain)
);
1535 }
1536 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == OFFSET_TYPE)
1537 {
1538 inner = cp_reconstruct_complex_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1538, __FUNCTION__))->typed.type)
, bottom);
1539 outer = build_offset_type (TYPE_OFFSET_BASETYPE (type)((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1539, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
)
, inner);
1540 }
1541 else
1542 return bottom;
1543
1544 if (TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1544, __FUNCTION__))->type_common.attributes)
)
1545 outer = cp_build_type_attribute_variant (outer, TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1545, __FUNCTION__))->type_common.attributes)
);
1546 outer = cp_build_qualified_type (outer, cp_type_quals (type));
1547 outer = cxx_copy_lang_qualifiers (outer, type);
1548
1549 return outer;
1550}
1551
1552/* Replaces any constexpr expression that may be into the attributes
1553 arguments with their reduced value. */
1554
1555void
1556cp_check_const_attributes (tree attributes)
1557{
1558 if (attributes == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1559 return;
1560
1561 tree attr;
1562 for (attr = attributes; attr; attr = TREE_CHAIN (attr)((contains_struct_check ((attr), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1562, __FUNCTION__))->common.chain)
)
1563 {
1564 if (cxx_contract_attribute_p (attr))
1565 continue;
1566
1567 tree arg;
1568 /* As we implement alignas using gnu::aligned attribute and
1569 alignas argument is a constant expression, force manifestly
1570 constant evaluation of aligned attribute argument. */
1571 bool manifestly_const_eval
1572 = is_attribute_p ("aligned", get_attribute_name (attr));
1573 for (arg = TREE_VALUE (attr)((tree_check ((attr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1573, __FUNCTION__, (TREE_LIST)))->list.value)
; arg && TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TREE_LIST;
1574 arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1574, __FUNCTION__))->common.chain)
)
1575 {
1576 tree expr = TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1576, __FUNCTION__, (TREE_LIST)))->list.value)
;
1577 if (EXPR_P (expr)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (expr)->base.code))]) >= tcc_reference &&
(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (expr)->base.code))]) <= tcc_expression)
)
1578 TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1578, __FUNCTION__, (TREE_LIST)))->list.value)
1579 = fold_non_dependent_expr (expr, tf_warning_or_error,
1580 manifestly_const_eval);
1581 }
1582 }
1583}
1584
1585/* Return the last pushed declaration for the symbol DECL or NULL
1586 when no such declaration exists. */
1587
1588static tree
1589find_last_decl (tree decl)
1590{
1591 tree last_decl = NULL_TREE(tree) __null;
1592
1593 if (tree name = DECL_P (decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (decl)->base.code))] == tcc_declaration)
? DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1593, __FUNCTION__))->decl_minimal.name)
: NULL_TREE(tree) __null)
1594 {
1595 /* Look up the declaration in its scope. */
1596 tree pushed_scope = NULL_TREE(tree) __null;
1597 if (tree ctype = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1597, __FUNCTION__))->decl_minimal.context)
)
1598 pushed_scope = push_scope (ctype);
1599
1600 last_decl = lookup_name (name);
1601
1602 if (pushed_scope)
1603 pop_scope (pushed_scope);
1604
1605 /* The declaration may be a member conversion operator
1606 or a bunch of overfloads (handle the latter below). */
1607 if (last_decl && BASELINK_P (last_decl)(((enum tree_code) (last_decl)->base.code) == BASELINK))
1608 last_decl = BASELINK_FUNCTIONS (last_decl)(((struct tree_baselink*) (tree_check ((last_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1608, __FUNCTION__, (BASELINK))))->functions)
;
1609 }
1610
1611 if (!last_decl)
1612 return NULL_TREE(tree) __null;
1613
1614 if (DECL_P (last_decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (last_decl)->base.code))] == tcc_declaration)
|| TREE_CODE (last_decl)((enum tree_code) (last_decl)->base.code) == OVERLOAD)
1615 {
1616 /* A set of overloads of the same function. */
1617 for (lkp_iterator iter (last_decl); iter; ++iter)
1618 {
1619 if (TREE_CODE (*iter)((enum tree_code) (*iter)->base.code) == OVERLOAD)
1620 continue;
1621
1622 tree d = *iter;
1623
1624 /* We can't compare versions in the middle of processing the
1625 attribute that has the version. */
1626 if (TREE_CODE (d)((enum tree_code) (d)->base.code) == FUNCTION_DECL
1627 && DECL_FUNCTION_VERSIONED (d)((tree_check ((d), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1627, __FUNCTION__, (FUNCTION_DECL)))->function_decl.versioned_function
)
)
1628 return NULL_TREE(tree) __null;
1629
1630 if (decls_match (decl, d, /*record_decls=*/false))
1631 return d;
1632 }
1633 return NULL_TREE(tree) __null;
1634 }
1635
1636 return NULL_TREE(tree) __null;
1637}
1638
1639/* Like decl_attributes, but handle C++ complexity. */
1640
1641void
1642cplus_decl_attributes (tree *decl, tree attributes, int flags)
1643{
1644 if (*decl == NULL_TREE(tree) __null || *decl == void_type_nodeglobal_trees[TI_VOID_TYPE]
1645 || *decl == error_mark_nodeglobal_trees[TI_ERROR_MARK] || attributes == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1646 return;
1647
1648 /* Add implicit "omp declare target" attribute if requested. */
1649 if (vec_safe_length (scope_chain->omp_declare_target_attribute)
1650 && ((VAR_P (*decl)(((enum tree_code) (*decl)->base.code) == VAR_DECL)
1651 && (TREE_STATIC (*decl)((*decl)->base.static_flag) || DECL_EXTERNAL (*decl)((contains_struct_check ((*decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1651, __FUNCTION__))->decl_common.decl_flag_1)
))
1652 || TREE_CODE (*decl)((enum tree_code) (*decl)->base.code) == FUNCTION_DECL))
1653 {
1654 if (VAR_P (*decl)(((enum tree_code) (*decl)->base.code) == VAR_DECL)
1655 && DECL_CLASS_SCOPE_P (*decl)(((contains_struct_check ((*decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1655, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((*decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1655, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
1656 error ("%q+D static data member inside of declare target directive",
1657 *decl);
1658 else
1659 {
1660 if (VAR_P (*decl)(((enum tree_code) (*decl)->base.code) == VAR_DECL)
1661 && (processing_template_declscope_chain->x_processing_template_decl
1662 || !omp_mappable_type (TREE_TYPE (*decl)((contains_struct_check ((*decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1662, __FUNCTION__))->typed.type)
)))
1663 attributes
1664 = tree_cons (get_identifier ("omp declare target implicit")(__builtin_constant_p ("omp declare target implicit") ? get_identifier_with_length
(("omp declare target implicit"), strlen ("omp declare target implicit"
)) : get_identifier ("omp declare target implicit"))
,
1665 NULL_TREE(tree) __null, attributes);
1666 else
1667 {
1668 attributes = tree_cons (get_identifier ("omp declare target")(__builtin_constant_p ("omp declare target") ? get_identifier_with_length
(("omp declare target"), strlen ("omp declare target")) : get_identifier
("omp declare target"))
,
1669 NULL_TREE(tree) __null, attributes);
1670 attributes
1671 = tree_cons (get_identifier ("omp declare target block")(__builtin_constant_p ("omp declare target block") ? get_identifier_with_length
(("omp declare target block"), strlen ("omp declare target block"
)) : get_identifier ("omp declare target block"))
,
1672 NULL_TREE(tree) __null, attributes);
1673 }
1674 if (TREE_CODE (*decl)((enum tree_code) (*decl)->base.code) == FUNCTION_DECL)
1675 {
1676 cp_omp_declare_target_attr &last
1677 = scope_chain->omp_declare_target_attribute->last ();
1678 int device_type = MAX (last.device_type, 0)((last.device_type) > (0) ? (last.device_type) : (0));
1679 if ((device_type & OMP_CLAUSE_DEVICE_TYPE_HOST) != 0
1680 && !lookup_attribute ("omp declare target host",
1681 attributes))
1682 attributes
1683 = tree_cons (get_identifier ("omp declare target host")(__builtin_constant_p ("omp declare target host") ? get_identifier_with_length
(("omp declare target host"), strlen ("omp declare target host"
)) : get_identifier ("omp declare target host"))
,
1684 NULL_TREE(tree) __null, attributes);
1685 if ((device_type & OMP_CLAUSE_DEVICE_TYPE_NOHOST) != 0
1686 && !lookup_attribute ("omp declare target nohost",
1687 attributes))
1688 attributes
1689 = tree_cons (get_identifier ("omp declare target nohost")(__builtin_constant_p ("omp declare target nohost") ? get_identifier_with_length
(("omp declare target nohost"), strlen ("omp declare target nohost"
)) : get_identifier ("omp declare target nohost"))
,
1690 NULL_TREE(tree) __null, attributes);
1691 }
1692 }
1693 }
1694
1695 tree late_attrs = NULL_TREE(tree) __null;
1696 if (processing_template_declscope_chain->x_processing_template_decl)
1697 {
1698 if (check_for_bare_parameter_packs (attributes))
1699 return;
1700 late_attrs = splice_template_attributes (&attributes, *decl);
1701 }
1702
1703 cp_check_const_attributes (attributes);
1704
1705 if (flag_openmpglobal_options.x_flag_openmp || flag_openmp_simdglobal_options.x_flag_openmp_simd)
1706 {
1707 bool diagnosed = false;
1708 for (tree *pa = &attributes; *pa; )
1709 {
1710 if (get_attribute_namespace (*pa) == omp_identifiercp_global_trees[CPTI_OMP_IDENTIFIER])
1711 {
1712 tree name = get_attribute_name (*pa);
1713 if (is_attribute_p ("directive", name)
1714 || is_attribute_p ("sequence", name))
1715 {
1716 if (!diagnosed)
1717 {
1718 error ("%<omp::%E%> not allowed to be specified in this "
1719 "context", name);
1720 diagnosed = true;
1721 }
1722 *pa = TREE_CHAIN (*pa)((contains_struct_check ((*pa), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1722, __FUNCTION__))->common.chain)
;
1723 continue;
1724 }
1725 }
1726 pa = &TREE_CHAIN (*pa)((contains_struct_check ((*pa), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1726, __FUNCTION__))->common.chain)
;
1727 }
1728 }
1729
1730 if (TREE_CODE (*decl)((enum tree_code) (*decl)->base.code) == TEMPLATE_DECL)
1731 decl = &DECL_TEMPLATE_RESULT (*decl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((*decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1731, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
1732
1733 if (TREE_TYPE (*decl)((contains_struct_check ((*decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1733, __FUNCTION__))->typed.type)
&& TYPE_PTRMEMFUNC_P (TREE_TYPE (*decl))(((enum tree_code) (((contains_struct_check ((*decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1733, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
&& (((tree_class_check (((tree_check ((((contains_struct_check
((*decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1733, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1733, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1733, __FUNCTION__))->type_common.lang_flag_2)))
)
1734 {
1735 attributes
1736 = decl_attributes (decl, attributes, flags | ATTR_FLAG_FUNCTION_NEXT);
1737 decl_attributes (&TYPE_PTRMEMFUNC_FN_TYPE_RAW (TREE_TYPE (*decl))(((contains_struct_check ((((tree_check3 ((((contains_struct_check
((*decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1737, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1737, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1737, __FUNCTION__))->typed.type))
,
1738 attributes, flags);
1739 }
1740 else
1741 {
1742 tree last_decl = find_last_decl (*decl);
1743 decl_attributes (decl, attributes, flags, last_decl);
1744 }
1745
1746 if (late_attrs)
1747 save_template_attributes (late_attrs, decl, flags);
1748
1749 /* Propagate deprecation out to the template. */
1750 if (TREE_DEPRECATED (*decl)((*decl)->base.deprecated_flag))
1751 if (tree ti = get_template_info (*decl))
1752 {
1753 tree tmpl = TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1753, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
1754 tree pattern = (TYPE_P (*decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (*decl)->base.code))] == tcc_type)
? TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1754, __FUNCTION__))->typed.type)
1755 : DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1755, __FUNCTION__, (TEMPLATE_DECL))))))))->result
);
1756 if (*decl == pattern)
1757 TREE_DEPRECATED (tmpl)((tmpl)->base.deprecated_flag) = true;
1758 }
1759
1760 /* Likewise, propagate unavailability out to the template. */
1761 if (TREE_UNAVAILABLE (*decl)((*decl)->base.u.bits.unavailable_flag))
1762 if (tree ti = get_template_info (*decl))
1763 {
1764 tree tmpl = TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1764, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
1765 tree pattern = (TYPE_P (*decl)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (*decl)->base.code))] == tcc_type)
? TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1765, __FUNCTION__))->typed.type)
1766 : DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1766, __FUNCTION__, (TEMPLATE_DECL))))))))->result
);
1767 if (*decl == pattern)
1768 TREE_UNAVAILABLE (tmpl)((tmpl)->base.u.bits.unavailable_flag) = true;
1769 }
1770}
1771
1772/* Walks through the namespace- or function-scope anonymous union
1773 OBJECT, with the indicated TYPE, building appropriate VAR_DECLs.
1774 Returns one of the fields for use in the mangled name. */
1775
1776static tree
1777build_anon_union_vars (tree type, tree object)
1778{
1779 tree main_decl = NULL_TREE(tree) __null;
1780 tree field;
1781
1782 /* Rather than write the code to handle the non-union case,
1783 just give an error. */
1784 if (TREE_CODE (type)((enum tree_code) (type)->base.code) != UNION_TYPE)
1785 {
1786 error_at (DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type))((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1786, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1786, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1786, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1786, __FUNCTION__))->decl_minimal.locus)
,
1787 "anonymous struct not inside named type");
1788 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1789 }
1790
1791 for (field = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1791, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
;
1792 field != NULL_TREE(tree) __null;
1793 field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1793, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1793, __FUNCTION__))->common.chain))
)
1794 {
1795 tree decl;
1796 tree ref;
1797
1798 if (DECL_ARTIFICIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1798, __FUNCTION__))->decl_common.artificial_flag)
)
1799 continue;
1800 if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL)
1801 {
1802 permerror (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1802, __FUNCTION__))->decl_minimal.locus)
,
1803 "%q#D invalid; an anonymous union can only "
1804 "have non-static data members", field);
1805 continue;
1806 }
1807
1808 if (TREE_PRIVATE (field)((field)->base.private_flag))
1809 permerror (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1809, __FUNCTION__))->decl_minimal.locus)
,
1810 "private member %q#D in anonymous union", field);
1811 else if (TREE_PROTECTED (field)((field)->base.protected_flag))
1812 permerror (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1812, __FUNCTION__))->decl_minimal.locus)
,
1813 "protected member %q#D in anonymous union", field);
1814
1815 if (processing_template_declscope_chain->x_processing_template_decl)
1816 ref = build_min_nt_loc (UNKNOWN_LOCATION((location_t) 0), COMPONENT_REF, object,
1817 DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1817, __FUNCTION__))->decl_minimal.name)
, NULL_TREE(tree) __null);
1818 else
1819 ref = build_class_member_access_expr (object, field, NULL_TREE(tree) __null,
1820 false, tf_warning_or_error);
1821
1822 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1822, __FUNCTION__))->decl_minimal.name)
)
1823 {
1824 tree base;
1825
1826 decl = build_decl (input_location,
1827 VAR_DECL, DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1827, __FUNCTION__))->decl_minimal.name)
, TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1827, __FUNCTION__))->typed.type)
);
1828 DECL_ANON_UNION_VAR_P (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1828, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1828, __FUNCTION__))->decl_common.lang_flag_4))
= 1;
1829 DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1829, __FUNCTION__))->decl_common.artificial_flag)
= 1;
1830
1831 base = get_base_address (object);
1832 TREE_PUBLIC (decl)((decl)->base.public_flag) = TREE_PUBLIC (base)((base)->base.public_flag);
1833 TREE_STATIC (decl)((decl)->base.static_flag) = TREE_STATIC (base)((base)->base.static_flag);
1834 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1834, __FUNCTION__))->decl_common.decl_flag_1)
= DECL_EXTERNAL (base)((contains_struct_check ((base), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1834, __FUNCTION__))->decl_common.decl_flag_1)
;
1835
1836 SET_DECL_VALUE_EXPR (decl, ref)(decl_value_expr_insert ((contains_struct_check ((decl), (TS_DECL_WRTL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1836, __FUNCTION__)), ref))
;
1837 DECL_HAS_VALUE_EXPR_P (decl)((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1837, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
= 1;
1838
1839 decl = pushdecl (decl);
1840 }
1841 else if (ANON_AGGR_TYPE_P (TREE_TYPE (field))((((((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1841, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1841, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((field
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1841, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1841, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((field), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1841, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1841, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
1842 decl = build_anon_union_vars (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1842, __FUNCTION__))->typed.type)
, ref);
1843 else
1844 decl = 0;
1845
1846 if (main_decl == NULL_TREE(tree) __null)
1847 main_decl = decl;
1848 }
1849
1850 return main_decl;
1851}
1852
1853/* Finish off the processing of a UNION_TYPE structure. If the union is an
1854 anonymous union, then all members must be laid out together. PUBLIC_P
1855 is nonzero if this union is not declared static. */
1856
1857void
1858finish_anon_union (tree anon_union_decl)
1859{
1860 tree type;
1861 tree main_decl;
1862 bool public_p;
1863
1864 if (anon_union_decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1865 return;
1866
1867 type = TREE_TYPE (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1867, __FUNCTION__))->typed.type)
;
1868 public_p = TREE_PUBLIC (anon_union_decl)((anon_union_decl)->base.public_flag);
1869
1870 /* The VAR_DECL's context is the same as the TYPE's context. */
1871 DECL_CONTEXT (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1871, __FUNCTION__))->decl_minimal.context)
= DECL_CONTEXT (TYPE_NAME (type))((contains_struct_check ((((tree_class_check ((type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1871, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1871, __FUNCTION__))->decl_minimal.context)
;
1872
1873 if (TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1873, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
== NULL_TREE(tree) __null)
1874 return;
1875
1876 if (public_p)
1877 {
1878 error ("namespace-scope anonymous aggregates must be static");
1879 return;
1880 }
1881
1882 main_decl = build_anon_union_vars (type, anon_union_decl);
1883 if (main_decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1884 return;
1885 if (main_decl == NULL_TREE(tree) __null)
1886 {
1887 pedwarn (input_location, 0, "anonymous union with no members");
1888 return;
1889 }
1890
1891 if (!processing_template_declscope_chain->x_processing_template_decl)
1892 {
1893 /* Use main_decl to set the mangled name. */
1894 DECL_NAME (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1894, __FUNCTION__))->decl_minimal.name)
= DECL_NAME (main_decl)((contains_struct_check ((main_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1894, __FUNCTION__))->decl_minimal.name)
;
1895 maybe_commonize_var (anon_union_decl);
1896 if (TREE_STATIC (anon_union_decl)((anon_union_decl)->base.static_flag) || DECL_EXTERNAL (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_COMMON),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1896, __FUNCTION__))->decl_common.decl_flag_1)
)
1897 {
1898 if (DECL_DISCRIMINATOR_P (anon_union_decl)(((((enum tree_code) (anon_union_decl)->base.code) == VAR_DECL
&& ((anon_union_decl)->base.static_flag)) || (((enum
tree_code) (anon_union_decl)->base.code) == TYPE_DECL &&
((contains_struct_check ((anon_union_decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1898, __FUNCTION__))->decl_common.lang_flag_2))) &&
(((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1898, __FUNCTION__))->decl_minimal.context) && (
(enum tree_code) (((contains_struct_check ((anon_union_decl),
(TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1898, __FUNCTION__))->decl_minimal.context))->base.code
) == FUNCTION_DECL))
)
1899 determine_local_discriminator (anon_union_decl);
1900 mangle_decl (anon_union_decl);
1901 }
1902 DECL_NAME (anon_union_decl)((contains_struct_check ((anon_union_decl), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1902, __FUNCTION__))->decl_minimal.name)
= NULL_TREE(tree) __null;
1903 }
1904
1905 pushdecl (anon_union_decl);
1906 cp_finish_decl (anon_union_decl, NULL_TREE(tree) __null, false, NULL_TREE(tree) __null, 0);
1907}
1908
1909/* Auxiliary functions to make type signatures for
1910 `operator new' and `operator delete' correspond to
1911 what compiler will be expecting. */
1912
1913tree
1914coerce_new_type (tree type, location_t loc)
1915{
1916 int e = 0;
1917 tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1917, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1918
1919 gcc_assert (TREE_CODE (type) == FUNCTION_TYPE)((void)(!(((enum tree_code) (type)->base.code) == FUNCTION_TYPE
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1919, __FUNCTION__), 0 : 0))
;
1920
1921 if (!same_type_p (TREE_TYPE (type), ptr_type_node)comptypes ((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1921, __FUNCTION__))->typed.type)), (global_trees[TI_PTR_TYPE
]), 0)
)
1922 {
1923 e = 1;
1924 error_at (loc, "%<operator new%> must return type %qT",
1925 ptr_type_nodeglobal_trees[TI_PTR_TYPE]);
1926 }
1927
1928 if (args && args != void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
1929 {
1930 if (TREE_PURPOSE (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1930, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
1931 {
1932 /* [basic.stc.dynamic.allocation]
1933
1934 The first parameter shall not have an associated default
1935 argument. */
1936 error_at (loc, "the first parameter of %<operator new%> cannot "
1937 "have a default argument");
1938 /* Throw away the default argument. */
1939 TREE_PURPOSE (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1939, __FUNCTION__, (TREE_LIST)))->list.purpose)
= NULL_TREE(tree) __null;
1940 }
1941
1942 if (!same_type_p (TREE_VALUE (args), size_type_node)comptypes ((((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1942, __FUNCTION__, (TREE_LIST)))->list.value)), (global_trees
[TI_SIZE_TYPE]), 0)
)
1943 {
1944 e = 2;
1945 args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1945, __FUNCTION__))->common.chain)
;
1946 }
1947 }
1948 else
1949 e = 2;
1950
1951 if (e == 2)
1952 permerror (loc, "%<operator new%> takes type %<size_t%> (%qT) "
1953 "as first parameter", size_type_nodeglobal_trees[TI_SIZE_TYPE]);
1954
1955 switch (e)
1956 {
1957 case 2:
1958 args = tree_cons (NULL_TREE(tree) __null, size_type_nodeglobal_trees[TI_SIZE_TYPE], args);
1959 /* Fall through. */
1960 case 1:
1961 type = (cxx_copy_lang_qualifiers
1962 (build_function_type (ptr_type_nodeglobal_trees[TI_PTR_TYPE], args),
1963 type));
1964 /* Fall through. */
1965 default:;
1966 }
1967 return type;
1968}
1969
1970void
1971coerce_delete_type (tree decl, location_t loc)
1972{
1973 int e = 0;
1974 tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1974, __FUNCTION__))->typed.type)
;
1975 tree args = TYPE_ARG_TYPES (type)((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1975, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1976
1977 gcc_assert (TREE_CODE (type) == FUNCTION_TYPE)((void)(!(((enum tree_code) (type)->base.code) == FUNCTION_TYPE
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1977, __FUNCTION__), 0 : 0))
;
1978
1979 if (!same_type_p (TREE_TYPE (type), void_type_node)comptypes ((((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1979, __FUNCTION__))->typed.type)), (global_trees[TI_VOID_TYPE
]), 0)
)
1980 {
1981 e = 1;
1982 error_at (loc, "%<operator delete%> must return type %qT",
1983 void_type_nodeglobal_trees[TI_VOID_TYPE]);
1984 }
1985
1986 tree ptrtype = ptr_type_nodeglobal_trees[TI_PTR_TYPE];
1987 if (destroying_delete_p (decl))
1988 {
1989 if (DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1989, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1989, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
1990 /* If the function is a destroying operator delete declared in class
1991 type C, the type of its first parameter shall be C*. */
1992 ptrtype = build_pointer_type (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1992, __FUNCTION__))->decl_minimal.context)
);
1993 else
1994 /* A destroying operator delete shall be a class member function named
1995 operator delete. */
1996 error_at (loc,
1997 "destroying %<operator delete%> must be a member function");
1998 const ovl_op_info_t *op = IDENTIFIER_OVL_OP_INFO (DECL_NAME (decl))(&ovl_op_info[((tree_not_check2 (((tree_check ((((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1998, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1998, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1998, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)][((tree_check ((((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1998, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 1998, __FUNCTION__, (IDENTIFIER_NODE)))->base.u.bits.address_space
)])
;
1999 if (op->flags & OVL_OP_FLAG_VEC)
2000 error_at (loc, "%<operator delete[]%> cannot be a destroying delete");
2001 if (!usual_deallocation_fn_p (decl))
2002 error_at (loc, "destroying %<operator delete%> must be a usual "
2003 "deallocation function");
2004 }
2005
2006 if (!args || args == void_list_nodeglobal_trees[TI_VOID_LIST_NODE]
2007 || !same_type_p (TREE_VALUE (args), ptrtype)comptypes ((((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2007, __FUNCTION__, (TREE_LIST)))->list.value)), (ptrtype
), 0)
)
2008 {
2009 e = 2;
2010 if (args && args != void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
2011 args = TREE_CHAIN (args)((contains_struct_check ((args), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2011, __FUNCTION__))->common.chain)
;
2012 error_at (loc, "%<operator delete%> takes type %qT as first parameter",
2013 ptrtype);
2014 }
2015 switch (e)
2016 {
2017 case 2:
2018 args = tree_cons (NULL_TREE(tree) __null, ptrtype, args);
2019 /* Fall through. */
2020 case 1:
2021 type = (cxx_copy_lang_qualifiers
2022 (build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE], args),
2023 type));
2024 /* Fall through. */
2025 default:;
2026 }
2027
2028 TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2028, __FUNCTION__))->typed.type)
= type;
2029}
2030
2031/* DECL is a VAR_DECL for a vtable: walk through the entries in the vtable
2032 and mark them as needed. */
2033
2034static void
2035mark_vtable_entries (tree decl, vec<tree> &consteval_vtables)
2036{
2037 /* It's OK for the vtable to refer to deprecated virtual functions. */
2038 warning_sentinel w(warn_deprecated_declglobal_options.x_warn_deprecated_decl);
2039
2040 bool consteval_seen = false;
2041
2042 for (auto &e: CONSTRUCTOR_ELTS (DECL_INITIAL (decl))((tree_check ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2042, __FUNCTION__))->decl_common.initial)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2042, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
)
2043 {
2044 tree fnaddr = e.value;
2045
2046 STRIP_NOPS (fnaddr)(fnaddr) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((fnaddr)))))
;
2047
2048 if (TREE_CODE (fnaddr)((enum tree_code) (fnaddr)->base.code) != ADDR_EXPR
2049 && TREE_CODE (fnaddr)((enum tree_code) (fnaddr)->base.code) != FDESC_EXPR)
2050 /* This entry is an offset: a virtual base class offset, a
2051 virtual call offset, an RTTI offset, etc. */
2052 continue;
2053
2054 tree fn = TREE_OPERAND (fnaddr, 0)(*((const_cast<tree*> (tree_operand_check ((fnaddr), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2054, __FUNCTION__)))))
;
2055 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL && DECL_IMMEDIATE_FUNCTION_P (fn)(((contains_struct_check (((tree_check (((((enum tree_code) (
fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__))->decl_common.lang_specific) ? __extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2055, __FUNCTION__); &lt->u.fn; })->immediate_fn_p
: false)
)
2056 {
2057 if (!consteval_seen)
2058 {
2059 consteval_seen = true;
2060 consteval_vtables.safe_push (decl);
2061 }
2062 continue;
2063 }
2064 TREE_ADDRESSABLE (fn)((fn)->base.addressable_flag) = 1;
2065 /* When we don't have vcall offsets, we output thunks whenever
2066 we output the vtables that contain them. With vcall offsets,
2067 we know all the thunks we'll need when we emit a virtual
2068 function, so we emit the thunks there instead. */
2069 if (DECL_THUNK_P (fn)(((enum tree_code) (fn)->base.code) == FUNCTION_DECL &&
((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2069, __FUNCTION__))->decl_common.lang_specific) &&
__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2069, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2069, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2069, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2069, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2069, __FUNCTION__); &lt->u.fn; })->thunk_p)
)
2070 use_thunk (fn, /*emit_p=*/0);
2071 /* Set the location, as marking the function could cause
2072 instantiation. We do not need to preserve the incoming
2073 location, as we're called from c_parse_final_cleanups, which
2074 takes care of that. */
2075 input_location = DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2075, __FUNCTION__))->decl_minimal.locus)
;
2076 mark_used (fn);
2077 }
2078}
2079
2080/* Replace any consteval functions in vtables with null pointers. */
2081
2082static void
2083clear_consteval_vfns (vec<tree> &consteval_vtables)
2084{
2085 for (tree vtable : consteval_vtables)
2086 for (constructor_elt &elt : CONSTRUCTOR_ELTS (DECL_INITIAL (vtable))((tree_check ((((contains_struct_check ((vtable), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2086, __FUNCTION__))->decl_common.initial)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2086, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
)
2087 {
2088 tree fn = cp_get_fndecl_from_callee (elt.value, /*fold*/false);
2089 if (fn && DECL_IMMEDIATE_FUNCTION_P (fn)(((contains_struct_check (((tree_check (((((enum tree_code) (
fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__))->decl_common.lang_specific) ? __extension__
({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code
) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2089, __FUNCTION__); &lt->u.fn; })->immediate_fn_p
: false)
)
2090 elt.value = build_zero_cst (vtable_entry_typecp_global_trees[CPTI_VTABLE_ENTRY_TYPE]);
2091 }
2092}
2093
2094/* Adjust the TLS model on variable DECL if need be, typically after
2095 the linkage of DECL has been modified. */
2096
2097static void
2098adjust_var_decl_tls_model (tree decl)
2099{
2100 if (CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2100, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2100, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
2101 && !lookup_attribute ("tls_model", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2101, __FUNCTION__))->decl_common.attributes)
))
2102 set_decl_tls_model (decl, decl_default_tls_model (decl));
2103}
2104
2105/* Set DECL up to have the closest approximation of "initialized common"
2106 linkage available. */
2107
2108void
2109comdat_linkage (tree decl)
2110{
2111 if (flag_weakglobal_options.x_flag_weak)
2112 {
2113 make_decl_one_only (decl, cxx_comdat_group (decl));
2114 if (HAVE_COMDAT_GROUP1 && flag_contractsglobal_options.x_flag_contracts && DECL_CONTRACTS (decl)(find_contract (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2114, __FUNCTION__))->decl_common.attributes)))
)
2115 {
2116 symtab_node *n = symtab_node::get (decl);
2117 if (tree pre = DECL_PRE_FN (decl)(get_precondition_function ((decl))))
2118 cgraph_node::get_create (pre)->add_to_same_comdat_group (n);
2119 if (tree post = DECL_POST_FN (decl)(get_postcondition_function ((decl))))
2120 cgraph_node::get_create (post)->add_to_same_comdat_group (n);
2121 }
2122 }
2123 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
2124 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2124, __FUNCTION__))->decl_common.artificial_flag)
))
2125 /* We can just emit function and compiler-generated variables
2126 statically; having multiple copies is (for the most part) only
2127 a waste of space.
2128
2129 There are two correctness issues, however: the address of a
2130 template instantiation with external linkage should be the
2131 same, independent of what translation unit asks for the
2132 address, and this will not hold when we emit multiple copies of
2133 the function. However, there's little else we can do.
2134
2135 Also, by default, the typeinfo implementation assumes that
2136 there will be only one copy of the string used as the name for
2137 each type. Therefore, if weak symbols are unavailable, the
2138 run-time library should perform a more conservative check; it
2139 should perform a string comparison, rather than an address
2140 comparison. */
2141 TREE_PUBLIC (decl)((decl)->base.public_flag) = 0;
2142 else
2143 {
2144 /* Static data member template instantiations, however, cannot
2145 have multiple copies. */
2146 if (DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2146, __FUNCTION__))->decl_common.initial)
== 0
2147 || DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2147, __FUNCTION__))->decl_common.initial)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
2148 DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2148, __FUNCTION__))->decl_with_vis.common_flag)
= 1;
2149 else if (EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2149, __FUNCTION__))->decl_common.initial))->base.code
) == CONSTRUCTOR && vec_safe_is_empty(((tree_check ((
((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2149, __FUNCTION__))->decl_common.initial)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2149, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)) &&
!(((tree_not_check2 ((((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2149, __FUNCTION__))->decl_common.initial)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2149, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)))
)
2150 {
2151 DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2151, __FUNCTION__))->decl_with_vis.common_flag)
= 1;
2152 DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2152, __FUNCTION__))->decl_common.initial)
= error_mark_nodeglobal_trees[TI_ERROR_MARK];
2153 }
2154 else if (!DECL_EXPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2154, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 3)
)
2155 {
2156 /* We can't do anything useful; leave vars for explicit
2157 instantiation. */
2158 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2158, __FUNCTION__))->decl_common.decl_flag_1)
= 1;
2159 DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2159, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
= 0;
2160 }
2161 }
2162
2163 if (TREE_PUBLIC (decl)((decl)->base.public_flag))
2164 DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2164, __FUNCTION__))->decl_with_vis.comdat_flag)
= 1;
2165
2166 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
2167 adjust_var_decl_tls_model (decl);
2168}
2169
2170/* For win32 we also want to put explicit instantiations in
2171 linkonce sections, so that they will be merged with implicit
2172 instantiations; otherwise we get duplicate symbol errors.
2173 For Darwin we do not want explicit instantiations to be
2174 linkonce. */
2175
2176void
2177maybe_make_one_only (tree decl)
2178{
2179 /* We used to say that this was not necessary on targets that support weak
2180 symbols, because the implicit instantiations will defer to the explicit
2181 one. However, that's not actually the case in SVR4; a strong definition
2182 after a weak one is an error. Also, not making explicit
2183 instantiations one_only means that we can end up with two copies of
2184 some template instantiations. */
2185 if (! flag_weakglobal_options.x_flag_weak)
2186 return;
2187
2188 /* We can't set DECL_COMDAT on functions, or cp_finish_file will think
2189 we can get away with not emitting them if they aren't used. We need
2190 to for variables so that cp_finish_decl will update their linkage,
2191 because their DECL_INITIAL may not have been set properly yet. */
2192
2193 if (!TARGET_WEAK_NOT_IN_ARCHIVE_TOC0
2194 || (! DECL_EXPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2194, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 3)
2195 && ! DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2195, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
))
2196 {
2197 make_decl_one_only (decl, cxx_comdat_group (decl));
2198
2199 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
2200 {
2201 varpool_node *node = varpool_node::get_create (decl);
2202 DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2202, __FUNCTION__))->decl_with_vis.comdat_flag)
= 1;
2203 /* Mark it needed so we don't forget to emit it. */
2204 node->forced_by_abi = true;
2205 TREE_USED (decl)((decl)->base.used_flag) = 1;
2206
2207 adjust_var_decl_tls_model (decl);
2208 }
2209 }
2210}
2211
2212/* Returns true iff DECL, a FUNCTION_DECL or VAR_DECL, has vague linkage.
2213 This predicate will give the right answer during parsing of the
2214 function, which other tests may not. */
2215
2216bool
2217vague_linkage_p (tree decl)
2218{
2219 if (!TREE_PUBLIC (decl)((decl)->base.public_flag))
2220 {
2221 /* maybe_thunk_body clears TREE_PUBLIC and DECL_ABSTRACT_P on the
2222 maybe-in-charge 'tor variants; in that case we need to check one of
2223 the "clones" for the real linkage. But only in that case; before
2224 maybe_clone_body we haven't yet copied the linkage to the clones. */
2225 if (DECL_MAYBE_IN_CHARGE_CDTOR_P (decl)((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2225, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2225, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER]))
2226 && !DECL_ABSTRACT_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2226, __FUNCTION__))->decl_common.abstract_flag)
2227 && DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2227, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2227, __FUNCTION__))->common.chain))
2228 && DECL_CLONED_FUNCTION_P (DECL_CHAIN (decl))(((contains_struct_check (((((contains_struct_check (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
(((((contains_struct_check (((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2228, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))
)
2229 return vague_linkage_p (DECL_CHAIN (decl)(((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2229, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2229, __FUNCTION__))->common.chain))
);
2230
2231 gcc_checking_assert (!DECL_COMDAT (decl))((void)(!(!((contains_struct_check ((decl), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2231, __FUNCTION__))->decl_with_vis.comdat_flag)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2231, __FUNCTION__), 0 : 0))
;
2232 return false;
2233 }
2234 /* Unfortunately, import_export_decl has not always been called
2235 before the function is processed, so we cannot simply check
2236 DECL_COMDAT. */
2237 if (DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2237, __FUNCTION__))->decl_with_vis.comdat_flag)
2238 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
2239 && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2239, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
)
2240 || (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2240, __FUNCTION__))->decl_common.lang_specific)
2241 && DECL_TEMPLATE_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2241, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) & 1)
)
2242 || (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_INLINE_VAR_P (decl)((((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__))->decl_common.lang_specific)->u.base
.var_declared_inline_p : false) || (cxx_dialect >= cxx17 &&
((contains_struct_check (((tree_check2 (((((enum tree_code) (
decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__))->decl_common.lang_flag_8) &&
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2242, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))))
))
2243 return true;
2244 else if (DECL_FUNCTION_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2244, __FUNCTION__))->decl_minimal.context) && (
(enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2244, __FUNCTION__))->decl_minimal.context))->base.code
) == FUNCTION_DECL)
)
2245 /* A local static in an inline effectively has vague linkage. */
2246 return (TREE_STATIC (decl)((decl)->base.static_flag)
2247 && vague_linkage_p (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2247, __FUNCTION__))->decl_minimal.context)
));
2248 else
2249 return false;
2250}
2251
2252/* Determine whether or not we want to specifically import or export CTYPE,
2253 using various heuristics. */
2254
2255static void
2256import_export_class (tree ctype)
2257{
2258 /* -1 for imported, 1 for exported. */
2259 int import_export = 0;
2260
2261 /* It only makes sense to call this function at EOF. The reason is
2262 that this function looks at whether or not the first non-inline
2263 non-abstract virtual member function has been defined in this
2264 translation unit. But, we can't possibly know that until we've
2265 seen the entire translation unit. */
2266 gcc_assert (at_eof)((void)(!(at_eof) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2266, __FUNCTION__), 0 : 0))
;
2267
2268 if (CLASSTYPE_INTERFACE_KNOWN (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2268, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_unknown == 0)
)
2269 return;
2270
2271 /* If MULTIPLE_SYMBOL_SPACES is set and we saw a #pragma interface,
2272 we will have CLASSTYPE_INTERFACE_ONLY set but not
2273 CLASSTYPE_INTERFACE_KNOWN. In that case, we don't want to use this
2274 heuristic because someone will supply a #pragma implementation
2275 elsewhere, and deducing it here would produce a conflict. */
2276 if (CLASSTYPE_INTERFACE_ONLY (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2276, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_only)
)
2277 return;
2278
2279 if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2279, __FUNCTION__))->type_common.attributes)
))
2280 import_export = -1;
2281 else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2281, __FUNCTION__))->type_common.attributes)
))
2282 import_export = 1;
2283 else if (CLASSTYPE_IMPLICIT_INSTANTIATION (ctype)(((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2283, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 1)
2284 && !flag_implicit_templatesglobal_options.x_flag_implicit_templates)
2285 /* For a template class, without -fimplicit-templates, check the
2286 repository. If the virtual table is assigned to this
2287 translation unit, then export the class; otherwise, import
2288 it. */
2289 import_export = -1;
2290 else if (TYPE_POLYMORPHIC_P (ctype)(((tree_not_check2 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2290, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2))
)
2291 {
2292 /* The ABI specifies that the virtual table and associated
2293 information are emitted with the key method, if any. */
2294 tree method = CLASSTYPE_KEY_METHOD (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2294, __FUNCTION__))->type_with_lang_specific.lang_specific
))->key_method)
;
2295 /* If weak symbol support is not available, then we must be
2296 careful not to emit the vtable when the key function is
2297 inline. An inline function can be defined in multiple
2298 translation units. If we were to emit the vtable in each
2299 translation unit containing a definition, we would get
2300 multiple definition errors at link-time. */
2301 if (method && (flag_weakglobal_options.x_flag_weak || ! DECL_DECLARED_INLINE_P (method)((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2301, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
))
2302 import_export = (DECL_REALLY_EXTERN (method)(((contains_struct_check ((method), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2302, __FUNCTION__))->decl_common.decl_flag_1) &&
(!((contains_struct_check ((method), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2302, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((method), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2302, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)))
? -1 : 1);
2303 }
2304
2305 /* When MULTIPLE_SYMBOL_SPACES is set, we cannot count on seeing
2306 a definition anywhere else. */
2307 if (MULTIPLE_SYMBOL_SPACES0 && import_export == -1)
2308 import_export = 0;
2309
2310 /* Allow back ends the chance to overrule the decision. */
2311 if (targetm.cxx.import_export_class)
2312 import_export = targetm.cxx.import_export_class (ctype, import_export);
2313
2314 if (import_export)
2315 {
2316 SET_CLASSTYPE_INTERFACE_KNOWN (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2316, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_unknown = 0)
;
2317 CLASSTYPE_INTERFACE_ONLY (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2317, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_only)
= (import_export < 0);
2318 }
2319}
2320
2321/* Return true if VAR has already been provided to the back end; in that
2322 case VAR should not be modified further by the front end. */
2323static bool
2324var_finalized_p (tree var)
2325{
2326 return varpool_node::get_create (var)->definition;
2327}
2328
2329/* DECL is a VAR_DECL or FUNCTION_DECL which, for whatever reason,
2330 must be emitted in this translation unit. Mark it as such. */
2331
2332void
2333mark_needed (tree decl)
2334{
2335 TREE_USED (decl)((decl)->base.used_flag) = 1;
2336 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
2337 {
2338 /* Extern inline functions don't become needed when referenced.
2339 If we know a method will be emitted in other TU and no new
2340 functions can be marked reachable, just use the external
2341 definition. */
2342 struct cgraph_node *node = cgraph_node::get_create (decl);
2343 node->forced_by_abi = true;
2344
2345 /* #pragma interface can call mark_needed for
2346 maybe-in-charge 'tors; mark the clones as well. */
2347 tree clone;
2348 FOR_EACH_CLONE (clone, decl)if (!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL
&& ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ; else for (clone = (((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->common.chain)); clone && (
((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((clone
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check ((clone)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((clone),
(TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER]))); clone = (((contains_struct_check (
((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2348, __FUNCTION__))->common.chain)))
2349 mark_needed (clone);
2350 }
2351 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
2352 {
2353 varpool_node *node = varpool_node::get_create (decl);
2354 /* C++ frontend use mark_decl_references to force COMDAT variables
2355 to be output that might appear dead otherwise. */
2356 node->forced_by_abi = true;
2357 }
2358}
2359
2360/* DECL is either a FUNCTION_DECL or a VAR_DECL. This function
2361 returns true if a definition of this entity should be provided in
2362 this object file. Callers use this function to determine whether
2363 or not to let the back end know that a definition of DECL is
2364 available in this translation unit. */
2365
2366bool
2367decl_needed_p (tree decl)
2368{
2369 gcc_assert (VAR_OR_FUNCTION_DECL_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL
|| ((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2369, __FUNCTION__), 0 : 0))
;
2370 /* This function should only be called at the end of the translation
2371 unit. We cannot be sure of whether or not something will be
2372 COMDAT until that point. */
2373 gcc_assert (at_eof)((void)(!(at_eof) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2373, __FUNCTION__), 0 : 0))
;
2374
2375 /* All entities with external linkage that are not COMDAT/EXTERN should be
2376 emitted; they may be referred to from other object files. */
2377 if (TREE_PUBLIC (decl)((decl)->base.public_flag) && !DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2377, __FUNCTION__))->decl_with_vis.comdat_flag)
&& !DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2377, __FUNCTION__))->decl_common.decl_flag_1) &&
(!((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2377, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2377, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)))
)
2378 return true;
2379
2380 /* Functions marked "dllexport" must be emitted so that they are
2381 visible to other DLLs. */
2382 if (flag_keep_inline_dllexportglobal_options.x_flag_keep_inline_dllexport
2383 && lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2383, __FUNCTION__))->decl_common.attributes)
))
2384 return true;
2385
2386 /* When not optimizing, do not bother to produce definitions for extern
2387 symbols. */
2388 if (DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2388, __FUNCTION__))->decl_common.decl_flag_1) &&
(!((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2388, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2388, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)))
2389 && ((TREE_CODE (decl)((enum tree_code) (decl)->base.code) != FUNCTION_DECL
2390 && !optimizeglobal_options.x_optimize)
2391 || (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
2392 && !opt_for_fn (decl, optimize)(opts_for_fn (decl)->x_optimize)))
2393 && !lookup_attribute ("always_inline", decl))
2394 return false;
2395
2396 /* If this entity was used, let the back end see it; it will decide
2397 whether or not to emit it into the object file. */
2398 if (TREE_USED (decl)((decl)->base.used_flag))
2399 return true;
2400
2401 /* Virtual functions might be needed for devirtualization. */
2402 if (flag_devirtualizeglobal_options.x_flag_devirtualize
2403 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
2404 && DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2404, __FUNCTION__))->decl_common.virtual_flag)
)
2405 return true;
2406
2407 /* Otherwise, DECL does not need to be emitted -- yet. A subsequent
2408 reference to DECL might cause it to be emitted later. */
2409 return false;
2410}
2411
2412/* If necessary, write out the vtables for the dynamic class CTYPE.
2413 Returns true if any vtables were emitted. */
2414
2415static bool
2416maybe_emit_vtables (tree ctype, vec<tree> &consteval_vtables)
2417{
2418 tree vtbl;
2419 tree primary_vtbl;
2420 int needed = 0;
2421 varpool_node *current = NULL__null, *last = NULL__null;
2422
2423 /* If the vtables for this class have already been emitted there is
2424 nothing more to do. */
2425 primary_vtbl = CLASSTYPE_VTABLES (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2425, __FUNCTION__))->type_with_lang_specific.lang_specific
))->vtables)
;
2426 if (var_finalized_p (primary_vtbl))
2427 return false;
2428 /* Ignore dummy vtables made by get_vtable_decl. */
2429 if (TREE_TYPE (primary_vtbl)((contains_struct_check ((primary_vtbl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2429, __FUNCTION__))->typed.type)
== void_type_nodeglobal_trees[TI_VOID_TYPE])
2430 return false;
2431
2432 /* On some targets, we cannot determine the key method until the end
2433 of the translation unit -- which is when this function is
2434 called. */
2435 if (!targetm.cxx.key_method_may_be_inline ())
2436 determine_key_method (ctype);
2437
2438 /* See if any of the vtables are needed. */
2439 for (vtbl = CLASSTYPE_VTABLES (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2439, __FUNCTION__))->type_with_lang_specific.lang_specific
))->vtables)
; vtbl; vtbl = DECL_CHAIN (vtbl)(((contains_struct_check (((contains_struct_check ((vtbl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2439, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2439, __FUNCTION__))->common.chain))
)
2440 {
2441 import_export_decl (vtbl);
2442 if (DECL_NOT_REALLY_EXTERN (vtbl)(((contains_struct_check ((vtbl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2442, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
&& decl_needed_p (vtbl))
2443 needed = 1;
2444 }
2445 if (!needed)
2446 {
2447 /* If the references to this class' vtables are optimized away,
2448 still emit the appropriate debugging information. See
2449 dfs_debug_mark. */
2450 if (DECL_COMDAT (primary_vtbl)((contains_struct_check ((primary_vtbl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2450, __FUNCTION__))->decl_with_vis.comdat_flag)
2451 && CLASSTYPE_DEBUG_REQUESTED (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2451, __FUNCTION__))->type_with_lang_specific.lang_specific
))->debug_requested)
)
2452 note_debug_info_needed (ctype);
2453 return false;
2454 }
2455
2456 /* The ABI requires that we emit all of the vtables if we emit any
2457 of them. */
2458 for (vtbl = CLASSTYPE_VTABLES (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2458, __FUNCTION__))->type_with_lang_specific.lang_specific
))->vtables)
; vtbl; vtbl = DECL_CHAIN (vtbl)(((contains_struct_check (((contains_struct_check ((vtbl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2458, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2458, __FUNCTION__))->common.chain))
)
2459 {
2460 /* Mark entities references from the virtual table as used. */
2461 mark_vtable_entries (vtbl, consteval_vtables);
2462
2463 if (TREE_TYPE (DECL_INITIAL (vtbl))((contains_struct_check ((((contains_struct_check ((vtbl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2463, __FUNCTION__))->decl_common.initial)), (TS_TYPED),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2463, __FUNCTION__))->typed.type)
== 0)
2464 {
2465 vec<tree, va_gc> *cleanups = NULL__null;
2466 tree expr = store_init_value (vtbl, DECL_INITIAL (vtbl)((contains_struct_check ((vtbl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2466, __FUNCTION__))->decl_common.initial)
, &cleanups,
2467 LOOKUP_NORMAL((1 << 0)));
2468
2469 /* It had better be all done at compile-time. */
2470 gcc_assert (!expr && !cleanups)((void)(!(!expr && !cleanups) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2470, __FUNCTION__), 0 : 0))
;
2471 }
2472
2473 /* Write it out. */
2474 DECL_EXTERNAL (vtbl)((contains_struct_check ((vtbl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2474, __FUNCTION__))->decl_common.decl_flag_1)
= 0;
2475 rest_of_decl_compilation (vtbl, 1, 1);
2476
2477 /* Because we're only doing syntax-checking, we'll never end up
2478 actually marking the variable as written. */
2479 if (flag_syntax_onlyglobal_options.x_flag_syntax_only)
2480 TREE_ASM_WRITTEN (vtbl)((vtbl)->base.asm_written_flag) = 1;
2481 else if (DECL_ONE_ONLY (vtbl)(decl_comdat_group (vtbl) != (tree) __null && (((vtbl
)->base.public_flag) || ((contains_struct_check ((vtbl), (
TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2481, __FUNCTION__))->decl_common.decl_flag_1)))
)
2482 {
2483 current = varpool_node::get_create (vtbl);
2484 if (last)
2485 current->add_to_same_comdat_group (last);
2486 last = current;
2487 }
2488 }
2489
2490 /* For abstract classes, the destructor has been removed from the
2491 vtable (in class.cc's build_vtbl_initializer). For a compiler-
2492 generated destructor, it hence might not have been generated in
2493 this translation unit - and with '#pragma interface' it might
2494 never get generated. */
2495 if (CLASSTYPE_PURE_VIRTUALS (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2495, __FUNCTION__))->type_with_lang_specific.lang_specific
))->pure_virtuals)
2496 && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2496, __FUNCTION__))->type_common.lang_flag_4))
2497 && !CLASSTYPE_LAZY_DESTRUCTOR (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2497, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lazy_destructor)
2498 && DECL_DEFAULTED_IN_CLASS_P (CLASSTYPE_DESTRUCTOR (ctype))((__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) ((get_class_binding_direct (ctype, cp_global_trees
[CPTI_DTOR_IDENTIFIER])))->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check (((get_class_binding_direct (ctype, cp_global_trees
[CPTI_DTOR_IDENTIFIER]))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2498, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (get_class_binding_direct
(ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER])))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2498, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) ((get_class_binding_direct (ctype, cp_global_trees
[CPTI_DTOR_IDENTIFIER])))->base.code) == FUNCTION_DECL || (
((enum tree_code) ((get_class_binding_direct (ctype, cp_global_trees
[CPTI_DTOR_IDENTIFIER])))->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check (((get_class_binding_direct (ctype, cp_global_trees
[CPTI_DTOR_IDENTIFIER]))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2498, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check (((get_class_binding_direct
(ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER]))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2498, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2498, __FUNCTION__); &lt->u.fn; })->defaulted_p) &&
(((contains_struct_check (((tree_check2 (((get_class_binding_direct
(ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER]))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2498, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2498, __FUNCTION__))->decl_common.lang_specific) ->u.
base.initialized_in_class))
)
2499 note_vague_linkage_fn (CLASSTYPE_DESTRUCTOR (ctype)(get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER
]))
);
2500
2501 /* Since we're writing out the vtable here, also write the debug
2502 info. */
2503 note_debug_info_needed (ctype);
2504
2505 return true;
2506}
2507
2508/* A special return value from type_visibility meaning internal
2509 linkage. */
2510
2511enum { VISIBILITY_ANON = VISIBILITY_INTERNAL+1 };
2512
2513static int expr_visibility (tree);
2514static int type_visibility (tree);
2515
2516/* walk_tree helper function for type_visibility. */
2517
2518static tree
2519min_vis_r (tree *tp, int *walk_subtrees, void *data)
2520{
2521 int *vis_p = (int *)data;
2522 int this_vis = VISIBILITY_DEFAULT;
2523 if (! TYPE_P (*tp)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (*tp)->base.code))] == tcc_type)
)
2524 *walk_subtrees = 0;
2525 else if (OVERLOAD_TYPE_P (*tp)((((((enum tree_code) (*tp)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (*tp)->base.code)) == UNION_TYPE) &&
((tree_class_check ((*tp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2525, __FUNCTION__))->type_common.lang_flag_5)) || ((enum
tree_code) (*tp)->base.code) == ENUMERAL_TYPE)
2526 && !TREE_PUBLIC (TYPE_MAIN_DECL (*tp))((((((contains_struct_check (((tree_class_check ((((tree_class_check
((*tp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2526, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2526, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2526, __FUNCTION__))->common.chain))))->base.public_flag
)
)
2527 {
2528 this_vis = VISIBILITY_ANON;
2529 *walk_subtrees = 0;
2530 }
2531 else if (CLASS_TYPE_P (*tp)(((((enum tree_code) (*tp)->base.code)) == RECORD_TYPE || (
((enum tree_code) (*tp)->base.code)) == UNION_TYPE) &&
((tree_class_check ((*tp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2531, __FUNCTION__))->type_common.lang_flag_5))
)
2532 {
2533 this_vis = CLASSTYPE_VISIBILITY (*tp)((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((*tp), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2533, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2533, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2533, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2533, __FUNCTION__))->decl_with_vis.visibility)
;
2534 *walk_subtrees = 0;
2535 }
2536 else if (TREE_CODE (*tp)((enum tree_code) (*tp)->base.code) == ARRAY_TYPE
2537 && uses_template_parms (TYPE_DOMAIN (*tp)((tree_check ((*tp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2537, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
))
2538 this_vis = expr_visibility (TYPE_MAX_VALUE (TYPE_DOMAIN (*tp))((tree_check5 ((((tree_check ((*tp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2538, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2538, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
);
2539
2540 if (this_vis > *vis_p)
2541 *vis_p = this_vis;
2542
2543 /* Tell cp_walk_subtrees to look through typedefs. */
2544 if (*walk_subtrees == 1)
2545 *walk_subtrees = 2;
2546
2547 return NULL__null;
2548}
2549
2550/* walk_tree helper function for expr_visibility. */
2551
2552static tree
2553min_vis_expr_r (tree *tp, int */*walk_subtrees*/, void *data)
2554{
2555 int *vis_p = (int *)data;
2556 int tpvis = VISIBILITY_DEFAULT;
2557
2558 switch (TREE_CODE (*tp)((enum tree_code) (*tp)->base.code))
2559 {
2560 case CAST_EXPR:
2561 case IMPLICIT_CONV_EXPR:
2562 case STATIC_CAST_EXPR:
2563 case REINTERPRET_CAST_EXPR:
2564 case CONST_CAST_EXPR:
2565 case DYNAMIC_CAST_EXPR:
2566 case NEW_EXPR:
2567 case CONSTRUCTOR:
2568 case LAMBDA_EXPR:
2569 tpvis = type_visibility (TREE_TYPE (*tp)((contains_struct_check ((*tp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2569, __FUNCTION__))->typed.type)
);
2570 break;
2571
2572 case VAR_DECL:
2573 case FUNCTION_DECL:
2574 if (! TREE_PUBLIC (*tp)((*tp)->base.public_flag))
2575 tpvis = VISIBILITY_ANON;
2576 else
2577 tpvis = DECL_VISIBILITY (*tp)((contains_struct_check ((*tp), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2577, __FUNCTION__))->decl_with_vis.visibility)
;
2578 break;
2579
2580 default:
2581 break;
2582 }
2583
2584 if (tpvis > *vis_p)
2585 *vis_p = tpvis;
2586
2587 return NULL_TREE(tree) __null;
2588}
2589
2590/* Returns the visibility of TYPE, which is the minimum visibility of its
2591 component types. */
2592
2593static int
2594type_visibility (tree type)
2595{
2596 int vis = VISIBILITY_DEFAULT;
2597 cp_walk_tree_without_duplicates (&type, min_vis_r, &vis)walk_tree_without_duplicates_1 (&type, min_vis_r, &vis
, cp_walk_subtrees)
;
2598 return vis;
2599}
2600
2601/* Returns the visibility of an expression EXPR that appears in the signature
2602 of a function template, which is the minimum visibility of names that appear
2603 in its mangling. */
2604
2605static int
2606expr_visibility (tree expr)
2607{
2608 int vis = VISIBILITY_DEFAULT;
2609 cp_walk_tree_without_duplicates (&expr, min_vis_expr_r, &vis)walk_tree_without_duplicates_1 (&expr, min_vis_expr_r, &
vis, cp_walk_subtrees)
;
2610 return vis;
2611}
2612
2613/* Limit the visibility of DECL to VISIBILITY, if not explicitly
2614 specified (or if VISIBILITY is static). If TMPL is true, this
2615 constraint is for a template argument, and takes precedence
2616 over explicitly-specified visibility on the template. */
2617
2618static void
2619constrain_visibility (tree decl, int visibility, bool tmpl)
2620{
2621 if (visibility == VISIBILITY_ANON)
2622 {
2623 /* extern "C" declarations aren't affected by the anonymous
2624 namespace. */
2625 if (!DECL_EXTERN_C_P (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2625, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2625, __FUNCTION__))->decl_common.lang_specific)->u.base
.language : (((enum tree_code) (decl)->base.code) == FUNCTION_DECL
? lang_c : lang_cplusplus)) == lang_c)
)
2626 {
2627 TREE_PUBLIC (decl)((decl)->base.public_flag) = 0;
2628 DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2628, __FUNCTION__))->decl_with_vis.weak_flag)
= 0;
2629 DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2629, __FUNCTION__))->decl_with_vis.common_flag)
= 0;
2630 DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2630, __FUNCTION__))->decl_with_vis.comdat_flag)
= false;
2631 if (VAR_OR_FUNCTION_DECL_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL || ((enum
tree_code) (decl)->base.code) == FUNCTION_DECL)
)
2632 {
2633 struct symtab_node *snode = symtab_node::get (decl);
2634
2635 if (snode)
2636 snode->set_comdat_group (NULL__null);
2637 }
2638 DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2638, __FUNCTION__))->decl_common.lang_flag_5)
= 1;
2639 if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2639, __FUNCTION__))->decl_common.lang_specific)
)
2640 DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2640, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
= 1;
2641 }
2642 }
2643 else if (visibility > DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2643, __FUNCTION__))->decl_with_vis.visibility)
2644 && (tmpl || !DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2644, __FUNCTION__))->decl_with_vis.visibility_specified
)
))
2645 {
2646 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2646, __FUNCTION__))->decl_with_vis.visibility)
= (enum symbol_visibility) visibility;
2647 /* This visibility was not specified. */
2648 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2648, __FUNCTION__))->decl_with_vis.visibility_specified
)
= false;
2649 }
2650}
2651
2652/* Constrain the visibility of DECL based on the visibility of its template
2653 arguments. */
2654
2655static void
2656constrain_visibility_for_template (tree decl, tree targs)
2657{
2658 /* If this is a template instantiation, check the innermost
2659 template args for visibility constraints. The outer template
2660 args are covered by the class check. */
2661 tree args = INNERMOST_TEMPLATE_ARGS (targs)(get_innermost_template_args ((targs), 1));
2662 int i;
2663 for (i = TREE_VEC_LENGTH (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2663, __FUNCTION__, (TREE_VEC)))->base.u.length)
; i > 0; --i)
2664 {
2665 int vis = 0;
2666
2667 tree arg = TREE_VEC_ELT (args, i-1)(*((const_cast<tree *> (tree_vec_elt_check ((args), (i-
1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2667, __FUNCTION__)))))
;
2668 if (TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
)
2669 vis = type_visibility (arg);
2670 else
2671 vis = expr_visibility (arg);
2672 if (vis)
2673 constrain_visibility (decl, vis, true);
2674 }
2675}
2676
2677/* Like c_determine_visibility, but with additional C++-specific
2678 behavior.
2679
2680 Function-scope entities can rely on the function's visibility because
2681 it is set in start_preparsed_function.
2682
2683 Class-scope entities cannot rely on the class's visibility until the end
2684 of the enclosing class definition.
2685
2686 Note that because namespaces have multiple independent definitions,
2687 namespace visibility is handled elsewhere using the #pragma visibility
2688 machinery rather than by decorating the namespace declaration.
2689
2690 The goal is for constraints from the type to give a diagnostic, and
2691 other constraints to be applied silently. */
2692
2693void
2694determine_visibility (tree decl)
2695{
2696 /* Remember that all decls get VISIBILITY_DEFAULT when built. */
2697
2698 /* Only relevant for names with external linkage. */
2699 if (!TREE_PUBLIC (decl)((decl)->base.public_flag))
2700 return;
2701
2702 /* Cloned constructors and destructors get the same visibility as
2703 the underlying function. That should be set up in
2704 maybe_clone_body. */
2705 gcc_assert (!DECL_CLONED_FUNCTION_P (decl))((void)(!(!(((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2705, __FUNCTION__), 0 : 0))
;
2706
2707 bool orig_visibility_specified = DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2707, __FUNCTION__))->decl_with_vis.visibility_specified
)
;
2708 enum symbol_visibility orig_visibility = DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2708, __FUNCTION__))->decl_with_vis.visibility)
;
2709
2710 /* The decl may be a template instantiation, which could influence
2711 visibilty. */
2712 tree template_decl = NULL_TREE(tree) __null;
2713 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)
2714 {
2715 if (CLASS_TYPE_P (TREE_TYPE (decl))(((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2715, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2715, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((decl
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2715, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2715, __FUNCTION__))->type_common.lang_flag_5))
)
2716 {
2717 if (CLASSTYPE_USE_TEMPLATE (TREE_TYPE (decl))((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2717, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2717, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
)
2718 template_decl = decl;
2719 }
2720 else if (TYPE_TEMPLATE_INFO (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2720, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2720, __FUNCTION__))->typed.type))->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| (((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2720, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2720, __FUNCTION__))->typed.type))->base.code) == UNION_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2720, __FUNCTION__))->typed.type))->base.code) == QUAL_UNION_TYPE
) ? ((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2720, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2720, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)
)
2721 template_decl = decl;
2722 }
2723 else if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2723, __FUNCTION__))->decl_common.lang_specific)
&& DECL_USE_TEMPLATE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2723, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
)
2724 template_decl = decl;
2725
2726 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
2727 && LAMBDA_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
&& ((((tree_class_check ((((tree_class_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2727, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))
2728 && CLASSTYPE_LAMBDA_EXPR (TREE_TYPE (decl))((((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2728, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2728, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK])
2729 if (tree extra = LAMBDA_TYPE_EXTRA_SCOPE (TREE_TYPE (decl))((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check
((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2729, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2729, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2729, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope))
)
2730 {
2731 /* The lambda's visibility is limited by that of its extra
2732 scope. */
2733 int vis = 0;
2734 if (TYPE_P (extra)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (extra)->base.code))] == tcc_type)
)
2735 vis = type_visibility (extra);
2736 else
2737 vis = expr_visibility (extra);
2738 constrain_visibility (decl, vis, false);
2739 }
2740
2741 /* If DECL is a member of a class, visibility specifiers on the
2742 class can influence the visibility of the DECL. */
2743 tree class_type = NULL_TREE(tree) __null;
2744 if (DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2744, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2744, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
2745 class_type = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2745, __FUNCTION__))->decl_minimal.context)
;
2746 else
2747 {
2748 /* Not a class member. */
2749
2750 /* Virtual tables have DECL_CONTEXT set to their associated class,
2751 so they are automatically handled above. */
2752 gcc_assert (!VAR_P (decl)((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL
) || !((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2753, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2753, __FUNCTION__))->decl_common.virtual_flag)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2753, __FUNCTION__), 0 : 0))
2753 || !DECL_VTABLE_OR_VTT_P (decl))((void)(!(!(((enum tree_code) (decl)->base.code) == VAR_DECL
) || !((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2753, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2753, __FUNCTION__))->decl_common.virtual_flag)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2753, __FUNCTION__), 0 : 0))
;
2754
2755 if (DECL_FUNCTION_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2755, __FUNCTION__))->decl_minimal.context) && (
(enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2755, __FUNCTION__))->decl_minimal.context))->base.code
) == FUNCTION_DECL)
&& ! DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2755, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2756 {
2757 /* Local statics and classes get the visibility of their
2758 containing function by default, except that
2759 -fvisibility-inlines-hidden doesn't affect them. */
2760 tree fn = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2760, __FUNCTION__))->decl_minimal.context)
;
2761 if (DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2761, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2762 {
2763 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2763, __FUNCTION__))->decl_with_vis.visibility)
= DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2763, __FUNCTION__))->decl_with_vis.visibility)
;
2764 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2764, __FUNCTION__))->decl_with_vis.visibility_specified
)
=
2765 DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2765, __FUNCTION__))->decl_with_vis.visibility_specified
)
;
2766 }
2767 else
2768 {
2769 if (DECL_CLASS_SCOPE_P (fn)(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2769, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2769, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
2770 determine_visibility_from_class (decl, DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2770, __FUNCTION__))->decl_minimal.context)
);
2771 else if (determine_hidden_inline (fn))
2772 {
2773 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2773, __FUNCTION__))->decl_with_vis.visibility)
= default_visibilityglobal_options.x_default_visibility;
2774 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2774, __FUNCTION__))->decl_with_vis.visibility_specified
)
=
2775 visibility_options.inpragma;
2776 }
2777 else
2778 {
2779 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2779, __FUNCTION__))->decl_with_vis.visibility)
= DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2779, __FUNCTION__))->decl_with_vis.visibility)
;
2780 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2780, __FUNCTION__))->decl_with_vis.visibility_specified
)
=
2781 DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2781, __FUNCTION__))->decl_with_vis.visibility_specified
)
;
2782 }
2783 }
2784
2785 /* Local classes in templates have CLASSTYPE_USE_TEMPLATE set,
2786 but have no TEMPLATE_INFO, so don't try to check it. */
2787 template_decl = NULL_TREE(tree) __null;
2788 }
2789 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2789, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2789, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
2790 && flag_visibility_ms_compatglobal_options.x_flag_visibility_ms_compat)
2791 {
2792 /* Under -fvisibility-ms-compat, types are visible by default,
2793 even though their contents aren't. */
2794 tree underlying_type = TREE_TYPE (DECL_NAME (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2794, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2794, __FUNCTION__))->typed.type)
;
2795 int underlying_vis = type_visibility (underlying_type);
2796 if (underlying_vis == VISIBILITY_ANON
2797 || (CLASS_TYPE_P (underlying_type)(((((enum tree_code) (underlying_type)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (underlying_type)->base.code)) == UNION_TYPE
) && ((tree_class_check ((underlying_type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2797, __FUNCTION__))->type_common.lang_flag_5))
2798 && CLASSTYPE_VISIBILITY_SPECIFIED (underlying_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((underlying_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2798, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2798, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2798, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2798, __FUNCTION__))->decl_with_vis.visibility_specified
)
))
2799 constrain_visibility (decl, underlying_vis, false);
2800 else
2801 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2801, __FUNCTION__))->decl_with_vis.visibility)
= VISIBILITY_DEFAULT;
2802 }
2803 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2803, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2803, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
)
2804 {
2805 /* tinfo visibility is based on the type it's for. */
2806 constrain_visibility
2807 (decl, type_visibility (TREE_TYPE (DECL_NAME (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2807, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2807, __FUNCTION__))->typed.type)
), false);
2808
2809 /* Give the target a chance to override the visibility associated
2810 with DECL. */
2811 if (TREE_PUBLIC (decl)((decl)->base.public_flag)
2812 && !DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2812, __FUNCTION__))->decl_common.decl_flag_1) &&
(!((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2812, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2812, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)))
2813 && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))(((((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2813, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2813, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2813, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2813, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check (((
(contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2813, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2813, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2813, __FUNCTION__))->type_common.lang_flag_5))
2814 && !CLASSTYPE_VISIBILITY_SPECIFIED (TREE_TYPE (DECL_NAME (decl)))((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((((contains_struct_check ((((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2814, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2814, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2814, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2814, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2814, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2814, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2815 targetm.cxx.determine_class_data_visibility (decl);
2816 }
2817 else if (template_decl)
2818 /* Template instantiations and specializations get visibility based
2819 on their template unless they override it with an attribute. */;
2820 else if (! DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2820, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2821 {
2822 if (determine_hidden_inline (decl))
2823 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2823, __FUNCTION__))->decl_with_vis.visibility)
= VISIBILITY_HIDDEN;
2824 else
2825 {
2826 /* Set default visibility to whatever the user supplied with
2827 #pragma GCC visibility or a namespace visibility attribute. */
2828 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2828, __FUNCTION__))->decl_with_vis.visibility)
= default_visibilityglobal_options.x_default_visibility;
2829 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2829, __FUNCTION__))->decl_with_vis.visibility_specified
)
= visibility_options.inpragma;
2830 }
2831 }
2832 }
2833
2834 if (template_decl)
2835 {
2836 /* If the specialization doesn't specify visibility, use the
2837 visibility from the template. */
2838 tree tinfo = get_template_info (template_decl);
2839 tree args = TI_ARGS (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2839, __FUNCTION__, (TEMPLATE_INFO))))->args
;
2840 tree attribs = (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL
2841 ? TYPE_ATTRIBUTES (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2841, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2841, __FUNCTION__))->type_common.attributes)
2842 : DECL_ATTRIBUTES (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2842, __FUNCTION__))->decl_common.attributes)
);
2843 tree attr = lookup_attribute ("visibility", attribs);
2844
2845 if (args != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2846 {
2847 tree pattern = DECL_TEMPLATE_RESULT (TI_TEMPLATE (tinfo))((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((((struct tree_template_info*)(tree_check
((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2847, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2847, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
2848
2849 if (!DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2849, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2850 {
2851 if (!attr
2852 && determine_hidden_inline (decl))
2853 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2853, __FUNCTION__))->decl_with_vis.visibility)
= VISIBILITY_HIDDEN;
2854 else
2855 {
2856 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2856, __FUNCTION__))->decl_with_vis.visibility)
= DECL_VISIBILITY (pattern)((contains_struct_check ((pattern), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2856, __FUNCTION__))->decl_with_vis.visibility)
;
2857 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2857, __FUNCTION__))->decl_with_vis.visibility_specified
)
2858 = DECL_VISIBILITY_SPECIFIED (pattern)((contains_struct_check ((pattern), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2858, __FUNCTION__))->decl_with_vis.visibility_specified
)
;
2859 }
2860 }
2861
2862 if (args
2863 /* Template argument visibility outweighs #pragma or namespace
2864 visibility, but not an explicit attribute. */
2865 && !attr)
2866 {
2867 int depth = TMPL_ARGS_DEPTH (args)((args) == (tree) __null ? 0 : (args && ((tree_check (
(args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2867, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2867, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2867, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2867, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
2868 if (DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2868, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2869 {
2870 /* A class template member with explicit visibility
2871 overrides the class visibility, so we need to apply
2872 all the levels of template args directly. */
2873 int i;
2874 for (i = 1; i <= depth; ++i)
2875 {
2876 tree lev = TMPL_ARGS_LEVEL (args, i)((args && ((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2876, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2876, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2876, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((
const_cast<tree *> (tree_vec_elt_check ((args), ((i) - 1
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2876, __FUNCTION__))))) : (((void)(!((i) == 1) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2876, __FUNCTION__), 0 : 0)), (args)))
;
2877 constrain_visibility_for_template (decl, lev);
2878 }
2879 }
2880 else if (PRIMARY_TEMPLATE_P (TI_TEMPLATE (tinfo))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2880, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2880, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2880, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2880, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2880, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
2881 /* Limit visibility based on its template arguments. */
2882 constrain_visibility_for_template (decl, args);
2883 }
2884 }
2885 }
2886
2887 if (class_type)
2888 determine_visibility_from_class (decl, class_type);
2889
2890 if (decl_internal_context_p (decl))
2891 /* Names in an anonymous namespace get internal linkage. */
2892 constrain_visibility (decl, VISIBILITY_ANON, false);
2893 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL)
2894 {
2895 /* Propagate anonymity from type to decl. */
2896 int tvis = type_visibility (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2896, __FUNCTION__))->typed.type)
);
2897 if (tvis == VISIBILITY_ANON
2898 || ! DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2898, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2899 constrain_visibility (decl, tvis, false);
2900 }
2901 else if (no_linkage_check (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2901, __FUNCTION__))->typed.type)
, /*relaxed_p=*/true))
2902 /* DR 757: A type without linkage shall not be used as the type of a
2903 variable or function with linkage, unless
2904 o the variable or function has extern "C" linkage (7.5 [dcl.link]), or
2905 o the variable or function is not used (3.2 [basic.def.odr]) or is
2906 defined in the same translation unit.
2907
2908 Since non-extern "C" decls need to be defined in the same
2909 translation unit, we can make the type internal. */
2910 constrain_visibility (decl, VISIBILITY_ANON, false);
2911
2912 /* If visibility changed and DECL already has DECL_RTL, ensure
2913 symbol flags are updated. */
2914 if ((DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2914, __FUNCTION__))->decl_with_vis.visibility)
!= orig_visibility
2915 || DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2915, __FUNCTION__))->decl_with_vis.visibility_specified
)
!= orig_visibility_specified)
2916 && ((VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_STATIC (decl)((decl)->base.static_flag))
2917 || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
2918 && DECL_RTL_SET_P (decl)(((tree_contains_struct[(((enum tree_code) (decl)->base.code
))][(TS_DECL_WRTL)])) && (contains_struct_check ((decl
), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2918, __FUNCTION__))->decl_with_rtl.rtl != __null)
)
2919 make_decl_rtl (decl);
2920}
2921
2922/* By default, static data members and function members receive
2923 the visibility of their containing class. */
2924
2925static void
2926determine_visibility_from_class (tree decl, tree class_type)
2927{
2928 if (DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2928, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2929 return;
2930
2931 if (determine_hidden_inline (decl))
2932 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2932, __FUNCTION__))->decl_with_vis.visibility)
= VISIBILITY_HIDDEN;
2933 else
2934 {
2935 /* Default to the class visibility. */
2936 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2936, __FUNCTION__))->decl_with_vis.visibility)
= CLASSTYPE_VISIBILITY (class_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2936, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2936, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2936, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2936, __FUNCTION__))->decl_with_vis.visibility)
;
2937 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2937, __FUNCTION__))->decl_with_vis.visibility_specified
)
2938 = CLASSTYPE_VISIBILITY_SPECIFIED (class_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2938, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2938, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2938, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2938, __FUNCTION__))->decl_with_vis.visibility_specified
)
;
2939 }
2940
2941 /* Give the target a chance to override the visibility associated
2942 with DECL. */
2943 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
2944 && TREE_PUBLIC (decl)((decl)->base.public_flag)
2945 && (DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2945, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2945, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
|| DECL_VTABLE_OR_VTT_P (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2945, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2945, __FUNCTION__))->decl_common.virtual_flag)
)
2946 && !DECL_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2946, __FUNCTION__))->decl_common.decl_flag_1) &&
(!((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2946, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2946, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)))
2947 && !CLASSTYPE_VISIBILITY_SPECIFIED (class_type)((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2947, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2947, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2947, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2947, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2948 targetm.cxx.determine_class_data_visibility (decl);
2949}
2950
2951/* Returns true iff DECL is an inline that should get hidden visibility
2952 because of -fvisibility-inlines-hidden. */
2953
2954static bool
2955determine_hidden_inline (tree decl)
2956{
2957 return (visibility_options.inlines_hidden
2958 /* Don't do this for inline templates; specializations might not be
2959 inline, and we don't want them to inherit the hidden
2960 visibility. We'll set it here for all inline instantiations. */
2961 && !processing_template_declscope_chain->x_processing_template_decl
2962 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
2963 && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2963, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
2964 && (! DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2964, __FUNCTION__))->decl_common.lang_specific)
2965 || ! DECL_EXPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2965, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 3)
));
2966}
2967
2968/* Constrain the visibility of a class TYPE based on the visibility of its
2969 field types. Warn if any fields require lesser visibility. */
2970
2971void
2972constrain_class_visibility (tree type)
2973{
2974 tree binfo;
2975 tree t;
2976 int i;
2977
2978 int vis = type_visibility (type);
2979
2980 if (vis == VISIBILITY_ANON
2981 || DECL_IN_SYSTEM_HEADER (TYPE_MAIN_DECL (type))(in_system_header_at (((contains_struct_check ((((((contains_struct_check
(((tree_class_check ((((tree_class_check ((type), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2981, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2981, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2981, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2981, __FUNCTION__))->decl_minimal.locus)))
)
2982 return;
2983
2984 /* Don't warn about visibility if the class has explicit visibility. */
2985 if (CLASSTYPE_VISIBILITY_SPECIFIED (type)((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2985, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2985, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2985, __FUNCTION__))->common.chain)))), (TS_DECL_WITH_VIS
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2985, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
2986 vis = VISIBILITY_INTERNAL;
2987
2988 for (t = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2988, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; t; t = DECL_CHAIN (t)(((contains_struct_check (((contains_struct_check ((t), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2988, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2988, __FUNCTION__))->common.chain))
)
2989 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FIELD_DECL && TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2989, __FUNCTION__))->typed.type)
!= error_mark_nodeglobal_trees[TI_ERROR_MARK]
2990 && !DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2990, __FUNCTION__))->decl_common.artificial_flag)
)
2991 {
2992 tree ftype = strip_pointer_or_array_types (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 2992, __FUNCTION__))->typed.type)
);
2993 int subvis = type_visibility (ftype);
2994
2995 if (subvis == VISIBILITY_ANON)
2996 {
2997 if (!in_main_input_context())
2998 {
2999 tree nlt = no_linkage_check (ftype, /*relaxed_p=*/false);
3000 if (nlt)
3001 {
3002 if (same_type_p (TREE_TYPE (t), nlt)comptypes ((((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3002, __FUNCTION__))->typed.type)), (nlt), 0)
)
3003 warning (OPT_Wsubobject_linkage, "\
3004%qT has a field %q#D whose type has no linkage",
3005 type, t);
3006 else
3007 warning (OPT_Wsubobject_linkage, "\
3008%qT has a field %qD whose type depends on the type %qT which has no linkage",
3009 type, t, nlt);
3010 }
3011 else if (cxx_dialect > cxx98
3012 && !decl_anon_ns_mem_p (ftype))
3013 warning (OPT_Wsubobject_linkage, "\
3014%qT has a field %q#D whose type has internal linkage",
3015 type, t);
3016 else // In C++98 this can only happen with unnamed namespaces.
3017 warning (OPT_Wsubobject_linkage, "\
3018%qT has a field %q#D whose type uses the anonymous namespace",
3019 type, t);
3020 }
3021 }
3022 else if (MAYBE_CLASS_TYPE_P (ftype)((((enum tree_code) (ftype)->base.code) == TEMPLATE_TYPE_PARM
|| ((enum tree_code) (ftype)->base.code) == TYPENAME_TYPE
|| ((enum tree_code) (ftype)->base.code) == TYPEOF_TYPE ||
((enum tree_code) (ftype)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| ((enum tree_code) (ftype)->base.code) == DECLTYPE_TYPE
|| ((enum tree_code) (ftype)->base.code) == TRAIT_TYPE ||
((enum tree_code) (ftype)->base.code) == DEPENDENT_OPERATOR_TYPE
) || (((((enum tree_code) (ftype)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (ftype)->base.code)) == UNION_TYPE)
&& ((tree_class_check ((ftype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3022, __FUNCTION__))->type_common.lang_flag_5)))
3023 && vis < VISIBILITY_HIDDEN
3024 && subvis >= VISIBILITY_HIDDEN)
3025 warning (OPT_Wattributes, "\
3026%qT declared with greater visibility than the type of its field %qD",
3027 type, t);
3028 }
3029
3030 binfo = TYPE_BINFO (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3030, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.maxval)
;
3031 for (i = 0; BINFO_BASE_ITERATE (binfo, i, t)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3031, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)->
iterate ((i), &(t)))
; ++i)
3032 {
3033 tree btype = BINFO_TYPE (t)((contains_struct_check (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3033, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3033, __FUNCTION__))->typed.type)
;
3034 int subvis = type_visibility (btype);
3035
3036 if (subvis == VISIBILITY_ANON)
3037 {
3038 if (!in_main_input_context())
3039 {
3040 tree nlt = no_linkage_check (btype, /*relaxed_p=*/false);
3041 if (nlt)
3042 {
3043 if (same_type_p (btype, nlt)comptypes ((btype), (nlt), 0))
3044 warning (OPT_Wsubobject_linkage, "\
3045%qT has a base %qT which has no linkage",
3046 type, btype);
3047 else
3048 warning (OPT_Wsubobject_linkage, "\
3049%qT has a base %qT which depends on the type %qT which has no linkage",
3050 type, btype, nlt);
3051 }
3052 else if (cxx_dialect > cxx98
3053 && !decl_anon_ns_mem_p (btype))
3054 warning (OPT_Wsubobject_linkage, "\
3055%qT has a base %qT which has internal linkage",
3056 type, btype);
3057 else // In C++98 this can only happen with unnamed namespaces.
3058 warning (OPT_Wsubobject_linkage, "\
3059%qT has a base %qT which uses the anonymous namespace",
3060 type, btype);
3061 }
3062 }
3063 else if (vis < VISIBILITY_HIDDEN
3064 && subvis >= VISIBILITY_HIDDEN)
3065 warning (OPT_Wattributes, "\
3066%qT declared with greater visibility than its base %qT",
3067 type, TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3067, __FUNCTION__))->typed.type)
);
3068 }
3069}
3070
3071/* Functions for adjusting the visibility of a tagged type and its nested
3072 types and declarations when it gets a name for linkage purposes from a
3073 typedef. */
3074// FIXME: It is now a DR for such a class type to contain anything
3075// other than C. So at minium most of this can probably be deleted.
3076
3077/* First reset the visibility of all the types. */
3078
3079static void
3080reset_type_linkage_1 (tree type)
3081{
3082 set_linkage_according_to_type (type, TYPE_MAIN_DECL (type)((((contains_struct_check (((tree_class_check ((((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3082, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3082, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3082, __FUNCTION__))->common.chain)))
);
3083 if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3083, __FUNCTION__))->type_common.lang_flag_5))
)
3084 for (tree member = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3084, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; member; member = DECL_CHAIN (member)(((contains_struct_check (((contains_struct_check ((member), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3084, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3084, __FUNCTION__))->common.chain))
)
3085 if (DECL_IMPLICIT_TYPEDEF_P (member)(((enum tree_code) (member)->base.code) == TYPE_DECL &&
((contains_struct_check ((member), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3085, __FUNCTION__))->decl_common.lang_flag_2))
)
3086 reset_type_linkage_1 (TREE_TYPE (member)((contains_struct_check ((member), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3086, __FUNCTION__))->typed.type)
);
3087}
3088
3089/* Then reset the visibility of any static data members or member
3090 functions that use those types. */
3091
3092static void
3093reset_decl_linkage (tree decl)
3094{
3095 if (TREE_PUBLIC (decl)((decl)->base.public_flag))
3096 return;
3097 if (DECL_CLONED_FUNCTION_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3097, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))
)
3098 return;
3099 TREE_PUBLIC (decl)((decl)->base.public_flag) = true;
3100 DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3100, __FUNCTION__))->decl_common.lang_flag_5)
= false;
3101 determine_visibility (decl);
3102 tentative_decl_linkage (decl);
3103}
3104
3105void
3106reset_type_linkage (tree type)
3107{
3108 reset_type_linkage_1 (type);
3109 if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3109, __FUNCTION__))->type_common.lang_flag_5))
)
3110 {
3111 if (tree vt = CLASSTYPE_VTABLES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3111, __FUNCTION__))->type_with_lang_specific.lang_specific
))->vtables)
)
3112 {
3113 tree name = mangle_vtbl_for_type (type);
3114 DECL_NAME (vt)((contains_struct_check ((vt), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3114, __FUNCTION__))->decl_minimal.name)
= name;
3115 SET_DECL_ASSEMBLER_NAME (vt, name)overwrite_decl_assembler_name (vt, name);
3116 reset_decl_linkage (vt);
3117 }
3118 if (!ANON_AGGR_TYPE_P (type)((((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3118, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3118, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
3119 if (tree ti = CLASSTYPE_TYPEINFO_VAR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3119, __FUNCTION__))->type_with_lang_specific.lang_specific
))->typeinfo_var)
)
3120 {
3121 tree name = mangle_typeinfo_for_type (type);
3122 DECL_NAME (ti)((contains_struct_check ((ti), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3122, __FUNCTION__))->decl_minimal.name)
= name;
3123 SET_DECL_ASSEMBLER_NAME (ti, name)overwrite_decl_assembler_name (ti, name);
3124 TREE_TYPE (name)((contains_struct_check ((name), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3124, __FUNCTION__))->typed.type)
= type;
3125 reset_decl_linkage (ti);
3126 }
3127 for (tree m = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3127, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; m; m = DECL_CHAIN (m)(((contains_struct_check (((contains_struct_check ((m), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3127, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3127, __FUNCTION__))->common.chain))
)
3128 {
3129 tree mem = STRIP_TEMPLATE (m)(((enum tree_code) (m)->base.code) == TEMPLATE_DECL ? ((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check ((m), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3129, __FUNCTION__, (TEMPLATE_DECL))))))))->result : m)
;
3130 if (TREE_CODE (mem)((enum tree_code) (mem)->base.code) == VAR_DECL || TREE_CODE (mem)((enum tree_code) (mem)->base.code) == FUNCTION_DECL)
3131 reset_decl_linkage (mem);
3132 else if (DECL_IMPLICIT_TYPEDEF_P (mem)(((enum tree_code) (mem)->base.code) == TYPE_DECL &&
((contains_struct_check ((mem), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3132, __FUNCTION__))->decl_common.lang_flag_2))
)
3133 reset_type_linkage (TREE_TYPE (mem)((contains_struct_check ((mem), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3133, __FUNCTION__))->typed.type)
);
3134 }
3135 }
3136}
3137
3138/* Set up our initial idea of what the linkage of DECL should be. */
3139
3140void
3141tentative_decl_linkage (tree decl)
3142{
3143 if (DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3143, __FUNCTION__))->decl_common.lang_flag_5)
)
3144 /* We've already made a decision as to how this function will
3145 be handled. */;
3146 else if (vague_linkage_p (decl))
3147 {
3148 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3149 && decl_defined_p (decl))
3150 {
3151 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3151, __FUNCTION__))->decl_common.decl_flag_1)
= 1;
3152 DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3152, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
= 1;
3153 note_vague_linkage_fn (decl);
3154 /* A non-template inline function with external linkage will
3155 always be COMDAT. As we must eventually determine the
3156 linkage of all functions, and as that causes writes to
3157 the data mapped in from the PCH file, it's advantageous
3158 to mark the functions at this point. */
3159 if (DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3159, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
3160 && (!DECL_IMPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3160, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1)
3161 || DECL_DEFAULTED_FN (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3161, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3161, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3161, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3161, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3161, __FUNCTION__); &lt->u.fn; })->defaulted_p)
))
3162 {
3163 /* This function must have external linkage, as
3164 otherwise DECL_INTERFACE_KNOWN would have been
3165 set. */
3166 gcc_assert (TREE_PUBLIC (decl))((void)(!(((decl)->base.public_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3166, __FUNCTION__), 0 : 0))
;
3167 comdat_linkage (decl);
3168 DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3168, __FUNCTION__))->decl_common.lang_flag_5)
= 1;
3169 }
3170 }
3171 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
3172 maybe_commonize_var (decl);
3173 }
3174}
3175
3176/* DECL is a FUNCTION_DECL or VAR_DECL. If the object file linkage
3177 for DECL has not already been determined, do so now by setting
3178 DECL_EXTERNAL, DECL_COMDAT and other related flags. Until this
3179 function is called entities with vague linkage whose definitions
3180 are available must have TREE_PUBLIC set.
3181
3182 If this function decides to place DECL in COMDAT, it will set
3183 appropriate flags -- but will not clear DECL_EXTERNAL. It is up to
3184 the caller to decide whether or not to clear DECL_EXTERNAL. Some
3185 callers defer that decision until it is clear that DECL is actually
3186 required. */
3187
3188void
3189import_export_decl (tree decl)
3190{
3191 bool comdat_p;
3192 bool import_p;
3193 tree class_type = NULL_TREE(tree) __null;
3194
3195 if (DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3195, __FUNCTION__))->decl_common.lang_flag_5)
)
3196 return;
3197
3198 /* We cannot determine what linkage to give to an entity with vague
3199 linkage until the end of the file. For example, a virtual table
3200 for a class will be defined if and only if the key method is
3201 defined in this translation unit. */
3202 gcc_assert (at_eof)((void)(!(at_eof) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3202, __FUNCTION__), 0 : 0))
;
3203 /* Object file linkage for explicit instantiations is handled in
3204 mark_decl_instantiated. For static variables in functions with
3205 vague linkage, maybe_commonize_var is used.
3206
3207 Therefore, the only declarations that should be provided to this
3208 function are those with external linkage that are:
3209
3210 * implicit instantiations of function templates
3211
3212 * inline function
3213
3214 * implicit instantiations of static data members of class
3215 templates
3216
3217 * virtual tables
3218
3219 * typeinfo objects
3220
3221 Furthermore, all entities that reach this point must have a
3222 definition available in this translation unit.
3223
3224 The following assertions check these conditions. */
3225 gcc_assert (VAR_OR_FUNCTION_DECL_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL
|| ((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3225, __FUNCTION__), 0 : 0))
;
3226 /* Any code that creates entities with TREE_PUBLIC cleared should
3227 also set DECL_INTERFACE_KNOWN. */
3228 gcc_assert (TREE_PUBLIC (decl))((void)(!(((decl)->base.public_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3228, __FUNCTION__), 0 : 0))
;
3229 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
3230 gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3230, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1) || (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific) &&
(((contains_struct_check ((template_info_decl_check ((decl),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) && !(((contains_struct_check ((decl
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)) || ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3232, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3232, __FUNCTION__), 0 : 0))
3231 || DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3230, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1) || (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific) &&
(((contains_struct_check ((template_info_decl_check ((decl),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) && !(((contains_struct_check ((decl
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)) || ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3232, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3232, __FUNCTION__), 0 : 0))
3232 || DECL_DECLARED_INLINE_P (decl))((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3230, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1) || (((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific) &&
(((contains_struct_check ((template_info_decl_check ((decl),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) && !(((contains_struct_check ((decl
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3231, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)) || ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3232, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3232, __FUNCTION__), 0 : 0))
;
3233 else
3234 gcc_assert (DECL_IMPLICIT_INSTANTIATION (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3234, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1) || ((contains_struct_check (((tree_check
((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3235, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3235, __FUNCTION__))->decl_common.virtual_flag) || ((tree_not_check2
(((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__), 0 : 0))
3235 || DECL_VTABLE_OR_VTT_P (decl)((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3234, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1) || ((contains_struct_check (((tree_check
((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3235, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3235, __FUNCTION__))->decl_common.virtual_flag) || ((tree_not_check2
(((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__), 0 : 0))
3236 || DECL_TINFO_P (decl))((void)(!(((((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3234, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1) || ((contains_struct_check (((tree_check
((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3235, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3235, __FUNCTION__))->decl_common.virtual_flag) || ((tree_not_check2
(((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3236, __FUNCTION__), 0 : 0))
;
3237 /* Check that a definition of DECL is available in this translation
3238 unit. */
3239 gcc_assert (!DECL_REALLY_EXTERN (decl))((void)(!(!(((contains_struct_check ((decl), (TS_DECL_COMMON)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3239, __FUNCTION__))->decl_common.decl_flag_1) &&
(!((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3239, __FUNCTION__))->decl_common.lang_specific) || !(((
contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3239, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3239, __FUNCTION__), 0 : 0))
;
3240
3241 /* Assume that DECL will not have COMDAT linkage. */
3242 comdat_p = false;
3243 /* Assume that DECL will not be imported into this translation
3244 unit. */
3245 import_p = false;
3246
3247 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_VTABLE_OR_VTT_P (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3247, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3247, __FUNCTION__))->decl_common.virtual_flag)
)
3248 {
3249 class_type = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3249, __FUNCTION__))->decl_minimal.context)
;
3250 import_export_class (class_type);
3251 if (CLASSTYPE_INTERFACE_KNOWN (class_type)((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3251, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_unknown == 0)
3252 && CLASSTYPE_INTERFACE_ONLY (class_type)((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3252, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_only)
)
3253 import_p = true;
3254 else if ((!flag_weakglobal_options.x_flag_weak || TARGET_WEAK_NOT_IN_ARCHIVE_TOC0)
3255 && !CLASSTYPE_USE_TEMPLATE (class_type)((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3255, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
3256 && CLASSTYPE_KEY_METHOD (class_type)((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3256, __FUNCTION__))->type_with_lang_specific.lang_specific
))->key_method)
3257 && !DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))((tree_check ((((((tree_class_check ((class_type), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3257, __FUNCTION__))->type_with_lang_specific.lang_specific
))->key_method)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3257, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
)
3258 /* The ABI requires that all virtual tables be emitted with
3259 COMDAT linkage. However, on systems where COMDAT symbols
3260 don't show up in the table of contents for a static
3261 archive, or on systems without weak symbols (where we
3262 approximate COMDAT linkage by using internal linkage), the
3263 linker will report errors about undefined symbols because
3264 it will not see the virtual table definition. Therefore,
3265 in the case that we know that the virtual table will be
3266 emitted in only one translation unit, we make the virtual
3267 table an ordinary definition with external linkage. */
3268 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3268, __FUNCTION__))->decl_common.decl_flag_1)
= 0;
3269 else if (CLASSTYPE_INTERFACE_KNOWN (class_type)((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3269, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_unknown == 0)
)
3270 {
3271 /* CLASS_TYPE is being exported from this translation unit,
3272 so DECL should be defined here. */
3273 if (!flag_weakglobal_options.x_flag_weak && CLASSTYPE_EXPLICIT_INSTANTIATION (class_type)(((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3273, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 3)
)
3274 /* If a class is declared in a header with the "extern
3275 template" extension, then it will not be instantiated,
3276 even in translation units that would normally require
3277 it. Often such classes are explicitly instantiated in
3278 one translation unit. Therefore, the explicit
3279 instantiation must be made visible to other translation
3280 units. */
3281 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3281, __FUNCTION__))->decl_common.decl_flag_1)
= 0;
3282 else
3283 {
3284 /* The generic C++ ABI says that class data is always
3285 COMDAT, even if there is a key function. Some
3286 variants (e.g., the ARM EABI) says that class data
3287 only has COMDAT linkage if the class data might be
3288 emitted in more than one translation unit. When the
3289 key method can be inline and is inline, we still have
3290 to arrange for comdat even though
3291 class_data_always_comdat is false. */
3292 if (!CLASSTYPE_KEY_METHOD (class_type)((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3292, __FUNCTION__))->type_with_lang_specific.lang_specific
))->key_method)
3293 || DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (class_type))((tree_check ((((((tree_class_check ((class_type), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3293, __FUNCTION__))->type_with_lang_specific.lang_specific
))->key_method)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3293, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
3294 || targetm.cxx.class_data_always_comdat ())
3295 {
3296 /* The ABI requires COMDAT linkage. Normally, we
3297 only emit COMDAT things when they are needed;
3298 make sure that we realize that this entity is
3299 indeed needed. */
3300 comdat_p = true;
3301 mark_needed (decl);
3302 }
3303 }
3304 }
3305 else if (!flag_implicit_templatesglobal_options.x_flag_implicit_templates
3306 && CLASSTYPE_IMPLICIT_INSTANTIATION (class_type)(((((tree_class_check ((class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3306, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 1)
)
3307 import_p = true;
3308 else
3309 comdat_p = true;
3310 }
3311 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && DECL_TINFO_P (decl)((tree_not_check2 (((tree_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3311, __FUNCTION__, (VAR_DECL), (TYPE_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3311, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_4)
)
3312 {
3313 tree type = TREE_TYPE (DECL_NAME (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3313, __FUNCTION__))->decl_minimal.name)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3313, __FUNCTION__))->typed.type)
;
3314 if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3314, __FUNCTION__))->type_common.lang_flag_5))
)
3315 {
3316 class_type = type;
Value stored to 'class_type' is never read
3317 import_export_class (type);
3318 if (CLASSTYPE_INTERFACE_KNOWN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3318, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_unknown == 0)
3319 && TYPE_POLYMORPHIC_P (type)(((tree_not_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3319, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2))
3320 && CLASSTYPE_INTERFACE_ONLY (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3320, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_only)
3321 /* If -fno-rtti was specified, then we cannot be sure
3322 that RTTI information will be emitted with the
3323 virtual table of the class, so we must emit it
3324 wherever it is used. */
3325 && flag_rttiglobal_options.x_flag_rtti)
3326 import_p = true;
3327 else
3328 {
3329 if (CLASSTYPE_INTERFACE_KNOWN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3329, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_unknown == 0)
3330 && !CLASSTYPE_INTERFACE_ONLY (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3330, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_only)
)
3331 {
3332 comdat_p = (targetm.cxx.class_data_always_comdat ()
3333 || (CLASSTYPE_KEY_METHOD (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3333, __FUNCTION__))->type_with_lang_specific.lang_specific
))->key_method)
3334 && DECL_DECLARED_INLINE_P (CLASSTYPE_KEY_METHOD (type))((tree_check ((((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3334, __FUNCTION__))->type_with_lang_specific.lang_specific
))->key_method)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3334, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
));
3335 mark_needed (decl);
3336 if (!flag_weakglobal_options.x_flag_weak)
3337 {
3338 comdat_p = false;
3339 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3339, __FUNCTION__))->decl_common.decl_flag_1)
= 0;
3340 }
3341 }
3342 else
3343 comdat_p = true;
3344 }
3345 }
3346 else
3347 comdat_p = true;
3348 }
3349 else if (DECL_TEMPLOID_INSTANTIATION (decl)(((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3349, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) & 1) || (((contains_struct_check ((decl), (
TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3349, __FUNCTION__))->decl_common.lang_specific) &&
(((contains_struct_check ((template_info_decl_check ((decl),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3349, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3349, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) && !(((contains_struct_check ((decl
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3349, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)))
)
3350 {
3351 /* DECL is an implicit instantiation of a function or static
3352 data member. */
3353 if (flag_implicit_templatesglobal_options.x_flag_implicit_templates
3354 || (flag_implicit_inline_templatesglobal_options.x_flag_implicit_inline_templates
3355 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL
3356 && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3356, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
))
3357 comdat_p = true;
3358 else
3359 /* If we are not implicitly generating templates, then mark
3360 this entity as undefined in this translation unit. */
3361 import_p = true;
3362 }
3363 else if (DECL_FUNCTION_MEMBER_P (decl)((((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3363, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
) || (__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3363, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3363, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3363, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3363, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3363, __FUNCTION__); &lt->u.fn; })->static_function
))
)
3364 {
3365 if (!DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3365, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
)
3366 {
3367 tree ctype = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3367, __FUNCTION__))->decl_minimal.context)
;
3368 import_export_class (ctype);
3369 if (CLASSTYPE_INTERFACE_KNOWN (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3369, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_unknown == 0)
)
3370 {
3371 DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3371, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
3372 = ! (CLASSTYPE_INTERFACE_ONLY (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3372, __FUNCTION__))->type_with_lang_specific.lang_specific
))->interface_only)
3373 || (DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3373, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
3374 && ! flag_implement_inlinesglobal_options.x_flag_implement_inlines
3375 && !DECL_VINDEX (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3375, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex
)
));
3376
3377 if (!DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3377, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
)
3378 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3378, __FUNCTION__))->decl_common.decl_flag_1)
= 1;
3379
3380 /* Always make artificials weak. */
3381 if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3381, __FUNCTION__))->decl_common.artificial_flag)
&& flag_weakglobal_options.x_flag_weak)
3382 comdat_p = true;
3383 else
3384 maybe_make_one_only (decl);
3385 }
3386 }
3387 else
3388 comdat_p = true;
3389 }
3390 else
3391 comdat_p = true;
3392
3393 if (import_p)
3394 {
3395 /* If we are importing DECL into this translation unit, mark is
3396 an undefined here. */
3397 DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3397, __FUNCTION__))->decl_common.decl_flag_1)
= 1;
3398 DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3398, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
= 0;
3399 }
3400 else if (comdat_p)
3401 {
3402 /* If we decided to put DECL in COMDAT, mark it accordingly at
3403 this point. */
3404 comdat_linkage (decl);
3405 }
3406
3407 DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3407, __FUNCTION__))->decl_common.lang_flag_5)
= 1;
3408}
3409
3410/* Return an expression that performs the destruction of DECL, which
3411 must be a VAR_DECL whose type has a non-trivial destructor, or is
3412 an array whose (innermost) elements have a non-trivial destructor. */
3413
3414tree
3415build_cleanup (tree decl)
3416{
3417 tree clean = cxx_maybe_build_cleanup (decl, tf_warning_or_error);
3418 gcc_assert (clean != NULL_TREE)((void)(!(clean != (tree) __null) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3418, __FUNCTION__), 0 : 0))
;
3419 return clean;
3420}
3421
3422/* GUARD is a helper variable for DECL; make them have the same linkage and
3423 visibility. */
3424
3425void
3426copy_linkage (tree guard, tree decl)
3427{
3428 TREE_PUBLIC (guard)((guard)->base.public_flag) = TREE_PUBLIC (decl)((decl)->base.public_flag);
3429 TREE_STATIC (guard)((guard)->base.static_flag) = TREE_STATIC (decl)((decl)->base.static_flag);
3430 DECL_COMMON (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3430, __FUNCTION__))->decl_with_vis.common_flag)
= DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3430, __FUNCTION__))->decl_with_vis.common_flag)
;
3431 DECL_COMDAT (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3431, __FUNCTION__))->decl_with_vis.comdat_flag)
= DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3431, __FUNCTION__))->decl_with_vis.comdat_flag)
;
3432 if (TREE_STATIC (guard)((guard)->base.static_flag))
3433 {
3434 CP_DECL_THREAD_LOCAL_P (guard)(((tree_not_check2 (((tree_check ((guard), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3434, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3434, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
= CP_DECL_THREAD_LOCAL_P (decl)(((tree_not_check2 (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3434, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3434, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
;
3435 set_decl_tls_model (guard, DECL_TLS_MODEL (decl)decl_tls_model (decl));
3436 if (DECL_ONE_ONLY (decl)(decl_comdat_group (decl) != (tree) __null && (((decl
)->base.public_flag) || ((contains_struct_check ((decl), (
TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3436, __FUNCTION__))->decl_common.decl_flag_1)))
)
3437 make_decl_one_only (guard, cxx_comdat_group (guard));
3438 if (TREE_PUBLIC (decl)((decl)->base.public_flag))
3439 DECL_WEAK (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3439, __FUNCTION__))->decl_with_vis.weak_flag)
= DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3439, __FUNCTION__))->decl_with_vis.weak_flag)
;
3440 /* Also check vague_linkage_p, as DECL_WEAK and DECL_ONE_ONLY might not
3441 be set until import_export_decl at EOF. */
3442 if (vague_linkage_p (decl))
3443 comdat_linkage (guard);
3444 DECL_VISIBILITY (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3444, __FUNCTION__))->decl_with_vis.visibility)
= DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3444, __FUNCTION__))->decl_with_vis.visibility)
;
3445 DECL_VISIBILITY_SPECIFIED (guard)((contains_struct_check ((guard), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3445, __FUNCTION__))->decl_with_vis.visibility_specified
)
= DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3445, __FUNCTION__))->decl_with_vis.visibility_specified
)
;
3446 }
3447}
3448
3449/* Returns the initialization guard variable for the variable DECL,
3450 which has static storage duration. */
3451
3452tree
3453get_guard (tree decl)
3454{
3455 tree sname = mangle_guard_variable (decl);
3456 tree guard = get_global_binding (sname);
3457 if (! guard)
3458 {
3459 tree guard_type;
3460
3461 /* We use a type that is big enough to contain a mutex as well
3462 as an integer counter. */
3463 guard_type = targetm.cxx.guard_type ();
3464 guard = build_decl (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3464, __FUNCTION__))->decl_minimal.locus)
,
3465 VAR_DECL, sname, guard_type);
3466
3467 /* The guard should have the same linkage as what it guards. */
3468 copy_linkage (guard, decl);
3469
3470 DECL_ARTIFICIAL (guard)((contains_struct_check ((guard), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3470, __FUNCTION__))->decl_common.artificial_flag)
= 1;
3471 DECL_IGNORED_P (guard)((contains_struct_check ((guard), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3471, __FUNCTION__))->decl_common.ignored_flag)
= 1;
3472 TREE_USED (guard)((guard)->base.used_flag) = 1;
3473 pushdecl_top_level_and_finish (guard, NULL_TREE(tree) __null);
3474 }
3475 return guard;
3476}
3477
3478/* Returns true if accessing the GUARD atomic is expensive,
3479 i.e. involves a call to __sync_synchronize or similar.
3480 In this case let __cxa_guard_acquire handle the atomics. */
3481
3482static bool
3483is_atomic_expensive_p (machine_mode mode)
3484{
3485 if (!flag_inline_atomicsglobal_options.x_flag_inline_atomics)
3486 return true;
3487
3488 if (!can_compare_and_swap_p (mode, false) || !can_atomic_load_p (mode))
3489 return true;
3490
3491 return false;
3492}
3493
3494/* Return an atomic load of src with the appropriate memory model. */
3495
3496static tree
3497build_atomic_load_type (tree src, HOST_WIDE_INTlong model, tree type)
3498{
3499 tree ptr_type = build_pointer_type (type);
3500 tree mem_model = build_int_cst (integer_type_nodeinteger_types[itk_int], model);
3501 tree t, addr, val;
3502 unsigned int size;
3503 int fncode;
3504
3505 size = tree_to_uhwi (TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3505, __FUNCTION__))->type_common.size_unit)
);
3506
3507 fncode = BUILT_IN_ATOMIC_LOAD_N + exact_log2 (size) + 1;
3508 t = builtin_decl_implicit ((enum built_in_function) fncode);
3509
3510 addr = build1 (ADDR_EXPR, ptr_type, src);
3511 val = build_call_expr (t, 2, addr, mem_model);
3512 return val;
3513}
3514
3515/* Return those bits of the GUARD variable that should be set when the
3516 guarded entity is actually initialized. */
3517
3518static tree
3519get_guard_bits (tree guard)
3520{
3521 if (!targetm.cxx.guard_mask_bit ())
3522 {
3523 /* We only set the first byte of the guard, in order to leave room
3524 for a mutex in the high-order bits. */
3525 guard = build1 (ADDR_EXPR,
3526 build_pointer_type (TREE_TYPE (guard)((contains_struct_check ((guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3526, __FUNCTION__))->typed.type)
),
3527 guard);
3528 guard = build1 (NOP_EXPR,
3529 build_pointer_type (char_type_nodeinteger_types[itk_char]),
3530 guard);
3531 guard = build1 (INDIRECT_REF, char_type_nodeinteger_types[itk_char], guard);
3532 }
3533
3534 return guard;
3535}
3536
3537/* Return an expression which determines whether or not the GUARD
3538 variable has already been initialized. */
3539
3540tree
3541get_guard_cond (tree guard, bool thread_safe)
3542{
3543 tree guard_value;
3544
3545 if (!thread_safe)
3546 guard = get_guard_bits (guard);
3547 else
3548 {
3549 tree type = targetm.cxx.guard_mask_bit ()
3550 ? TREE_TYPE (guard)((contains_struct_check ((guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3550, __FUNCTION__))->typed.type)
: char_type_nodeinteger_types[itk_char];
3551
3552 if (is_atomic_expensive_p (TYPE_MODE (type)((((enum tree_code) ((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3552, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(type) : (type)->type_common.mode)
))
3553 guard = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO];
3554 else
3555 guard = build_atomic_load_type (guard, MEMMODEL_ACQUIRE, type);
3556 }
3557
3558 /* Mask off all but the low bit. */
3559 if (targetm.cxx.guard_mask_bit ())
3560 {
3561 guard_value = integer_one_nodeglobal_trees[TI_INTEGER_ONE];
3562 if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))comptypes ((((contains_struct_check ((guard_value), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3562, __FUNCTION__))->typed.type)), (((contains_struct_check
((guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3562, __FUNCTION__))->typed.type)), 0)
)
3563 guard_value = fold_convert (TREE_TYPE (guard), guard_value)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3563, __FUNCTION__))->typed.type), guard_value)
;
3564 guard = cp_build_binary_op (input_location,
3565 BIT_AND_EXPR, guard, guard_value,
3566 tf_warning_or_error);
3567 }
3568
3569 guard_value = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO];
3570 if (!same_type_p (TREE_TYPE (guard_value), TREE_TYPE (guard))comptypes ((((contains_struct_check ((guard_value), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3570, __FUNCTION__))->typed.type)), (((contains_struct_check
((guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3570, __FUNCTION__))->typed.type)), 0)
)
3571 guard_value = fold_convert (TREE_TYPE (guard), guard_value)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3571, __FUNCTION__))->typed.type), guard_value)
;
3572 return cp_build_binary_op (input_location,
3573 EQ_EXPR, guard, guard_value,
3574 tf_warning_or_error);
3575}
3576
3577/* Return an expression which sets the GUARD variable, indicating that
3578 the variable being guarded has been initialized. */
3579
3580tree
3581set_guard (tree guard)
3582{
3583 tree guard_init;
3584
3585 /* Set the GUARD to one. */
3586 guard = get_guard_bits (guard);
3587 guard_init = integer_one_nodeglobal_trees[TI_INTEGER_ONE];
3588 if (!same_type_p (TREE_TYPE (guard_init), TREE_TYPE (guard))comptypes ((((contains_struct_check ((guard_init), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3588, __FUNCTION__))->typed.type)), (((contains_struct_check
((guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3588, __FUNCTION__))->typed.type)), 0)
)
3589 guard_init = fold_convert (TREE_TYPE (guard), guard_init)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(guard), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3589, __FUNCTION__))->typed.type), guard_init)
;
3590 return cp_build_modify_expr (input_location, guard, NOP_EXPR, guard_init,
3591 tf_warning_or_error);
3592}
3593
3594/* Returns true iff we can tell that VAR does not have a dynamic
3595 initializer. */
3596
3597static bool
3598var_defined_without_dynamic_init (tree var)
3599{
3600 /* constinit vars are guaranteed to not have dynamic initializer,
3601 but still registering the destructor counts as dynamic initialization. */
3602 if (DECL_DECLARED_CONSTINIT_P (var)(((contains_struct_check (((tree_check ((var), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3602, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3602, __FUNCTION__))->decl_common.lang_flag_7))
3603 && COMPLETE_TYPE_P (TREE_TYPE (var))(((tree_class_check ((((contains_struct_check ((var), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3603, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3603, __FUNCTION__))->type_common.size) != (tree) __null
)
3604 && !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (var))(((tree_class_check ((((contains_struct_check ((var), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3604, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3604, __FUNCTION__))->type_common.lang_flag_4))
)
3605 return true;
3606 /* If it's defined in another TU, we can't tell. */
3607 if (DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3607, __FUNCTION__))->decl_common.decl_flag_1)
)
3608 return false;
3609 /* If it has a non-trivial destructor, registering the destructor
3610 counts as dynamic initialization. */
3611 if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (var))(((tree_class_check ((((contains_struct_check ((var), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3611, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3611, __FUNCTION__))->type_common.lang_flag_4))
)
3612 return false;
3613 /* If it's in this TU, its initializer has been processed, unless
3614 it's a case of self-initialization, then DECL_INITIALIZED_P is
3615 false while the initializer is handled by finish_id_expression. */
3616 if (!DECL_INITIALIZED_P (var)(((tree_not_check2 (((tree_check ((var), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3616, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3616, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1))
)
3617 return false;
3618 /* If it has no initializer or a constant one, it's not dynamic. */
3619 return (!DECL_NONTRIVIALLY_INITIALIZED_P (var)(((tree_not_check2 (((tree_check ((var), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3619, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3619, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_6))
3620 || DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (var)(((tree_not_check2 (((tree_check ((var), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3620, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3620, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2))
);
3621}
3622
3623/* Returns true iff VAR is a variable that needs uses to be
3624 wrapped for possible dynamic initialization. */
3625
3626bool
3627var_needs_tls_wrapper (tree var)
3628{
3629 return (!error_operand_p (var)
3630 && CP_DECL_THREAD_LOCAL_P (var)(((tree_not_check2 (((tree_check ((var), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3630, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3630, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
3631 && !DECL_GNU_TLS_P (var)(((contains_struct_check (((tree_check ((var), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3631, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3631, __FUNCTION__))->decl_common.lang_specific) &&
((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3631, __FUNCTION__))->decl_common.lang_specific)->u.base
.friend_or_tls)
3632 && !DECL_FUNCTION_SCOPE_P (var)(((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3632, __FUNCTION__))->decl_minimal.context) && (
(enum tree_code) (((contains_struct_check ((var), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3632, __FUNCTION__))->decl_minimal.context))->base.code
) == FUNCTION_DECL)
3633 && !var_defined_without_dynamic_init (var));
3634}
3635
3636/* Get the FUNCTION_DECL for the shared TLS init function for this
3637 translation unit. */
3638
3639static tree
3640get_local_tls_init_fn (location_t loc)
3641{
3642 tree sname = get_identifier ("__tls_init")(__builtin_constant_p ("__tls_init") ? get_identifier_with_length
(("__tls_init"), strlen ("__tls_init")) : get_identifier ("__tls_init"
))
;
3643 tree fn = get_global_binding (sname);
3644 if (!fn)
3645 {
3646 fn = build_lang_decl_loc (loc, FUNCTION_DECL, sname,
3647 build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE],
3648 void_list_nodeglobal_trees[TI_VOID_LIST_NODE]));
3649 SET_DECL_LANGUAGE (fn, lang_c)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3649, __FUNCTION__))->decl_common.lang_specific)->u.base
.language = (lang_c))
;
3650 TREE_PUBLIC (fn)((fn)->base.public_flag) = false;
3651 DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3651, __FUNCTION__))->decl_common.artificial_flag)
= true;
3652 mark_used (fn);
3653 set_global_binding (fn);
3654 }
3655 return fn;
3656}
3657
3658/* Get a FUNCTION_DECL for the init function for the thread_local
3659 variable VAR. The init function will be an alias to the function
3660 that initializes all the non-local TLS variables in the translation
3661 unit. The init function is only used by the wrapper function. */
3662
3663static tree
3664get_tls_init_fn (tree var)
3665{
3666 /* Only C++11 TLS vars need this init fn. */
3667 if (!var_needs_tls_wrapper (var))
3668 return NULL_TREE(tree) __null;
3669
3670 /* If -fno-extern-tls-init, assume that we don't need to call
3671 a tls init function for a variable defined in another TU. */
3672 if (!flag_extern_tls_initglobal_options.x_flag_extern_tls_init && DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3672, __FUNCTION__))->decl_common.decl_flag_1)
)
3673 return NULL_TREE(tree) __null;
3674
3675 /* If the variable is internal, or if we can't generate aliases,
3676 call the local init function directly. */
3677 if (!TREE_PUBLIC (var)((var)->base.public_flag) || !TARGET_SUPPORTS_ALIASES1)
3678 return get_local_tls_init_fn (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3678, __FUNCTION__))->decl_minimal.locus)
);
3679
3680 tree sname = mangle_tls_init_fn (var);
3681 tree fn = get_global_binding (sname);
3682 if (!fn)
3683 {
3684 fn = build_lang_decl (FUNCTION_DECL, sname,
3685 build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE],
3686 void_list_nodeglobal_trees[TI_VOID_LIST_NODE]));
3687 SET_DECL_LANGUAGE (fn, lang_c)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3687, __FUNCTION__))->decl_common.lang_specific)->u.base
.language = (lang_c))
;
3688 TREE_PUBLIC (fn)((fn)->base.public_flag) = TREE_PUBLIC (var)((var)->base.public_flag);
3689 DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3689, __FUNCTION__))->decl_common.artificial_flag)
= true;
3690 DECL_COMDAT (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3690, __FUNCTION__))->decl_with_vis.comdat_flag)
= DECL_COMDAT (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3690, __FUNCTION__))->decl_with_vis.comdat_flag)
;
3691 DECL_EXTERNAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3691, __FUNCTION__))->decl_common.decl_flag_1)
= DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3691, __FUNCTION__))->decl_common.decl_flag_1)
;
3692 if (DECL_ONE_ONLY (var)(decl_comdat_group (var) != (tree) __null && (((var)->
base.public_flag) || ((contains_struct_check ((var), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3692, __FUNCTION__))->decl_common.decl_flag_1)))
)
3693 make_decl_one_only (fn, cxx_comdat_group (fn));
3694 if (TREE_PUBLIC (var)((var)->base.public_flag))
3695 {
3696 tree obtype = strip_array_types (non_reference (TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3696, __FUNCTION__))->typed.type)
));
3697 /* If the variable is defined somewhere else and might have static
3698 initialization, make the init function a weak reference. */
3699 if ((!TYPE_NEEDS_CONSTRUCTING (obtype)((tree_class_check ((obtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3699, __FUNCTION__))->type_common.needs_constructing_flag
)
3700 || TYPE_HAS_CONSTEXPR_CTOR (obtype)((((tree_class_check ((obtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3700, __FUNCTION__))->type_with_lang_specific.lang_specific
))->has_constexpr_ctor)
3701 || TYPE_HAS_TRIVIAL_DFLT (obtype)(((((tree_class_check ((obtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3701, __FUNCTION__))->type_with_lang_specific.lang_specific
))->has_default_ctor) && ! ((((tree_class_check ((
obtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3701, __FUNCTION__))->type_with_lang_specific.lang_specific
))->has_complex_dflt))
)
3702 && TYPE_HAS_TRIVIAL_DESTRUCTOR (obtype)(!(((tree_class_check ((obtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3702, __FUNCTION__))->type_common.lang_flag_4)))
3703 && DECL_EXTERNAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3703, __FUNCTION__))->decl_common.decl_flag_1)
)
3704 declare_weak (fn);
3705 else
3706 DECL_WEAK (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3706, __FUNCTION__))->decl_with_vis.weak_flag)
= DECL_WEAK (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3706, __FUNCTION__))->decl_with_vis.weak_flag)
;
3707 }
3708 DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3708, __FUNCTION__))->decl_with_vis.visibility)
= DECL_VISIBILITY (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3708, __FUNCTION__))->decl_with_vis.visibility)
;
3709 DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3709, __FUNCTION__))->decl_with_vis.visibility_specified
)
= DECL_VISIBILITY_SPECIFIED (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3709, __FUNCTION__))->decl_with_vis.visibility_specified
)
;
3710 DECL_DLLIMPORT_P (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3710, __FUNCTION__))->decl_with_vis.dllimport_flag)
= DECL_DLLIMPORT_P (var)((contains_struct_check ((var), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3710, __FUNCTION__))->decl_with_vis.dllimport_flag)
;
3711 DECL_IGNORED_P (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3711, __FUNCTION__))->decl_common.ignored_flag)
= 1;
3712 mark_used (fn);
3713
3714 DECL_BEFRIENDING_CLASSES (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3714, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3714, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3714, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3714, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3714, __FUNCTION__); &lt->u.fn; })->befriending_classes
)
= var;
3715
3716 set_global_binding (fn);
3717 }
3718 return fn;
3719}
3720
3721/* Get a FUNCTION_DECL for the init wrapper function for the thread_local
3722 variable VAR. The wrapper function calls the init function (if any) for
3723 VAR and then returns a reference to VAR. The wrapper function is used
3724 in place of VAR everywhere VAR is mentioned. */
3725
3726static tree
3727get_tls_wrapper_fn (tree var)
3728{
3729 /* Only C++11 TLS vars need this wrapper fn. */
3730 if (!var_needs_tls_wrapper (var))
3731 return NULL_TREE(tree) __null;
3732
3733 tree sname = mangle_tls_wrapper_fn (var);
3734 tree fn = get_global_binding (sname);
3735 if (!fn)
3736 {
3737 /* A named rvalue reference is an lvalue, so the wrapper should
3738 always return an lvalue reference. */
3739 tree type = non_reference (TREE_TYPE (var)((contains_struct_check ((var), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3739, __FUNCTION__))->typed.type)
);
3740 type = build_reference_type (type);
3741 tree fntype = build_function_type (type, void_list_nodeglobal_trees[TI_VOID_LIST_NODE]);
3742
3743 fn = build_lang_decl_loc (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3743, __FUNCTION__))->decl_minimal.locus)
,
3744 FUNCTION_DECL, sname, fntype);
3745 SET_DECL_LANGUAGE (fn, lang_c)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3745, __FUNCTION__))->decl_common.lang_specific)->u.base
.language = (lang_c))
;
3746 TREE_PUBLIC (fn)((fn)->base.public_flag) = TREE_PUBLIC (var)((var)->base.public_flag);
3747 DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3747, __FUNCTION__))->decl_common.artificial_flag)
= true;
3748 DECL_IGNORED_P (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3748, __FUNCTION__))->decl_common.ignored_flag)
= 1;
3749 /* The wrapper is inline and emitted everywhere var is used. */
3750 DECL_DECLARED_INLINE_P (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3750, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
= true;
3751 if (TREE_PUBLIC (var)((var)->base.public_flag))
3752 {
3753 comdat_linkage (fn);
3754#ifdef HAVE_GAS_HIDDEN1
3755 /* Make the wrapper bind locally; there's no reason to share
3756 the wrapper between multiple shared objects. */
3757 DECL_VISIBILITY (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3757, __FUNCTION__))->decl_with_vis.visibility)
= VISIBILITY_INTERNAL;
3758 DECL_VISIBILITY_SPECIFIED (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3758, __FUNCTION__))->decl_with_vis.visibility_specified
)
= true;
3759#endif
3760 }
3761 if (!TREE_PUBLIC (fn)((fn)->base.public_flag))
3762 DECL_INTERFACE_KNOWN (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3762, __FUNCTION__))->decl_common.lang_flag_5)
= true;
3763 mark_used (fn);
3764 note_vague_linkage_fn (fn);
3765
3766#if 0
3767 /* We want CSE to commonize calls to the wrapper, but marking it as
3768 pure is unsafe since it has side-effects. I guess we need a new
3769 ECF flag even weaker than ECF_PURE. FIXME! */
3770 DECL_PURE_P (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3770, __FUNCTION__, (FUNCTION_DECL)))->function_decl.pure_flag
)
= true;
3771#endif
3772
3773 DECL_BEFRIENDING_CLASSES (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3773, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3773, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3773, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3773, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3773, __FUNCTION__); &lt->u.fn; })->befriending_classes
)
= var;
3774
3775 set_global_binding (fn);
3776 }
3777 return fn;
3778}
3779
3780/* If EXPR is a thread_local variable that should be wrapped by init
3781 wrapper function, return a call to that function, otherwise return
3782 NULL. */
3783
3784tree
3785maybe_get_tls_wrapper_call (tree expr)
3786{
3787 if (VAR_P (expr)(((enum tree_code) (expr)->base.code) == VAR_DECL)
3788 && !processing_template_declscope_chain->x_processing_template_decl
3789 && !cp_unevaluated_operand
3790 && CP_DECL_THREAD_LOCAL_P (expr)(((tree_not_check2 (((tree_check ((expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3790, __FUNCTION__, (VAR_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3790, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
3791 if (tree wrap = get_tls_wrapper_fn (expr))
3792 return build_cxx_call (wrap, 0, NULL__null, tf_warning_or_error);
3793 return NULL__null;
3794}
3795
3796/* At EOF, generate the definition for the TLS wrapper function FN:
3797
3798 T& var_wrapper() {
3799 if (init_fn) init_fn();
3800 return var;
3801 } */
3802
3803static void
3804generate_tls_wrapper (tree fn)
3805{
3806 tree var = DECL_BEFRIENDING_CLASSES (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3806, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3806, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3806, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3806, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3806, __FUNCTION__); &lt->u.fn; })->befriending_classes
)
;
3807
3808 start_preparsed_function (fn, NULL_TREE(tree) __null, SF_DEFAULT0 | SF_PRE_PARSED1);
3809 tree body = begin_function_body ();
3810 /* Only call the init fn if there might be one. */
3811 if (tree init_fn = get_tls_init_fn (var))
3812 {
3813 tree if_stmt = NULL_TREE(tree) __null;
3814 /* If init_fn is a weakref, make sure it exists before calling. */
3815 if (lookup_attribute ("weak", DECL_ATTRIBUTES (init_fn)((contains_struct_check ((init_fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3815, __FUNCTION__))->decl_common.attributes)
))
3816 {
3817 if_stmt = begin_if_stmt ();
3818 tree addr = cp_build_addr_expr (init_fn, tf_warning_or_error);
3819 tree cond = cp_build_binary_op (DECL_SOURCE_LOCATION (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3819, __FUNCTION__))->decl_minimal.locus)
,
3820 NE_EXPR, addr, nullptr_nodec_global_trees[CTI_NULLPTR],
3821 tf_warning_or_error);
3822 finish_if_stmt_cond (cond, if_stmt);
3823 }
3824 finish_expr_stmt (build_cxx_call
3825 (init_fn, 0, NULL__null, tf_warning_or_error));
3826 if (if_stmt)
3827 {
3828 finish_then_clause (if_stmt);
3829 finish_if_stmt (if_stmt);
3830 }
3831 }
3832 else
3833 /* If there's no initialization, the wrapper is a constant function. */
3834 TREE_READONLY (fn)((non_type_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3834, __FUNCTION__))->base.readonly_flag)
= true;
3835 finish_return_stmt (convert_from_reference (var));
3836 finish_function_body (body);
3837 expand_or_defer_fn (finish_function (/*inline_p=*/false));
3838}
3839
3840/* Start a global constructor or destructor function. */
3841
3842static tree
3843start_objects (bool initp, unsigned priority, bool has_body)
3844{
3845 bool default_init = initp && priority == DEFAULT_INIT_PRIORITY65535;
3846 bool is_module_init = default_init && module_global_init_needed ();
3847 tree name = NULL_TREE(tree) __null;
3848
3849 if (is_module_init)
3850 name = mangle_module_global_init (0);
3851 else
3852 {
3853 char type[14];
3854
3855 /* We use `I' to indicate initialization and `D' to indicate
3856 destruction. */
3857 unsigned len = sprintf (type, "sub_%c", initp ? 'I' : 'D');
3858 if (priority != DEFAULT_INIT_PRIORITY65535)
3859 {
3860 char joiner = '_';
3861#ifdef JOINER'.'
3862 joiner = JOINER'.';
3863#endif
3864 type[len++] = joiner;
3865 sprintf (type + len, "%.5u", priority);
3866 }
3867 name = get_file_function_name (type);
3868 }
3869
3870 tree fntype = build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE], void_list_nodeglobal_trees[TI_VOID_LIST_NODE]);
3871 tree fndecl = build_lang_decl (FUNCTION_DECL, name, fntype);
3872 DECL_CONTEXT (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3872, __FUNCTION__))->decl_minimal.context)
= FROB_CONTEXT (global_namespace)((cp_global_trees[CPTI_GLOBAL]) == cp_global_trees[CPTI_GLOBAL
] ? ((contains_struct_check ((cp_global_trees[CPTI_GLOBAL]), (
TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3872, __FUNCTION__))->decl_minimal.context) : (cp_global_trees
[CPTI_GLOBAL]))
;
3873 if (is_module_init)
3874 {
3875 SET_DECL_ASSEMBLER_NAME (fndecl, name)overwrite_decl_assembler_name (fndecl, name);
3876 TREE_PUBLIC (fndecl)((fndecl)->base.public_flag) = true;
3877 determine_visibility (fndecl);
3878 }
3879 else
3880 TREE_PUBLIC (fndecl)((fndecl)->base.public_flag) = 0;
3881 start_preparsed_function (fndecl, /*attrs=*/NULL_TREE(tree) __null, SF_PRE_PARSED1);
3882
3883 /* Mark as artificial because it's not explicitly in the user's
3884 source code. */
3885 DECL_ARTIFICIAL (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3885, __FUNCTION__))->decl_common.artificial_flag)
= 1;
3886
3887 /* Mark this declaration as used to avoid spurious warnings. */
3888 TREE_USED (current_function_decl)((current_function_decl)->base.used_flag) = 1;
3889
3890 /* Mark this function as a global constructor or destructor. */
3891 if (initp)
3892 DECL_GLOBAL_CTOR_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (current_function_decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((current_function_decl)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3892, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3892, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL
|| (((enum tree_code) (current_function_decl)->base.code)
== TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3892, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3892, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3892, __FUNCTION__); &lt->u.fn; })->global_ctor_p
)
= 1;
3893 else
3894 DECL_GLOBAL_DTOR_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (current_function_decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((current_function_decl)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3894, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3894, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL
|| (((enum tree_code) (current_function_decl)->base.code)
== TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3894, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3894, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3894, __FUNCTION__); &lt->u.fn; })->global_dtor_p
)
= 1;
3895
3896 tree body = begin_compound_stmt (BCS_FN_BODY);
3897
3898 if (is_module_init && has_body)
3899 {
3900 // If the function is going to be empty, don't emit idempotency.
3901 // 'static bool __in_chrg = false;
3902 // if (__inchrg) return;
3903 // __inchrg = true
3904 tree var = build_lang_decl (VAR_DECL, in_charge_identifiercp_global_trees[CPTI_IN_CHARGE_IDENTIFIER],
3905 boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE]);
3906 DECL_CONTEXT (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3906, __FUNCTION__))->decl_minimal.context)
= fndecl;
3907 DECL_ARTIFICIAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3907, __FUNCTION__))->decl_common.artificial_flag)
= true;
3908 TREE_STATIC (var)((var)->base.static_flag) = true;
3909 pushdecl (var);
3910 cp_finish_decl (var, NULL_TREE(tree) __null, false, NULL_TREE(tree) __null, 0);
3911
3912 tree if_stmt = begin_if_stmt ();
3913 finish_if_stmt_cond (var, if_stmt);
3914 finish_return_stmt (NULL_TREE(tree) __null);
3915 finish_then_clause (if_stmt);
3916 finish_if_stmt (if_stmt);
3917
3918 tree assign = build2 (MODIFY_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE],
3919 var, boolean_true_nodeglobal_trees[TI_BOOLEAN_TRUE]);
3920 TREE_SIDE_EFFECTS (assign)((non_type_check ((assign), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3920, __FUNCTION__))->base.side_effects_flag)
= true;
3921 finish_expr_stmt (assign);
3922 }
3923
3924 return body;
3925}
3926
3927/* Finish a global constructor or destructor. Add it to the global
3928 ctors or dtors, if STARTP is true. */
3929
3930static tree
3931finish_objects (bool initp, unsigned priority, tree body, bool startp)
3932{
3933 /* Finish up. */
3934 finish_compound_stmt (body);
3935 tree fn = finish_function (/*inline_p=*/false);
3936
3937 if (!startp)
3938 ; // Neither ctor nor dtor I be.
3939 else if (initp)
3940 {
3941 DECL_STATIC_CONSTRUCTOR (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3941, __FUNCTION__, (FUNCTION_DECL)))->function_decl.static_ctor_flag
)
= 1;
3942 decl_init_priority_insert (fn, priority);
3943 }
3944 else
3945 {
3946 DECL_STATIC_DESTRUCTOR (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3946, __FUNCTION__, (FUNCTION_DECL)))->function_decl.static_dtor_flag
)
= 1;
3947 decl_fini_priority_insert (fn, priority);
3948 }
3949
3950 return fn;
3951}
3952
3953/* The name of the function we create to handle initializations and
3954 destructions for objects with static storage duration. */
3955#define SSDF_IDENTIFIER"__static_initialization_and_destruction" "__static_initialization_and_destruction"
3956
3957/* Begins the generation of the function that will handle all
3958 initialization or destruction of objects with static storage
3959 duration at PRIORITY.
3960
3961 It is assumed that this function will only be called once. */
3962
3963static tree
3964start_partial_init_fini_fn (bool initp, unsigned priority, unsigned count)
3965{
3966 char id[sizeof (SSDF_IDENTIFIER"__static_initialization_and_destruction") + 1 /* '\0' */ + 32];
3967
3968 /* Create the identifier for this function. It will be of the form
3969 SSDF_IDENTIFIER_<number>. */
3970 sprintf (id, "%s_%u", SSDF_IDENTIFIER"__static_initialization_and_destruction", count);
3971
3972 tree type = build_function_type (void_type_nodeglobal_trees[TI_VOID_TYPE], void_list_nodeglobal_trees[TI_VOID_LIST_NODE]);
3973
3974 /* Create the FUNCTION_DECL itself. */
3975 tree fn = build_lang_decl (FUNCTION_DECL, get_identifier (id)(__builtin_constant_p (id) ? get_identifier_with_length ((id)
, strlen (id)) : get_identifier (id))
, type);
3976 TREE_PUBLIC (fn)((fn)->base.public_flag) = 0;
3977 DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 3977, __FUNCTION__))->decl_common.artificial_flag)
= 1;
3978
3979 /* Put this function in the list of functions to be called from the
3980 static constructors and destructors. */
3981 if (!static_init_fini_fns[initp])
3982 static_init_fini_fns[initp] = priority_map_t::create_ggc ();
3983 auto &slot = static_init_fini_fns[initp]->get_or_insert (priority);
3984 slot = tree_cons (fn, NULL_TREE(tree) __null, slot);
3985
3986 /* Put the function in the global scope. */
3987 pushdecl (fn);
3988
3989 /* Start the function itself. This is equivalent to declaring the
3990 function as:
3991
3992 static void __ssdf (int __initialize_p, init __priority_p);
3993
3994 It is static because we only need to call this function from the
3995 various constructor and destructor functions for this module. */
3996 start_preparsed_function (fn, /*attrs=*/NULL_TREE(tree) __null, SF_PRE_PARSED1);
3997
3998 /* Set up the scope of the outermost block in the function. */
3999 return begin_compound_stmt (BCS_FN_BODY);
4000}
4001
4002/* Finish the generation of the function which performs initialization
4003 or destruction of objects with static storage duration. */
4004
4005static void
4006finish_partial_init_fini_fn (tree body)
4007{
4008 /* Close out the function. */
4009 finish_compound_stmt (body);
4010 expand_or_defer_fn (finish_function (/*inline_p=*/false));
4011}
4012
4013/* The effective initialization priority of a DECL. */
4014
4015#define DECL_EFFECTIVE_INIT_PRIORITY(decl)((!((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4015, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p
) || (decl_init_priority_lookup (decl)) == 0) ? 65535 : (decl_init_priority_lookup
(decl)))
\
4016 ((!DECL_HAS_INIT_PRIORITY_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4016, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p
)
|| DECL_INIT_PRIORITY (decl)(decl_init_priority_lookup (decl)) == 0) \
4017 ? DEFAULT_INIT_PRIORITY65535 : DECL_INIT_PRIORITY (decl)(decl_init_priority_lookup (decl)))
4018
4019/* Whether a DECL needs a guard to protect it against multiple
4020 initialization. */
4021
4022#define NEEDS_GUARD_P(decl)(((decl)->base.public_flag) && (((contains_struct_check
((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4022, __FUNCTION__))->decl_with_vis.common_flag) || (decl_comdat_group
(decl) != (tree) __null && (((decl)->base.public_flag
) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4022, __FUNCTION__))->decl_common.decl_flag_1))) || ((contains_struct_check
((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4022, __FUNCTION__))->decl_with_vis.weak_flag)))
(TREE_PUBLIC (decl)((decl)->base.public_flag) && (DECL_COMMON (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4022, __FUNCTION__))->decl_with_vis.common_flag)
\
4023 || DECL_ONE_ONLY (decl)(decl_comdat_group (decl) != (tree) __null && (((decl
)->base.public_flag) || ((contains_struct_check ((decl), (
TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4023, __FUNCTION__))->decl_common.decl_flag_1)))
\
4024 || DECL_WEAK (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4024, __FUNCTION__))->decl_with_vis.weak_flag)
))
4025
4026/* Walks the initializer list of a global variable and looks for
4027 temporary variables (DECL_NAME() == NULL and DECL_ARTIFICIAL != 0)
4028 and that have their DECL_CONTEXT() == NULL. For each such
4029 temporary variable, set their DECL_CONTEXT() to CTX -- the
4030 initializing function. This is necessary because otherwise some
4031 optimizers (enabled by -O2 -fprofile-arcs) might crash when trying
4032 to refer to a temporary variable that does not have its
4033 DECL_CONTEXT() properly set. */
4034
4035static tree
4036fix_temporary_vars_context_r (tree *node,
4037 int * /*unused*/,
4038 void *ctx)
4039{
4040 if (TREE_CODE (*node)((enum tree_code) (*node)->base.code) == BIND_EXPR)
4041 for (tree var = BIND_EXPR_VARS (*node)((*((const_cast<tree*> (tree_operand_check (((tree_check
((*node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4041, __FUNCTION__, (BIND_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4041, __FUNCTION__))))))
; var; var = DECL_CHAIN (var)(((contains_struct_check (((contains_struct_check ((var), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4041, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4041, __FUNCTION__))->common.chain))
)
4042 if (VAR_P (var)(((enum tree_code) (var)->base.code) == VAR_DECL) && !DECL_NAME (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4042, __FUNCTION__))->decl_minimal.name)
4043 && DECL_ARTIFICIAL (var)((contains_struct_check ((var), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4043, __FUNCTION__))->decl_common.artificial_flag)
&& !DECL_CONTEXT (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4043, __FUNCTION__))->decl_minimal.context)
)
4044 DECL_CONTEXT (var)((contains_struct_check ((var), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4044, __FUNCTION__))->decl_minimal.context)
= tree (ctx);
4045
4046 return NULL_TREE(tree) __null;
4047}
4048
4049/* Set up to handle the initialization or destruction of DECL. If
4050 INITP is nonzero, we are initializing the variable. Otherwise, we
4051 are destroying it. */
4052
4053static void
4054one_static_initialization_or_destruction (bool initp, tree decl, tree init)
4055{
4056 /* If we are supposed to destruct and there's a trivial destructor,
4057 nothing has to be done. */
4058 gcc_checking_assert (init || !TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))((void)(!(init || !(!(((tree_class_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4058, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4058, __FUNCTION__))->type_common.lang_flag_4)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4058, __FUNCTION__), 0 : 0))
;
4059
4060 /* Trick the compiler into thinking we are at the file and line
4061 where DECL was declared so that error-messages make sense, and so
4062 that the debugger will show somewhat sensible file and line
4063 information. */
4064 input_location = DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4064, __FUNCTION__))->decl_minimal.locus)
;
4065
4066 /* Make sure temporary variables in the initialiser all have
4067 their DECL_CONTEXT() set to a value different from NULL_TREE.
4068 This can happen when global variables initializers are built.
4069 In that case, the DECL_CONTEXT() of the global variables _AND_ of all
4070 the temporary variables that might have been generated in the
4071 accompanying initializers is NULL_TREE, meaning the variables have been
4072 declared in the global namespace.
4073 What we want to do here is to fix that and make sure the DECL_CONTEXT()
4074 of the temporaries are set to the current function decl. */
4075 cp_walk_tree_without_duplicates (&init,walk_tree_without_duplicates_1 (&init, fix_temporary_vars_context_r
, current_function_decl, cp_walk_subtrees)
4076 fix_temporary_vars_context_r,walk_tree_without_duplicates_1 (&init, fix_temporary_vars_context_r
, current_function_decl, cp_walk_subtrees)
4077 current_function_decl)walk_tree_without_duplicates_1 (&init, fix_temporary_vars_context_r
, current_function_decl, cp_walk_subtrees)
;
4078
4079 /* Because of:
4080
4081 [class.access.spec]
4082
4083 Access control for implicit calls to the constructors,
4084 the conversion functions, or the destructor called to
4085 create and destroy a static data member is performed as
4086 if these calls appeared in the scope of the member's
4087 class.
4088
4089 we pretend we are in a static member function of the class of
4090 which the DECL is a member. */
4091 if (member_p (decl))
4092 {
4093 DECL_CONTEXT (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4093, __FUNCTION__))->decl_minimal.context)
= DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4093, __FUNCTION__))->decl_minimal.context)
;
4094 DECL_STATIC_FUNCTION_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (current_function_decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((current_function_decl)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4094, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4094, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL
|| (((enum tree_code) (current_function_decl)->base.code)
== TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4094, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4094, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4094, __FUNCTION__); &lt->u.fn; })->static_function
)
= 1;
4095 }
4096
4097 /* Assume we don't need a guard. */
4098 tree guard_if_stmt = NULL_TREE(tree) __null;
4099
4100 /* We need a guard if this is an object with external linkage that
4101 might be initialized in more than one place. (For example, a
4102 static data member of a template, when the data member requires
4103 construction.) */
4104 if (NEEDS_GUARD_P (decl)(((decl)->base.public_flag) && (((contains_struct_check
((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4104, __FUNCTION__))->decl_with_vis.common_flag) || (decl_comdat_group
(decl) != (tree) __null && (((decl)->base.public_flag
) || ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4104, __FUNCTION__))->decl_common.decl_flag_1))) || ((contains_struct_check
((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4104, __FUNCTION__))->decl_with_vis.weak_flag)))
)
4105 {
4106 tree guard = get_guard (decl);
4107 tree guard_cond;
4108
4109 if (flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit)
4110 {
4111 /* When using __cxa_atexit, we just check the GUARD as we
4112 would for a local static. We never try to destroy
4113 anything from a static destructor. */
4114 gcc_assert (initp)((void)(!(initp) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4114, __FUNCTION__), 0 : 0))
;
4115 guard_cond = get_guard_cond (guard, false);
4116 }
4117 else
4118 {
4119 /* If we don't have __cxa_atexit, then we will be running
4120 destructors from .fini sections, or their equivalents.
4121 So, we need to know how many times we've tried to
4122 initialize this object. We do initializations only if
4123 the GUARD was or becomes zero (initp vs !initp
4124 respectively). */
4125 guard_cond = cp_build_unary_op (initp ? POSTINCREMENT_EXPR
4126 : PREDECREMENT_EXPR,
4127 guard,
4128 /*noconvert=*/true,
4129 tf_warning_or_error);
4130 guard_cond = cp_build_binary_op (input_location, EQ_EXPR, guard_cond,
4131 integer_zero_nodeglobal_trees[TI_INTEGER_ZERO],
4132 tf_warning_or_error);
4133 }
4134
4135 guard_if_stmt = begin_if_stmt ();
4136 finish_if_stmt_cond (guard_cond, guard_if_stmt);
4137
4138 if (flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit)
4139 /* Set the GUARD now. */
4140 finish_expr_stmt (set_guard (guard));
4141 }
4142
4143 /* Perform the initialization or destruction. */
4144 if (initp)
4145 {
4146 if (init)
4147 {
4148 finish_expr_stmt (init);
4149 if (sanitize_flags_p (SANITIZE_ADDRESS, decl))
4150 if (varpool_node *vnode = varpool_node::get (decl))
4151 vnode->dynamically_initialized = 1;
4152 }
4153
4154 /* If we're using __cxa_atexit, register a function that calls the
4155 destructor for the object. */
4156 if (flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit)
4157 finish_expr_stmt (register_dtor_fn (decl));
4158 }
4159 else
4160 finish_expr_stmt (build_cleanup (decl));
4161
4162 /* Finish the guard if-stmt, if necessary. */
4163 if (guard_if_stmt)
4164 {
4165 finish_then_clause (guard_if_stmt);
4166 finish_if_stmt (guard_if_stmt);
4167 }
4168
4169 /* Now that we're done with DECL we don't need to pretend to be a
4170 member of its class any longer. */
4171 DECL_CONTEXT (current_function_decl)((contains_struct_check ((current_function_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4171, __FUNCTION__))->decl_minimal.context)
= NULL_TREE(tree) __null;
4172 DECL_STATIC_FUNCTION_P (current_function_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (current_function_decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((current_function_decl)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4172, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4172, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (current_function_decl)->base.code) == FUNCTION_DECL
|| (((enum tree_code) (current_function_decl)->base.code)
== TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4172, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((current_function_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4172, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4172, __FUNCTION__); &lt->u.fn; })->static_function
)
= 0;
4173}
4174
4175/* Generate code to do the initialization or destruction of the decls in VARS,
4176 a TREE_LIST of VAR_DECL with static storage duration.
4177 Whether initialization or destruction is performed is specified by INITP. */
4178
4179static void
4180emit_partial_init_fini_fn (bool initp, unsigned priority, tree vars,
4181 unsigned counter, location_t locus)
4182{
4183 input_location = locus;
4184 tree body = start_partial_init_fini_fn (initp, priority, counter);
4185
4186 for (tree node = vars; node; node = TREE_CHAIN (node)((contains_struct_check ((node), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4186, __FUNCTION__))->common.chain)
)
4187 /* Do one initialization or destruction. */
4188 one_static_initialization_or_destruction (initp, TREE_VALUE (node)((tree_check ((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4188, __FUNCTION__, (TREE_LIST)))->list.value)
,
4189 TREE_PURPOSE (node)((tree_check ((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4189, __FUNCTION__, (TREE_LIST)))->list.purpose)
);
4190
4191 /* Finish up the static storage duration function for this
4192 round. */
4193 input_location = locus;
4194 finish_partial_init_fini_fn (body);
4195}
4196
4197/* VARS is a list of variables with static storage duration which may
4198 need initialization and/or finalization. Remove those variables
4199 that don't really need to be initialized or finalized, and return
4200 the resulting list. The order in which the variables appear in
4201 VARS is in reverse order of the order in which they should actually
4202 be initialized. That order is preserved. */
4203
4204static tree
4205prune_vars_needing_no_initialization (tree *vars)
4206{
4207 tree *var = vars;
4208 tree result = NULL_TREE(tree) __null;
4209
4210 while (*var)
4211 {
4212 tree t = *var;
4213 tree decl = TREE_VALUE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4213, __FUNCTION__, (TREE_LIST)))->list.value)
;
4214 tree init = TREE_PURPOSE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4214, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
4215
4216 /* Deal gracefully with error. */
4217 if (error_operand_p (decl))
4218 {
4219 var = &TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4219, __FUNCTION__))->common.chain)
;
4220 continue;
4221 }
4222
4223 /* The only things that can be initialized are variables. */
4224 gcc_assert (VAR_P (decl))((void)(!((((enum tree_code) (decl)->base.code) == VAR_DECL
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4224, __FUNCTION__), 0 : 0))
;
4225
4226 /* If this object is not defined, we don't need to do anything
4227 here. */
4228 if (DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4228, __FUNCTION__))->decl_common.decl_flag_1)
)
4229 {
4230 var = &TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4230, __FUNCTION__))->common.chain)
;
4231 continue;
4232 }
4233
4234 /* Also, if the initializer already contains errors, we can bail
4235 out now. */
4236 if (init && TREE_CODE (init)((enum tree_code) (init)->base.code) == TREE_LIST
4237 && value_member (error_mark_nodeglobal_trees[TI_ERROR_MARK], init))
4238 {
4239 var = &TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4239, __FUNCTION__))->common.chain)
;
4240 continue;
4241 }
4242
4243 /* This variable is going to need initialization and/or
4244 finalization, so we add it to the list. */
4245 *var = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4245, __FUNCTION__))->common.chain)
;
4246 TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4246, __FUNCTION__))->common.chain)
= result;
4247 result = t;
4248 }
4249
4250 return result;
4251}
4252
4253/* Split VAR_LIST by init priority and add into PARTS hash table.
4254 This reverses the variable ordering. */
4255
4256void
4257partition_vars_for_init_fini (tree var_list, priority_map_t *(&parts)[2])
4258{
4259 for (auto node = var_list; node; node = TREE_CHAIN (node)((contains_struct_check ((node), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4259, __FUNCTION__))->common.chain)
)
4260 {
4261 tree decl = TREE_VALUE (node)((tree_check ((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4261, __FUNCTION__, (TREE_LIST)))->list.value)
;
4262 tree init = TREE_PURPOSE (node)((tree_check ((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4262, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
4263 bool has_cleanup = !TYPE_HAS_TRIVIAL_DESTRUCTOR (TREE_TYPE (decl))(!(((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4263, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4263, __FUNCTION__))->type_common.lang_flag_4)))
;
4264 unsigned priority = DECL_EFFECTIVE_INIT_PRIORITY (decl)((!((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4264, __FUNCTION__, (VAR_DECL)))->decl_with_vis.init_priority_p
) || (decl_init_priority_lookup (decl)) == 0) ? 65535 : (decl_init_priority_lookup
(decl)))
;
4265
4266 if (init || (flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit && has_cleanup))
4267 {
4268 // Add to initialization list.
4269 if (!parts[true])
4270 parts[true] = priority_map_t::create_ggc ();
4271 auto &slot = parts[true]->get_or_insert (priority);
4272 slot = tree_cons (init, decl, slot);
4273 }
4274
4275 if (!flag_use_cxa_atexitglobal_options.x_flag_use_cxa_atexit && has_cleanup)
4276 {
4277 // Add to finalization list.
4278 if (!parts[false])
4279 parts[false] = priority_map_t::create_ggc ();
4280 auto &slot = parts[false]->get_or_insert (priority);
4281 slot = tree_cons (NULL_TREE(tree) __null, decl, slot);
4282 }
4283 }
4284}
4285
4286/* Make sure we have told the back end about all the variables in
4287 VARS. */
4288
4289static void
4290write_out_vars (tree vars)
4291{
4292 tree v;
4293
4294 for (v = vars; v; v = TREE_CHAIN (v)((contains_struct_check ((v), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4294, __FUNCTION__))->common.chain)
)
4295 {
4296 tree var = TREE_VALUE (v)((tree_check ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4296, __FUNCTION__, (TREE_LIST)))->list.value)
;
4297 if (!var_finalized_p (var))
4298 {
4299 import_export_decl (var);
4300 rest_of_decl_compilation (var, 1, 1);
4301 }
4302 }
4303}
4304
4305/* Generate a static constructor or destructor that calls the given
4306 init/fini fns at the indicated priority. */
4307
4308static void
4309generate_ctor_or_dtor_function (bool initp, unsigned priority,
4310 tree fns, location_t locus)
4311{
4312 input_location = locus;
4313 tree body = start_objects (initp, priority, bool (fns));
4314
4315 if (fns)
4316 {
4317 /* To make sure dynamic construction doesn't access globals from
4318 other compilation units where they might not be yet
4319 constructed, for -fsanitize=address insert
4320 __asan_before_dynamic_init call that prevents access to
4321 either all global variables that need construction in other
4322 compilation units, or at least those that haven't been
4323 initialized yet. Variables that need dynamic construction in
4324 the current compilation unit are kept accessible. */
4325 if (initp && (flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS))
4326 finish_expr_stmt (asan_dynamic_init_call (/*after_p=*/false));
4327
4328 /* Call the static init/fini functions. */
4329 for (tree node = fns; node; node = TREE_CHAIN (node)((contains_struct_check ((node), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4329, __FUNCTION__))->common.chain)
)
4330 {
4331 tree fn = TREE_PURPOSE (node)((tree_check ((node), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4331, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
4332
4333 // We should never find a pure or constant cdtor.
4334 gcc_checking_assert (!(flags_from_decl_or_type (fn)((void)(!(!(flags_from_decl_or_type (fn) & ((1 << 0
) | (1 << 1)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4335, __FUNCTION__), 0 : 0))
4335 & (ECF_CONST | ECF_PURE)))((void)(!(!(flags_from_decl_or_type (fn) & ((1 << 0
) | (1 << 1)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4335, __FUNCTION__), 0 : 0))
;
4336
4337 tree call = cp_build_function_call_nary (fn, tf_warning_or_error,
4338 NULL_TREE(tree) __null);
4339 finish_expr_stmt (call);
4340 }
4341
4342 /* Revert what __asan_before_dynamic_init did by calling
4343 __asan_after_dynamic_init. */
4344 if (initp && (flag_sanitizeglobal_options.x_flag_sanitize & SANITIZE_ADDRESS))
4345 finish_expr_stmt (asan_dynamic_init_call (/*after_p=*/true));
4346 }
4347
4348 /* Close out the function, and arrange for it to be called at init
4349 or fini time, if non-empty. (Even non-nop module initializer
4350 functions need this, as we cannot guarantee the module is
4351 imported somewhere in the program.) */
4352 expand_or_defer_fn (finish_objects (initp, priority, body, fns != NULL_TREE(tree) __null));
4353}
4354
4355/* Return C++ property of T, based on given operation OP. */
4356
4357static int
4358cpp_check (tree t, cpp_operation op)
4359{
4360 switch (op)
4361 {
4362 case HAS_DEPENDENT_TEMPLATE_ARGS:
4363 {
4364 tree ti = CLASSTYPE_TEMPLATE_INFO (t)(((tree_class_check (((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4364, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4364, __FUNCTION__))->type_non_common.lang_1))
;
4365 if (!ti)
4366 return 0;
4367 ++processing_template_declscope_chain->x_processing_template_decl;
4368 const bool dep = any_dependent_template_arguments_p (TI_ARGS (ti)((struct tree_template_info*)(tree_check ((ti), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4368, __FUNCTION__, (TEMPLATE_INFO))))->args
);
4369 --processing_template_declscope_chain->x_processing_template_decl;
4370 return dep;
4371 }
4372 case IS_ABSTRACT:
4373 return DECL_PURE_VIRTUAL_P (t)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (t)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4373, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t))
, (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4373, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (t)->base.code) == FUNCTION_DECL || (((enum
tree_code) (t)->base.code) == TEMPLATE_DECL && ((
struct tree_template_decl *)(const_cast<union tree_node *>
((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4373, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4373, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4373, __FUNCTION__); &lt->u.fn; })->pure_virtual)
;
4374 case IS_ASSIGNMENT_OPERATOR:
4375 return DECL_ASSIGNMENT_OPERATOR_P (t)(((((tree_not_check2 (((tree_check ((((contains_struct_check (
(t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1))) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4375, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
;
4376 case IS_CONSTRUCTOR:
4377 return DECL_CONSTRUCTOR_P (t)((tree_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4377, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t))
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4377, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
;
4378 case IS_DESTRUCTOR:
4379 return DECL_DESTRUCTOR_P (t)((tree_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4379, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t))
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4379, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)
;
4380 case IS_COPY_CONSTRUCTOR:
4381 return DECL_COPY_CONSTRUCTOR_P (t)(((tree_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4381, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t))
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4381, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) && copy_fn_p (t) > 0)
;
4382 case IS_MOVE_CONSTRUCTOR:
4383 return DECL_MOVE_CONSTRUCTOR_P (t)(((tree_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4383, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t))
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4383, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) && move_fn_p (t))
;
4384 case IS_TEMPLATE:
4385 return TREE_CODE (t)((enum tree_code) (t)->base.code) == TEMPLATE_DECL;
4386 case IS_TRIVIAL:
4387 return trivial_type_p (t);
4388 default:
4389 return 0;
4390 }
4391}
4392
4393/* Collect source file references recursively, starting from NAMESPC. */
4394
4395static void
4396collect_source_refs (tree namespc)
4397{
4398 /* Iterate over names in this name space. */
4399 for (tree t = NAMESPACE_LEVEL (namespc)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((namespc), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4399, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (namespc)->base.code) != NAMESPACE_DECL ||
lt->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4399, __FUNCTION__); &lt->u.ns; })->level)
->names; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4399, __FUNCTION__))->common.chain)
)
4400 if (DECL_IS_UNDECLARED_BUILTIN (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4400, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
)
4401 ;
4402 else if (TREE_CODE (t)((enum tree_code) (t)->base.code) == NAMESPACE_DECL && !DECL_NAMESPACE_ALIAS (t)((contains_struct_check (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4402, __FUNCTION__, (NAMESPACE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4402, __FUNCTION__))->decl_common.abstract_origin)
)
4403 collect_source_refs (t);
4404 else
4405 collect_source_ref (DECL_SOURCE_FILE (t)((expand_location (((contains_struct_check ((t), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4405, __FUNCTION__))->decl_minimal.locus))).file)
);
4406}
4407
4408/* Collect decls relevant to SOURCE_FILE from all namespaces recursively,
4409 starting from NAMESPC. */
4410
4411static void
4412collect_ada_namespace (tree namespc, const char *source_file)
4413{
4414 tree decl = NAMESPACE_LEVEL (namespc)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((namespc), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4414, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (namespc)->base.code) != NAMESPACE_DECL ||
lt->u.base.selector != lds_ns) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4414, __FUNCTION__); &lt->u.ns; })->level)
->names;
4415
4416 /* Collect decls from this namespace. This will skip
4417 NAMESPACE_DECLs (both aliases and regular, it cannot tell). */
4418 collect_ada_nodes (decl, source_file);
4419
4420 /* Now scan for namespace children, and dump them. */
4421 for (; decl; decl = TREE_CHAIN (decl)((contains_struct_check ((decl), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/decl2.cc"
, 4421, __FUNCTION__))->common.chain)
)