File: | build/gcc/cp/class.cc |
Warning: | line 440, column 7 Value stored to 'target_type' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Functions related to building -*- C++ -*- classes and their related objects. |
2 | Copyright (C) 1987-2023 Free Software Foundation, Inc. |
3 | Contributed by Michael Tiemann (tiemann@cygnus.com) |
4 | |
5 | This file is part of GCC. |
6 | |
7 | GCC is free software; you can redistribute it and/or modify |
8 | it under the terms of the GNU General Public License as published by |
9 | the Free Software Foundation; either version 3, or (at your option) |
10 | any later version. |
11 | |
12 | GCC is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | GNU General Public License for more details. |
16 | |
17 | You should have received a copy of the GNU General Public License |
18 | along with GCC; see the file COPYING3. If not see |
19 | <http://www.gnu.org/licenses/>. */ |
20 | |
21 | |
22 | /* High-level class interface. */ |
23 | |
24 | #include "config.h" |
25 | #include "system.h" |
26 | #include "coretypes.h" |
27 | #include "target.h" |
28 | #include "cp-tree.h" |
29 | #include "stringpool.h" |
30 | #include "cgraph.h" |
31 | #include "stor-layout.h" |
32 | #include "attribs.h" |
33 | #include "flags.h" |
34 | #include "toplev.h" |
35 | #include "convert.h" |
36 | #include "dumpfile.h" |
37 | #include "gimplify.h" |
38 | #include "intl.h" |
39 | #include "asan.h" |
40 | |
41 | /* Id for dumping the class hierarchy. */ |
42 | int class_dump_id; |
43 | |
44 | /* The number of nested classes being processed. If we are not in the |
45 | scope of any class, this is zero. */ |
46 | |
47 | int current_class_depth; |
48 | |
49 | /* In order to deal with nested classes, we keep a stack of classes. |
50 | The topmost entry is the innermost class, and is the entry at index |
51 | CURRENT_CLASS_DEPTH */ |
52 | |
53 | typedef struct class_stack_node { |
54 | /* The name of the class. */ |
55 | tree name; |
56 | |
57 | /* The _TYPE node for the class. */ |
58 | tree type; |
59 | |
60 | /* The access specifier pending for new declarations in the scope of |
61 | this class. */ |
62 | tree access; |
63 | |
64 | /* If were defining TYPE, the names used in this class. */ |
65 | splay_tree names_used; |
66 | |
67 | /* Nonzero if this class is no longer open, because of a call to |
68 | push_to_top_level. */ |
69 | size_t hidden; |
70 | }* class_stack_node_t; |
71 | |
72 | struct vtbl_init_data |
73 | { |
74 | /* The base for which we're building initializers. */ |
75 | tree binfo; |
76 | /* The type of the most-derived type. */ |
77 | tree derived; |
78 | /* The binfo for the dynamic type. This will be TYPE_BINFO (derived), |
79 | unless ctor_vtbl_p is true. */ |
80 | tree rtti_binfo; |
81 | /* The negative-index vtable initializers built up so far. These |
82 | are in order from least negative index to most negative index. */ |
83 | vec<constructor_elt, va_gc> *inits; |
84 | /* The binfo for the virtual base for which we're building |
85 | vcall offset initializers. */ |
86 | tree vbase; |
87 | /* The functions in vbase for which we have already provided vcall |
88 | offsets. */ |
89 | vec<tree, va_gc> *fns; |
90 | /* The vtable index of the next vcall or vbase offset. */ |
91 | tree index; |
92 | /* Nonzero if we are building the initializer for the primary |
93 | vtable. */ |
94 | int primary_vtbl_p; |
95 | /* Nonzero if we are building the initializer for a construction |
96 | vtable. */ |
97 | int ctor_vtbl_p; |
98 | /* True when adding vcall offset entries to the vtable. False when |
99 | merely computing the indices. */ |
100 | bool generate_vcall_entries; |
101 | }; |
102 | |
103 | /* The type of a function passed to walk_subobject_offsets. */ |
104 | typedef int (*subobject_offset_fn) (tree, tree, splay_tree); |
105 | |
106 | /* The stack itself. This is a dynamically resized array. The |
107 | number of elements allocated is CURRENT_CLASS_STACK_SIZE. */ |
108 | static int current_class_stack_size; |
109 | static class_stack_node_t current_class_stack; |
110 | |
111 | /* The size of the largest empty class seen in this translation unit. */ |
112 | static GTY (()) tree sizeof_biggest_empty_class; |
113 | |
114 | static tree get_vfield_name (tree); |
115 | static void finish_struct_anon (tree); |
116 | static tree get_vtable_name (tree); |
117 | static void get_basefndecls (tree, tree, vec<tree> *); |
118 | static int build_primary_vtable (tree, tree); |
119 | static int build_secondary_vtable (tree); |
120 | static void finish_vtbls (tree); |
121 | static void modify_vtable_entry (tree, tree, tree, tree, tree *); |
122 | static void finish_struct_bits (tree); |
123 | static int alter_access (tree, tree, tree); |
124 | static void handle_using_decl (tree, tree); |
125 | static tree dfs_modify_vtables (tree, void *); |
126 | static tree modify_all_vtables (tree, tree); |
127 | static void determine_primary_bases (tree); |
128 | static void maybe_warn_about_overly_private_class (tree); |
129 | static void add_implicitly_declared_members (tree, tree*, int, int); |
130 | static tree fixed_type_or_null (tree, int *, int *); |
131 | static tree build_simple_base_path (tree expr, tree binfo); |
132 | static void build_vtbl_initializer (tree, tree, tree, tree, int *, |
133 | vec<constructor_elt, va_gc> **); |
134 | static bool check_bitfield_decl (tree); |
135 | static bool check_field_decl (tree, tree, int *, int *); |
136 | static void check_field_decls (tree, tree *, int *, int *); |
137 | static void build_base_fields (record_layout_info, splay_tree, tree *); |
138 | static void check_methods (tree); |
139 | static bool accessible_nvdtor_p (tree); |
140 | |
141 | /* Used by find_flexarrays and related functions. */ |
142 | struct flexmems_t; |
143 | static void diagnose_flexarrays (tree, const flexmems_t *); |
144 | static void find_flexarrays (tree, flexmems_t *, bool = false, |
145 | tree = NULL_TREE(tree) __null, tree = NULL_TREE(tree) __null); |
146 | static void check_flexarrays (tree, flexmems_t * = NULL__null, bool = false); |
147 | static void check_bases (tree, int *, int *); |
148 | static void check_bases_and_members (tree); |
149 | static tree create_vtable_ptr (tree, tree *); |
150 | static void include_empty_classes (record_layout_info); |
151 | static void layout_class_type (tree, tree *); |
152 | static void propagate_binfo_offsets (tree, tree); |
153 | static void layout_virtual_bases (record_layout_info, splay_tree); |
154 | static void build_vbase_offset_vtbl_entries (tree, vtbl_init_data *); |
155 | static void add_vcall_offset_vtbl_entries_r (tree, vtbl_init_data *); |
156 | static void add_vcall_offset_vtbl_entries_1 (tree, vtbl_init_data *); |
157 | static void build_vcall_offset_vtbl_entries (tree, vtbl_init_data *); |
158 | static void add_vcall_offset (tree, tree, vtbl_init_data *); |
159 | static void layout_vtable_decl (tree, int); |
160 | static tree dfs_find_final_overrider_pre (tree, void *); |
161 | static tree dfs_find_final_overrider_post (tree, void *); |
162 | static tree find_final_overrider (tree, tree, tree); |
163 | static int make_new_vtable (tree, tree); |
164 | static tree get_primary_binfo (tree); |
165 | static int maybe_indent_hierarchy (FILE *, int, int); |
166 | static tree dump_class_hierarchy_r (FILE *, dump_flags_t, tree, tree, int); |
167 | static void dump_class_hierarchy (tree); |
168 | static void dump_class_hierarchy_1 (FILE *, dump_flags_t, tree); |
169 | static void dump_array (FILE *, tree); |
170 | static void dump_vtable (tree, tree, tree); |
171 | static void dump_vtt (tree, tree); |
172 | static void dump_thunk (FILE *, int, tree); |
173 | static tree build_vtable (tree, tree, tree); |
174 | static void initialize_vtable (tree, vec<constructor_elt, va_gc> *); |
175 | static void layout_nonempty_base_or_field (record_layout_info, |
176 | tree, tree, splay_tree); |
177 | static void accumulate_vtbl_inits (tree, tree, tree, tree, tree, |
178 | vec<constructor_elt, va_gc> **); |
179 | static void dfs_accumulate_vtbl_inits (tree, tree, tree, tree, tree, |
180 | vec<constructor_elt, va_gc> **); |
181 | static void build_rtti_vtbl_entries (tree, vtbl_init_data *); |
182 | static void build_vcall_and_vbase_vtbl_entries (tree, vtbl_init_data *); |
183 | static void clone_constructors_and_destructors (tree); |
184 | static void update_vtable_entry_for_fn (tree, tree, tree, tree *, unsigned); |
185 | static void build_ctor_vtbl_group (tree, tree); |
186 | static void build_vtt (tree); |
187 | static tree binfo_ctor_vtable (tree); |
188 | static void build_vtt_inits (tree, tree, vec<constructor_elt, va_gc> **, |
189 | tree *); |
190 | static tree dfs_build_secondary_vptr_vtt_inits (tree, void *); |
191 | static tree dfs_fixup_binfo_vtbls (tree, void *); |
192 | static int record_subobject_offset (tree, tree, splay_tree); |
193 | static int check_subobject_offset (tree, tree, splay_tree); |
194 | static int walk_subobject_offsets (tree, subobject_offset_fn, |
195 | tree, splay_tree, tree, int); |
196 | static int layout_conflict_p (tree, tree, splay_tree, int); |
197 | static int splay_tree_compare_integer_csts (splay_tree_key k1, |
198 | splay_tree_key k2); |
199 | static void maybe_warn_about_inaccessible_bases (tree); |
200 | static bool type_requires_array_cookie (tree); |
201 | static bool base_derived_from (tree, tree); |
202 | static int empty_base_at_nonzero_offset_p (tree, tree, splay_tree); |
203 | static tree end_of_base (tree); |
204 | static tree get_vcall_index (tree, tree); |
205 | static bool type_maybe_constexpr_default_constructor (tree); |
206 | static bool type_maybe_constexpr_destructor (tree); |
207 | static bool field_poverlapping_p (tree); |
208 | |
209 | /* Set CURRENT_ACCESS_SPECIFIER based on the protection of DECL. */ |
210 | |
211 | void |
212 | set_current_access_from_decl (tree decl) |
213 | { |
214 | if (TREE_PRIVATE (decl)((decl)->base.private_flag)) |
215 | current_access_specifierscope_chain->access_specifier = access_private_nodeglobal_trees[TI_PRIVATE]; |
216 | else if (TREE_PROTECTED (decl)((decl)->base.protected_flag)) |
217 | current_access_specifierscope_chain->access_specifier = access_protected_nodeglobal_trees[TI_PROTECTED]; |
218 | else |
219 | current_access_specifierscope_chain->access_specifier = access_public_nodeglobal_trees[TI_PUBLIC]; |
220 | } |
221 | |
222 | /* Return a COND_EXPR that executes TRUE_STMT if this execution of the |
223 | 'structor is in charge of 'structing virtual bases, or FALSE_STMT |
224 | otherwise. */ |
225 | |
226 | tree |
227 | build_if_in_charge (tree true_stmt, tree false_stmt) |
228 | { |
229 | gcc_assert (DECL_HAS_IN_CHARGE_PARM_P (current_function_decl))((void)(!((__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/class.cc" , 229, __FUNCTION__, (TEMPLATE_DECL))))))))->result : current_function_decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 229, __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/class.cc" , 229, __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/class.cc" , 229, __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/class.cc" , 229, __FUNCTION__); <->u.fn; })->has_in_charge_parm_p )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 229, __FUNCTION__), 0 : 0)); |
230 | tree cmp = build2 (NE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], |
231 | current_in_charge_parm((cfun + 0)->language)->x_in_charge_parm, integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]); |
232 | tree type = unlowered_expr_type (true_stmt); |
233 | if (VOID_TYPE_P (type)(((enum tree_code) (type)->base.code) == VOID_TYPE)) |
234 | type = unlowered_expr_type (false_stmt); |
235 | tree cond = build3 (COND_EXPR, type, |
236 | cmp, true_stmt, false_stmt); |
237 | return cond; |
238 | } |
239 | |
240 | /* Convert to or from a base subobject. EXPR is an expression of type |
241 | `A' or `A*', an expression of type `B' or `B*' is returned. To |
242 | convert A to a base B, CODE is PLUS_EXPR and BINFO is the binfo for |
243 | the B base instance within A. To convert base A to derived B, CODE |
244 | is MINUS_EXPR and BINFO is the binfo for the A instance within B. |
245 | In this latter case, A must not be a morally virtual base of B. |
246 | NONNULL is true if EXPR is known to be non-NULL (this is only |
247 | needed when EXPR is of pointer type). CV qualifiers are preserved |
248 | from EXPR. */ |
249 | |
250 | tree |
251 | build_base_path (enum tree_code code, |
252 | tree expr, |
253 | tree binfo, |
254 | int nonnull, |
255 | tsubst_flags_t complain) |
256 | { |
257 | tree v_binfo = NULL_TREE(tree) __null; |
258 | tree d_binfo = NULL_TREE(tree) __null; |
259 | tree probe; |
260 | tree offset; |
261 | tree target_type; |
262 | tree null_test = NULL__null; |
263 | tree ptr_target_type; |
264 | int fixed_type_p; |
265 | int want_pointer = TYPE_PTR_P (TREE_TYPE (expr))(((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 265, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE ); |
266 | bool has_empty = false; |
267 | bool virtual_access; |
268 | bool rvalue = false; |
269 | |
270 | if (expr == error_mark_nodeglobal_trees[TI_ERROR_MARK] || binfo == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !binfo) |
271 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
272 | |
273 | for (probe = binfo; probe; probe = BINFO_INHERITANCE_CHAIN (probe)((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 273, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance)) |
274 | { |
275 | d_binfo = probe; |
276 | if (is_empty_class (BINFO_TYPE (probe)((contains_struct_check (((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 276, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 276, __FUNCTION__))->typed.type))) |
277 | has_empty = true; |
278 | if (!v_binfo && BINFO_VIRTUAL_P (probe)((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 278, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
279 | v_binfo = probe; |
280 | } |
281 | |
282 | probe = TYPE_MAIN_VARIANT (TREE_TYPE (expr))((tree_class_check ((((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 282, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 282, __FUNCTION__))->type_common.main_variant); |
283 | if (want_pointer) |
284 | probe = TYPE_MAIN_VARIANT (TREE_TYPE (probe))((tree_class_check ((((contains_struct_check ((probe), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 284, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 284, __FUNCTION__))->type_common.main_variant); |
285 | if (dependent_type_p (probe)) |
286 | if (tree open = currently_open_class (probe)) |
287 | probe = open; |
288 | |
289 | if (code == PLUS_EXPR |
290 | && !SAME_BINFO_TYPE_P (BINFO_TYPE (d_binfo), probe)((((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 290, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 290, __FUNCTION__))->typed.type)) == (probe))) |
291 | { |
292 | /* This can happen when adjust_result_of_qualified_name_lookup can't |
293 | find a unique base binfo in a call to a member function. We |
294 | couldn't give the diagnostic then since we might have been calling |
295 | a static member function, so we do it now. In other cases, eg. |
296 | during error recovery (c++/71979), we may not have a base at all. */ |
297 | if (complain & tf_error) |
298 | { |
299 | tree base = lookup_base (probe, BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 299, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 299, __FUNCTION__))->typed.type), |
300 | ba_unique, NULL__null, complain); |
301 | gcc_assert (base == error_mark_node || !base)((void)(!(base == global_trees[TI_ERROR_MARK] || !base) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 301, __FUNCTION__), 0 : 0)); |
302 | } |
303 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
304 | } |
305 | |
306 | gcc_assert ((code == MINUS_EXPR((void)(!((code == MINUS_EXPR && ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 307, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 307, __FUNCTION__))->typed.type)) == (probe))) || code == PLUS_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 308, __FUNCTION__), 0 : 0)) |
307 | && SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), probe))((void)(!((code == MINUS_EXPR && ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 307, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 307, __FUNCTION__))->typed.type)) == (probe))) || code == PLUS_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 308, __FUNCTION__), 0 : 0)) |
308 | || code == PLUS_EXPR)((void)(!((code == MINUS_EXPR && ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 307, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 307, __FUNCTION__))->typed.type)) == (probe))) || code == PLUS_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 308, __FUNCTION__), 0 : 0)); |
309 | |
310 | if (binfo == d_binfo) |
311 | /* Nothing to do. */ |
312 | return expr; |
313 | |
314 | if (code == MINUS_EXPR && v_binfo) |
315 | { |
316 | if (complain & tf_error) |
317 | { |
318 | if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), BINFO_TYPE (v_binfo))((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 318, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 318, __FUNCTION__))->typed.type)) == (((contains_struct_check (((tree_check ((v_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 318, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 318, __FUNCTION__))->typed.type)))) |
319 | { |
320 | if (want_pointer) |
321 | error ("cannot convert from pointer to base class %qT to " |
322 | "pointer to derived class %qT because the base is " |
323 | "virtual", BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 323, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 323, __FUNCTION__))->typed.type), BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 323, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 323, __FUNCTION__))->typed.type)); |
324 | else |
325 | error ("cannot convert from base class %qT to derived " |
326 | "class %qT because the base is virtual", |
327 | BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 327, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 327, __FUNCTION__))->typed.type), BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 327, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 327, __FUNCTION__))->typed.type)); |
328 | } |
329 | else |
330 | { |
331 | if (want_pointer) |
332 | error ("cannot convert from pointer to base class %qT to " |
333 | "pointer to derived class %qT via virtual base %qT", |
334 | BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 334, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 334, __FUNCTION__))->typed.type), BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 334, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 334, __FUNCTION__))->typed.type), |
335 | BINFO_TYPE (v_binfo)((contains_struct_check (((tree_check ((v_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 335, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 335, __FUNCTION__))->typed.type)); |
336 | else |
337 | error ("cannot convert from base class %qT to derived " |
338 | "class %qT via virtual base %qT", BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 338, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 338, __FUNCTION__))->typed.type), |
339 | BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 339, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 339, __FUNCTION__))->typed.type), BINFO_TYPE (v_binfo)((contains_struct_check (((tree_check ((v_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 339, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 339, __FUNCTION__))->typed.type)); |
340 | } |
341 | } |
342 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
343 | } |
344 | |
345 | bool uneval = (cp_unevaluated_operand != 0 |
346 | || processing_template_declscope_chain->x_processing_template_decl |
347 | || in_template_function ()); |
348 | |
349 | /* For a non-pointer simple base reference, express it as a COMPONENT_REF |
350 | without taking its address (and so causing lambda capture, 91933). */ |
351 | if (code == PLUS_EXPR && !v_binfo && !want_pointer && !has_empty && !uneval) |
352 | return build_simple_base_path (expr, binfo); |
353 | |
354 | if (!want_pointer) |
355 | { |
356 | rvalue = !lvalue_p (expr); |
357 | /* This must happen before the call to save_expr. */ |
358 | expr = cp_build_addr_expr (expr, complain); |
359 | } |
360 | else |
361 | expr = mark_rvalue_use (expr); |
362 | |
363 | offset = BINFO_OFFSET (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 363, __FUNCTION__, (TREE_BINFO)))->binfo.offset); |
364 | fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull); |
365 | target_type = code == PLUS_EXPR ? BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 365, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 365, __FUNCTION__))->typed.type) : BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 365, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 365, __FUNCTION__))->typed.type); |
366 | /* TARGET_TYPE has been extracted from BINFO, and, is therefore always |
367 | cv-unqualified. Extract the cv-qualifiers from EXPR so that the |
368 | expression returned matches the input. */ |
369 | target_type = cp_build_qualified_type |
370 | (target_type, cp_type_quals (TREE_TYPE (TREE_TYPE (expr))((contains_struct_check ((((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 370, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 370, __FUNCTION__))->typed.type))); |
371 | ptr_target_type = build_pointer_type (target_type); |
372 | |
373 | /* Do we need to look in the vtable for the real offset? */ |
374 | virtual_access = (v_binfo && fixed_type_p <= 0); |
375 | |
376 | /* Don't bother with the calculations inside sizeof; they'll ICE if the |
377 | source type is incomplete and the pointer value doesn't matter. In a |
378 | template (even in instantiate_non_dependent_expr), we don't have vtables |
379 | set up properly yet, and the value doesn't matter there either; we're |
380 | just interested in the result of overload resolution. */ |
381 | if (uneval) |
382 | { |
383 | expr = build_nop (ptr_target_type, expr); |
384 | goto indout; |
385 | } |
386 | |
387 | if (!COMPLETE_TYPE_P (probe)(((tree_class_check ((probe), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 387, __FUNCTION__))->type_common.size) != (tree) __null)) |
388 | { |
389 | if (complain & tf_error) |
390 | error ("cannot convert from %qT to base class %qT because %qT is " |
391 | "incomplete", BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 391, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 391, __FUNCTION__))->typed.type), BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 391, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 391, __FUNCTION__))->typed.type), |
392 | BINFO_TYPE (d_binfo)((contains_struct_check (((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 392, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 392, __FUNCTION__))->typed.type)); |
393 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
394 | } |
395 | |
396 | /* If we're in an NSDMI, we don't have the full constructor context yet |
397 | that we need for converting to a virtual base, so just build a stub |
398 | CONVERT_EXPR and expand it later in bot_replace. */ |
399 | if (virtual_access && fixed_type_p < 0 |
400 | && current_scope () != current_function_decl) |
401 | { |
402 | expr = build1 (CONVERT_EXPR, ptr_target_type, expr); |
403 | CONVERT_EXPR_VBASE_PATH (expr)((tree_not_check2 (((tree_check ((expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 403, __FUNCTION__, (CONVERT_EXPR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 403, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = true; |
404 | goto indout; |
405 | } |
406 | |
407 | /* Do we need to check for a null pointer? */ |
408 | if (want_pointer && !nonnull) |
409 | { |
410 | /* If we know the conversion will not actually change the value |
411 | of EXPR, then we can avoid testing the expression for NULL. |
412 | We have to avoid generating a COMPONENT_REF for a base class |
413 | field, because other parts of the compiler know that such |
414 | expressions are always non-NULL. */ |
415 | if (!virtual_access && integer_zerop (offset)) |
416 | return build_nop (ptr_target_type, expr); |
417 | null_test = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
418 | } |
419 | |
420 | /* Protect against multiple evaluation if necessary. */ |
421 | if (TREE_SIDE_EFFECTS (expr)((non_type_check ((expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 421, __FUNCTION__))->base.side_effects_flag) && (null_test || virtual_access)) |
422 | expr = save_expr (expr); |
423 | |
424 | /* Store EXPR and build the real null test just before returning. */ |
425 | if (null_test) |
426 | null_test = expr; |
427 | |
428 | /* If this is a simple base reference, express it as a COMPONENT_REF. */ |
429 | if (code == PLUS_EXPR && !virtual_access |
430 | /* We don't build base fields for empty bases, and they aren't very |
431 | interesting to the optimizers anyway. */ |
432 | && !has_empty) |
433 | { |
434 | expr = cp_build_fold_indirect_ref (expr); |
435 | expr = build_simple_base_path (expr, binfo); |
436 | if (rvalue && lvalue_p (expr)) |
437 | expr = move (expr); |
438 | if (want_pointer) |
439 | expr = build_address (expr); |
440 | target_type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 440, __FUNCTION__))->typed.type); |
Value stored to 'target_type' is never read | |
441 | goto out; |
442 | } |
443 | |
444 | if (virtual_access) |
445 | { |
446 | /* Going via virtual base V_BINFO. We need the static offset |
447 | from V_BINFO to BINFO, and the dynamic offset from D_BINFO to |
448 | V_BINFO. That offset is an entry in D_BINFO's vtable. */ |
449 | tree v_offset; |
450 | |
451 | if (fixed_type_p < 0 && in_base_initializer((cfun + 0)->language)->x_in_base_initializer) |
452 | { |
453 | /* In a base member initializer, we cannot rely on the |
454 | vtable being set up. We have to indirect via the |
455 | vtt_parm. */ |
456 | tree t; |
457 | |
458 | t = TREE_TYPE (TYPE_VFIELD (current_class_type))((contains_struct_check ((((tree_check3 ((scope_chain->class_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 458, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 458, __FUNCTION__))->typed.type); |
459 | t = build_pointer_type (t); |
460 | v_offset = fold_convert (t, current_vtt_parm)fold_convert_loc (((location_t) 0), t, ((cfun + 0)->language )->x_vtt_parm); |
461 | v_offset = cp_build_fold_indirect_ref (v_offset); |
462 | } |
463 | else |
464 | { |
465 | tree t = expr; |
466 | if (sanitize_flags_p (SANITIZE_VPTR) |
467 | && fixed_type_p == 0) |
468 | { |
469 | t = cp_ubsan_maybe_instrument_cast_to_vbase (input_location, |
470 | probe, expr); |
471 | if (t == NULL_TREE(tree) __null) |
472 | t = expr; |
473 | } |
474 | v_offset = build_vfield_ref (cp_build_fold_indirect_ref (t), |
475 | TREE_TYPE (TREE_TYPE (expr))((contains_struct_check ((((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 475, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 475, __FUNCTION__))->typed.type)); |
476 | } |
477 | |
478 | if (v_offset == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
479 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
480 | |
481 | v_offset = fold_build_pointer_plus (v_offset, BINFO_VPTR_FIELD (v_binfo))fold_build_pointer_plus_loc (((location_t) 0), v_offset, ((tree_check ((v_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 481, __FUNCTION__, (TREE_BINFO)))->binfo.vptr_field)); |
482 | v_offset = build1 (NOP_EXPR, |
483 | build_pointer_type (ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE]), |
484 | v_offset); |
485 | v_offset = cp_build_fold_indirect_ref (v_offset); |
486 | TREE_CONSTANT (v_offset)((non_type_check ((v_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 486, __FUNCTION__))->base.constant_flag) = 1; |
487 | |
488 | offset = convert_to_integer (ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE], |
489 | size_diffop_loc (input_location, offset, |
490 | BINFO_OFFSET (v_binfo)((tree_check ((v_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 490, __FUNCTION__, (TREE_BINFO)))->binfo.offset))); |
491 | |
492 | if (!integer_zerop (offset)) |
493 | v_offset = build2 (code, ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE], v_offset, offset); |
494 | |
495 | if (fixed_type_p < 0) |
496 | /* Negative fixed_type_p means this is a constructor or destructor; |
497 | virtual base layout is fixed in in-charge [cd]tors, but not in |
498 | base [cd]tors. */ |
499 | offset = build_if_in_charge |
500 | (convert_to_integer (ptrdiff_type_nodeglobal_trees[TI_PTRDIFF_TYPE], BINFO_OFFSET (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 500, __FUNCTION__, (TREE_BINFO)))->binfo.offset)), |
501 | v_offset); |
502 | else |
503 | offset = v_offset; |
504 | } |
505 | |
506 | if (want_pointer) |
507 | target_type = ptr_target_type; |
508 | |
509 | if (!integer_zerop (offset)) |
510 | { |
511 | offset = fold_convert (sizetype, offset)fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_sizetype ], offset); |
512 | if (code == MINUS_EXPR) |
513 | offset = fold_build1_loc (input_location, NEGATE_EXPR, sizetypesizetype_tab[(int) stk_sizetype], offset); |
514 | expr = fold_build_pointer_plus (expr, offset)fold_build_pointer_plus_loc (((location_t) 0), expr, offset); |
515 | } |
516 | else |
517 | null_test = NULL__null; |
518 | |
519 | expr = build1 (NOP_EXPR, ptr_target_type, expr); |
520 | |
521 | indout: |
522 | if (!want_pointer) |
523 | { |
524 | expr = cp_build_fold_indirect_ref (expr); |
525 | if (rvalue) |
526 | expr = move (expr); |
527 | } |
528 | |
529 | out: |
530 | if (null_test) |
531 | /* Wrap EXPR in a null test. */ |
532 | expr = build_if_nonnull (null_test, expr, complain); |
533 | |
534 | return expr; |
535 | } |
536 | |
537 | /* Subroutine of build_base_path; EXPR and BINFO are as in that function. |
538 | Perform a derived-to-base conversion by recursively building up a |
539 | sequence of COMPONENT_REFs to the appropriate base fields. */ |
540 | |
541 | static tree |
542 | build_simple_base_path (tree expr, tree binfo) |
543 | { |
544 | tree type = BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 544, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 544, __FUNCTION__))->typed.type); |
545 | tree d_binfo = BINFO_INHERITANCE_CHAIN (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 545, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance); |
546 | tree field; |
547 | |
548 | if (d_binfo == NULL_TREE(tree) __null) |
549 | { |
550 | tree temp; |
551 | |
552 | gcc_assert (TYPE_MAIN_VARIANT (TREE_TYPE (expr)) == type)((void)(!(((tree_class_check ((((contains_struct_check ((expr ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 552, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 552, __FUNCTION__))->type_common.main_variant) == type) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 552, __FUNCTION__), 0 : 0)); |
553 | |
554 | /* Transform `(a, b).x' into `(*(a, &b)).x', `(a ? b : c).x' |
555 | into `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only |
556 | an lvalue in the front end; only _DECLs and _REFs are lvalues |
557 | in the back end. */ |
558 | temp = unary_complex_lvalue (ADDR_EXPR, expr); |
559 | if (temp) |
560 | expr = cp_build_fold_indirect_ref (temp); |
561 | |
562 | return expr; |
563 | } |
564 | |
565 | /* Recurse. */ |
566 | expr = build_simple_base_path (expr, d_binfo); |
567 | |
568 | for (field = TYPE_FIELDS (BINFO_TYPE (d_binfo))((tree_check3 ((((contains_struct_check (((tree_check ((d_binfo ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 568, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 568, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 568, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
569 | field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 569, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 569, __FUNCTION__))->common.chain))) |
570 | /* Is this the base field created by build_base_field? */ |
571 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) == FIELD_DECL |
572 | && DECL_FIELD_IS_BASE (field)((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 572, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 572, __FUNCTION__))->decl_common.lang_flag_6) |
573 | && TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 573, __FUNCTION__))->typed.type) == type |
574 | /* If we're looking for a field in the most-derived class, |
575 | also check the field offset; we can have two base fields |
576 | of the same type if one is an indirect virtual base and one |
577 | is a direct non-virtual base. */ |
578 | && (BINFO_INHERITANCE_CHAIN (d_binfo)((tree_check ((d_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 578, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance) |
579 | || tree_int_cst_equal (byte_position (field), |
580 | BINFO_OFFSET (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 580, __FUNCTION__, (TREE_BINFO)))->binfo.offset)))) |
581 | { |
582 | /* We don't use build_class_member_access_expr here, as that |
583 | has unnecessary checks, and more importantly results in |
584 | recursive calls to dfs_walk_once. */ |
585 | int type_quals = cp_type_quals (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 585, __FUNCTION__))->typed.type)); |
586 | |
587 | expr = build3 (COMPONENT_REF, |
588 | cp_build_qualified_type (type, type_quals), |
589 | expr, field, NULL_TREE(tree) __null); |
590 | /* Mark the expression const or volatile, as appropriate. |
591 | Even though we've dealt with the type above, we still have |
592 | to mark the expression itself. */ |
593 | if (type_quals & TYPE_QUAL_CONST) |
594 | TREE_READONLY (expr)((non_type_check ((expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 594, __FUNCTION__))->base.readonly_flag) = 1; |
595 | if (type_quals & TYPE_QUAL_VOLATILE) |
596 | TREE_THIS_VOLATILE (expr)((expr)->base.volatile_flag) = 1; |
597 | |
598 | return expr; |
599 | } |
600 | |
601 | /* Didn't find the base field?!? */ |
602 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 602, __FUNCTION__)); |
603 | } |
604 | |
605 | /* Convert OBJECT to the base TYPE. OBJECT is an expression whose |
606 | type is a class type or a pointer to a class type. In the former |
607 | case, TYPE is also a class type; in the latter it is another |
608 | pointer type. If CHECK_ACCESS is true, an error message is emitted |
609 | if TYPE is inaccessible. If OBJECT has pointer type, the value is |
610 | assumed to be non-NULL. */ |
611 | |
612 | tree |
613 | convert_to_base (tree object, tree type, bool check_access, bool nonnull, |
614 | tsubst_flags_t complain) |
615 | { |
616 | tree binfo; |
617 | tree object_type; |
618 | |
619 | if (TYPE_PTR_P (TREE_TYPE (object))(((enum tree_code) (((contains_struct_check ((object), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 619, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE )) |
620 | { |
621 | object_type = TREE_TYPE (TREE_TYPE (object))((contains_struct_check ((((contains_struct_check ((object), ( TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 621, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 621, __FUNCTION__))->typed.type); |
622 | type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 622, __FUNCTION__))->typed.type); |
623 | } |
624 | else |
625 | object_type = TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 625, __FUNCTION__))->typed.type); |
626 | |
627 | binfo = lookup_base (object_type, type, check_access ? ba_check : ba_unique, |
628 | NULL__null, complain); |
629 | if (!binfo || binfo == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
630 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
631 | |
632 | return build_base_path (PLUS_EXPR, object, binfo, nonnull, complain); |
633 | } |
634 | |
635 | /* EXPR is an expression with unqualified class type. BASE is a base |
636 | binfo of that class type. Returns EXPR, converted to the BASE |
637 | type. This function assumes that EXPR is the most derived class; |
638 | therefore virtual bases can be found at their static offsets. */ |
639 | |
640 | tree |
641 | convert_to_base_statically (tree expr, tree base) |
642 | { |
643 | tree expr_type; |
644 | |
645 | expr_type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 645, __FUNCTION__))->typed.type); |
646 | if (!SAME_BINFO_TYPE_P (BINFO_TYPE (base), expr_type)((((contains_struct_check (((tree_check ((base), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 646, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 646, __FUNCTION__))->typed.type)) == (expr_type))) |
647 | { |
648 | /* If this is a non-empty base, use a COMPONENT_REF. */ |
649 | if (!is_empty_class (BINFO_TYPE (base)((contains_struct_check (((tree_check ((base), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 649, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 649, __FUNCTION__))->typed.type))) |
650 | return build_simple_base_path (expr, base); |
651 | |
652 | /* We use fold_build2 and fold_convert below to simplify the trees |
653 | provided to the optimizers. It is not safe to call these functions |
654 | when processing a template because they do not handle C++-specific |
655 | trees. */ |
656 | gcc_assert (!processing_template_decl)((void)(!(!scope_chain->x_processing_template_decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 656, __FUNCTION__), 0 : 0)); |
657 | expr = cp_build_addr_expr (expr, tf_warning_or_error); |
658 | if (!integer_zerop (BINFO_OFFSET (base)((tree_check ((base), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 658, __FUNCTION__, (TREE_BINFO)))->binfo.offset))) |
659 | expr = fold_build_pointer_plus_loc (input_location, |
660 | expr, BINFO_OFFSET (base)((tree_check ((base), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 660, __FUNCTION__, (TREE_BINFO)))->binfo.offset)); |
661 | expr = fold_convert (build_pointer_type (BINFO_TYPE (base)), expr)fold_convert_loc (((location_t) 0), build_pointer_type (((contains_struct_check (((tree_check ((base), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 661, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 661, __FUNCTION__))->typed.type)), expr); |
662 | expr = build_fold_indirect_ref_loc (input_location, expr); |
663 | } |
664 | |
665 | return expr; |
666 | } |
667 | |
668 | /* True IFF EXPR is a reference to an empty base class "subobject", as built in |
669 | convert_to_base_statically. We look for the result of the fold_convert |
670 | call, a NOP_EXPR from one pointer type to another, where the target is an |
671 | empty base of the original type. */ |
672 | |
673 | bool |
674 | is_empty_base_ref (tree expr) |
675 | { |
676 | if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == INDIRECT_REF) |
677 | expr = TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 677, __FUNCTION__))))); |
678 | if (TREE_CODE (expr)((enum tree_code) (expr)->base.code) != NOP_EXPR) |
679 | return false; |
680 | tree type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 680, __FUNCTION__))->typed.type); |
681 | if (!POINTER_TYPE_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE || ( (enum tree_code) (type)->base.code) == REFERENCE_TYPE)) |
682 | return false; |
683 | type = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 683, __FUNCTION__))->typed.type); |
684 | if (!is_empty_class (type)) |
685 | return false; |
686 | STRIP_NOPS (expr)(expr) = tree_strip_nop_conversions ((const_cast<union tree_node *> (((expr))))); |
687 | tree fromtype = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 687, __FUNCTION__))->typed.type); |
688 | if (!POINTER_TYPE_P (fromtype)(((enum tree_code) (fromtype)->base.code) == POINTER_TYPE || ((enum tree_code) (fromtype)->base.code) == REFERENCE_TYPE )) |
689 | return false; |
690 | fromtype = TREE_TYPE (fromtype)((contains_struct_check ((fromtype), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 690, __FUNCTION__))->typed.type); |
691 | return (CLASS_TYPE_P (fromtype)(((((enum tree_code) (fromtype)->base.code)) == RECORD_TYPE || (((enum tree_code) (fromtype)->base.code)) == UNION_TYPE ) && ((tree_class_check ((fromtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 691, __FUNCTION__))->type_common.lang_flag_5)) |
692 | && !same_type_ignoring_top_level_qualifiers_p (fromtype, type) |
693 | && DERIVED_FROM_P (type, fromtype)(lookup_base ((fromtype), (type), ba_any, __null, tf_none) != (tree) __null)); |
694 | } |
695 | |
696 | tree |
697 | build_vfield_ref (tree datum, tree type) |
698 | { |
699 | tree vfield, vcontext; |
700 | |
701 | if (datum == error_mark_nodeglobal_trees[TI_ERROR_MARK] |
702 | /* Can happen in case of duplicate base types (c++/59082). */ |
703 | || !TYPE_VFIELD (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 703, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval)) |
704 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
705 | |
706 | /* First, convert to the requested type. */ |
707 | if (!same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (datum)((contains_struct_check ((datum), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 707, __FUNCTION__))->typed.type), type)) |
708 | datum = convert_to_base (datum, type, /*check_access=*/false, |
709 | /*nonnull=*/true, tf_warning_or_error); |
710 | |
711 | /* Second, the requested type may not be the owner of its own vptr. |
712 | If not, convert to the base class that owns it. We cannot use |
713 | convert_to_base here, because VCONTEXT may appear more than once |
714 | in the inheritance hierarchy of TYPE, and thus direct conversion |
715 | between the types may be ambiguous. Following the path back up |
716 | one step at a time via primary bases avoids the problem. */ |
717 | vfield = TYPE_VFIELD (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 717, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval); |
718 | vcontext = DECL_CONTEXT (vfield)((contains_struct_check ((vfield), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 718, __FUNCTION__))->decl_minimal.context); |
719 | while (!same_type_ignoring_top_level_qualifiers_p (vcontext, type)) |
720 | { |
721 | datum = build_simple_base_path (datum, CLASSTYPE_PRIMARY_BINFO (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 721, __FUNCTION__))->type_with_lang_specific.lang_specific ))->primary_base)); |
722 | type = TREE_TYPE (datum)((contains_struct_check ((datum), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 722, __FUNCTION__))->typed.type); |
723 | } |
724 | |
725 | return build3 (COMPONENT_REF, TREE_TYPE (vfield)((contains_struct_check ((vfield), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 725, __FUNCTION__))->typed.type), datum, vfield, NULL_TREE(tree) __null); |
726 | } |
727 | |
728 | /* Given an object INSTANCE, return an expression which yields the |
729 | vtable element corresponding to INDEX. There are many special |
730 | cases for INSTANCE which we take care of here, mainly to avoid |
731 | creating extra tree nodes when we don't have to. */ |
732 | |
733 | tree |
734 | build_vtbl_ref (tree instance, tree idx) |
735 | { |
736 | tree aref; |
737 | tree vtbl = NULL_TREE(tree) __null; |
738 | |
739 | /* Try to figure out what a reference refers to, and |
740 | access its virtual function table directly. */ |
741 | |
742 | int cdtorp = 0; |
743 | tree fixed_type = fixed_type_or_null (instance, NULL__null, &cdtorp); |
744 | |
745 | tree basetype = non_reference (TREE_TYPE (instance)((contains_struct_check ((instance), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 745, __FUNCTION__))->typed.type)); |
746 | |
747 | if (fixed_type && !cdtorp) |
748 | { |
749 | tree binfo = lookup_base (fixed_type, basetype, |
750 | ba_unique, NULL__null, tf_none); |
751 | if (binfo && binfo != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
752 | vtbl = unshare_expr (BINFO_VTABLE (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 752, __FUNCTION__, (TREE_BINFO)))->binfo.vtable)); |
753 | } |
754 | |
755 | if (!vtbl) |
756 | vtbl = build_vfield_ref (instance, basetype); |
757 | |
758 | aref = build_array_ref (input_location, vtbl, idx); |
759 | TREE_CONSTANT (aref)((non_type_check ((aref), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 759, __FUNCTION__))->base.constant_flag) |= TREE_CONSTANT (vtbl)((non_type_check ((vtbl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 759, __FUNCTION__))->base.constant_flag) && TREE_CONSTANT (idx)((non_type_check ((idx), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 759, __FUNCTION__))->base.constant_flag); |
760 | |
761 | return aref; |
762 | } |
763 | |
764 | /* Given a stable object pointer INSTANCE_PTR, return an expression which |
765 | yields a function pointer corresponding to vtable element INDEX. */ |
766 | |
767 | tree |
768 | build_vfn_ref (tree instance_ptr, tree idx) |
769 | { |
770 | tree aref; |
771 | |
772 | aref = build_vtbl_ref (cp_build_fold_indirect_ref (instance_ptr), idx); |
773 | |
774 | /* When using function descriptors, the address of the |
775 | vtable entry is treated as a function pointer. */ |
776 | if (TARGET_VTABLE_USES_DESCRIPTORS0) |
777 | aref = build1 (NOP_EXPR, TREE_TYPE (aref)((contains_struct_check ((aref), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 777, __FUNCTION__))->typed.type), |
778 | cp_build_addr_expr (aref, tf_warning_or_error)); |
779 | |
780 | /* Remember this as a method reference, for later devirtualization. */ |
781 | aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref)((contains_struct_check ((aref), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 781, __FUNCTION__))->typed.type), aref, instance_ptr, |
782 | fold_convert (TREE_TYPE (instance_ptr), idx)fold_convert_loc (((location_t) 0), ((contains_struct_check ( (instance_ptr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 782, __FUNCTION__))->typed.type), idx)); |
783 | |
784 | return aref; |
785 | } |
786 | |
787 | /* Return the name of the virtual function table (as an IDENTIFIER_NODE) |
788 | for the given TYPE. */ |
789 | |
790 | static tree |
791 | get_vtable_name (tree type) |
792 | { |
793 | return mangle_vtbl_for_type (type); |
794 | } |
795 | |
796 | /* DECL is an entity associated with TYPE, like a virtual table or an |
797 | implicitly generated constructor. Determine whether or not DECL |
798 | should have external or internal linkage at the object file |
799 | level. This routine does not deal with COMDAT linkage and other |
800 | similar complexities; it simply sets TREE_PUBLIC if it possible for |
801 | entities in other translation units to contain copies of DECL, in |
802 | the abstract. */ |
803 | |
804 | void |
805 | set_linkage_according_to_type (tree /*type*/, tree decl) |
806 | { |
807 | TREE_PUBLIC (decl)((decl)->base.public_flag) = 1; |
808 | determine_visibility (decl); |
809 | } |
810 | |
811 | /* Create a VAR_DECL for a primary or secondary vtable for CLASS_TYPE. |
812 | (For a secondary vtable for B-in-D, CLASS_TYPE should be D, not B.) |
813 | Use NAME for the name of the vtable, and VTABLE_TYPE for its type. */ |
814 | |
815 | static tree |
816 | build_vtable (tree class_type, tree name, tree vtable_type) |
817 | { |
818 | tree decl; |
819 | |
820 | decl = build_lang_decl (VAR_DECL, name, vtable_type); |
821 | /* vtable names are already mangled; give them their DECL_ASSEMBLER_NAME |
822 | now to avoid confusion in mangle_decl. */ |
823 | SET_DECL_ASSEMBLER_NAME (decl, name)overwrite_decl_assembler_name (decl, name); |
824 | DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 824, __FUNCTION__))->decl_minimal.context) = class_type; |
825 | DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 825, __FUNCTION__))->decl_common.artificial_flag) = 1; |
826 | TREE_STATIC (decl)((decl)->base.static_flag) = 1; |
827 | TREE_READONLY (decl)((non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 827, __FUNCTION__))->base.readonly_flag) = 1; |
828 | DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 828, __FUNCTION__))->decl_common.virtual_flag) = 1; |
829 | SET_DECL_ALIGN (decl, TARGET_VTABLE_ENTRY_ALIGN)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 829, __FUNCTION__))->decl_common.align) = ffs_hwi ((((global_options .x_ix86_isa_flags & (1UL << 58)) != 0) ? 32 : ((8) * (((global_options.x_ix86_isa_flags & (1UL << 1)) != 0) ? 8 : 4))))); |
830 | DECL_USER_ALIGN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 830, __FUNCTION__))->base.u.bits.user_align) = true; |
831 | DECL_VTABLE_OR_VTT_P (decl)((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 831, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 831, __FUNCTION__))->decl_common.virtual_flag) = 1; |
832 | set_linkage_according_to_type (class_type, decl); |
833 | /* The vtable has not been defined -- yet. */ |
834 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 834, __FUNCTION__))->decl_common.decl_flag_1) = 1; |
835 | DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 835, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 1; |
836 | |
837 | /* Mark the VAR_DECL node representing the vtable itself as a |
838 | "gratuitous" one, thereby forcing dwarfout.c to ignore it. It |
839 | is rather important that such things be ignored because any |
840 | effort to actually generate DWARF for them will run into |
841 | trouble when/if we encounter code like: |
842 | |
843 | #pragma interface |
844 | struct S { virtual void member (); }; |
845 | |
846 | because the artificial declaration of the vtable itself (as |
847 | manufactured by the g++ front end) will say that the vtable is |
848 | a static member of `S' but only *after* the debug output for |
849 | the definition of `S' has already been output. This causes |
850 | grief because the DWARF entry for the definition of the vtable |
851 | will try to refer back to an earlier *declaration* of the |
852 | vtable as a static member of `S' and there won't be one. We |
853 | might be able to arrange to have the "vtable static member" |
854 | attached to the member list for `S' before the debug info for |
855 | `S' get written (which would solve the problem) but that would |
856 | require more intrusive changes to the g++ front end. */ |
857 | DECL_IGNORED_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 857, __FUNCTION__))->decl_common.ignored_flag) = 1; |
858 | |
859 | return decl; |
860 | } |
861 | |
862 | /* Get the VAR_DECL of the vtable for TYPE. TYPE need not be polymorphic, |
863 | or even complete. If this does not exist, create it. If COMPLETE is |
864 | nonzero, then complete the definition of it -- that will render it |
865 | impossible to actually build the vtable, but is useful to get at those |
866 | which are known to exist in the runtime. */ |
867 | |
868 | tree |
869 | get_vtable_decl (tree type, int complete) |
870 | { |
871 | tree decl; |
872 | |
873 | if (CLASSTYPE_VTABLES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 873, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables)) |
874 | return CLASSTYPE_VTABLES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 874, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables); |
875 | |
876 | decl = build_vtable (type, get_vtable_name (type), vtbl_type_nodecp_global_trees[CPTI_VTBL_TYPE]); |
877 | CLASSTYPE_VTABLES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 877, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vtables) = decl; |
878 | |
879 | if (complete) |
880 | { |
881 | DECL_EXTERNAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 881, __FUNCTION__))->decl_common.decl_flag_1) = 1; |
882 | cp_finish_decl (decl, NULL_TREE(tree) __null, false, NULL_TREE(tree) __null, 0); |
883 | } |
884 | |
885 | return decl; |
886 | } |
887 | |
888 | /* Build the primary virtual function table for TYPE. If BINFO is |
889 | non-NULL, build the vtable starting with the initial approximation |
890 | that it is the same as the one which is the head of the association |
891 | list. Returns a nonzero value if a new vtable is actually |
892 | created. */ |
893 | |
894 | static int |
895 | build_primary_vtable (tree binfo, tree type) |
896 | { |
897 | tree decl; |
898 | tree virtuals; |
899 | |
900 | decl = get_vtable_decl (type, /*complete=*/0); |
901 | |
902 | if (binfo) |
903 | { |
904 | if (BINFO_NEW_VTABLE_MARKED (binfo)(((tree_not_check2 (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 904, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 904, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2))) |
905 | /* We have already created a vtable for this base, so there's |
906 | no need to do it again. */ |
907 | return 0; |
908 | |
909 | virtuals = copy_list (BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 909, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals)); |
910 | TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 910, __FUNCTION__))->typed.type) = TREE_TYPE (get_vtbl_decl_for_binfo (binfo))((contains_struct_check ((get_vtbl_decl_for_binfo (binfo)), ( TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 910, __FUNCTION__))->typed.type); |
911 | DECL_SIZE (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 911, __FUNCTION__))->decl_common.size) = TYPE_SIZE (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 911, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 911, __FUNCTION__))->type_common.size); |
912 | DECL_SIZE_UNIT (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 912, __FUNCTION__))->decl_common.size_unit) = TYPE_SIZE_UNIT (TREE_TYPE (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 912, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 912, __FUNCTION__))->type_common.size_unit); |
913 | } |
914 | else |
915 | { |
916 | gcc_assert (TREE_TYPE (decl) == vtbl_type_node)((void)(!(((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 916, __FUNCTION__))->typed.type) == cp_global_trees[CPTI_VTBL_TYPE ]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 916, __FUNCTION__), 0 : 0)); |
917 | virtuals = NULL_TREE(tree) __null; |
918 | } |
919 | |
920 | /* Initialize the association list for this type, based |
921 | on our first approximation. */ |
922 | BINFO_VTABLE (TYPE_BINFO (type))((tree_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 922, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 922, __FUNCTION__, (TREE_BINFO)))->binfo.vtable) = decl; |
923 | BINFO_VIRTUALS (TYPE_BINFO (type))((tree_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 923, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 923, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals) = virtuals; |
924 | SET_BINFO_NEW_VTABLE_MARKED (TYPE_BINFO (type))((((tree_not_check2 (((tree_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) = 1, ((void)(!(!((tree_not_check2 (((tree_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) || ((tree_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__), 0 : 0)), ((void)(!(((tree_check3 ((((contains_struct_check (((tree_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 924, __FUNCTION__), 0 : 0))); |
925 | return 1; |
926 | } |
927 | |
928 | /* Give BINFO a new virtual function table which is initialized |
929 | with a skeleton-copy of its original initialization. The only |
930 | entry that changes is the `delta' entry, so we can really |
931 | share a lot of structure. |
932 | |
933 | FOR_TYPE is the most derived type which caused this table to |
934 | be needed. |
935 | |
936 | Returns nonzero if we haven't met BINFO before. |
937 | |
938 | The order in which vtables are built (by calling this function) for |
939 | an object must remain the same, otherwise a binary incompatibility |
940 | can result. */ |
941 | |
942 | static int |
943 | build_secondary_vtable (tree binfo) |
944 | { |
945 | if (BINFO_NEW_VTABLE_MARKED (binfo)(((tree_not_check2 (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 945, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 945, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2))) |
946 | /* We already created a vtable for this base. There's no need to |
947 | do it again. */ |
948 | return 0; |
949 | |
950 | /* Remember that we've created a vtable for this BINFO, so that we |
951 | don't try to do so again. */ |
952 | SET_BINFO_NEW_VTABLE_MARKED (binfo)((((tree_not_check2 (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) = 1, ((void)(!(!((tree_not_check2 (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) || ((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__), 0 : 0)), ((void)(!(((tree_check3 ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 952, __FUNCTION__), 0 : 0))); |
953 | |
954 | /* Make fresh virtual list, so we can smash it later. */ |
955 | BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 955, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals) = copy_list (BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 955, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals)); |
956 | |
957 | /* Secondary vtables are laid out as part of the same structure as |
958 | the primary vtable. */ |
959 | BINFO_VTABLE (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 959, __FUNCTION__, (TREE_BINFO)))->binfo.vtable) = NULL_TREE(tree) __null; |
960 | return 1; |
961 | } |
962 | |
963 | /* Create a new vtable for BINFO which is the hierarchy dominated by |
964 | T. Return nonzero if we actually created a new vtable. */ |
965 | |
966 | static int |
967 | make_new_vtable (tree t, tree binfo) |
968 | { |
969 | if (binfo == TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 969, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)) |
970 | /* In this case, it is *type*'s vtable we are modifying. We start |
971 | with the approximation that its vtable is that of the |
972 | immediate base class. */ |
973 | return build_primary_vtable (binfo, t); |
974 | else |
975 | /* This is our very own copy of `basetype' to play with. Later, |
976 | we will fill in all the virtual functions that override the |
977 | virtual functions in these base classes which are not defined |
978 | by the current type. */ |
979 | return build_secondary_vtable (binfo); |
980 | } |
981 | |
982 | /* Make *VIRTUALS, an entry on the BINFO_VIRTUALS list for BINFO |
983 | (which is in the hierarchy dominated by T) list FNDECL as its |
984 | BV_FN. DELTA is the required constant adjustment from the `this' |
985 | pointer where the vtable entry appears to the `this' required when |
986 | the function is actually called. */ |
987 | |
988 | static void |
989 | modify_vtable_entry (tree t, |
990 | tree binfo, |
991 | tree fndecl, |
992 | tree delta, |
993 | tree *virtuals) |
994 | { |
995 | tree v; |
996 | |
997 | v = *virtuals; |
998 | |
999 | if (fndecl != BV_FN (v)(((tree_check ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 999, __FUNCTION__, (TREE_LIST)))->list.value)) |
1000 | || !tree_int_cst_equal (delta, BV_DELTA (v)(((tree_check ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1000, __FUNCTION__, (TREE_LIST)))->list.purpose)))) |
1001 | { |
1002 | /* We need a new vtable for BINFO. */ |
1003 | if (make_new_vtable (t, binfo)) |
1004 | { |
1005 | /* If we really did make a new vtable, we also made a copy |
1006 | of the BINFO_VIRTUALS list. Now, we have to find the |
1007 | corresponding entry in that list. */ |
1008 | *virtuals = BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1008, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals); |
1009 | while (BV_FN (*virtuals)(((tree_check ((*virtuals), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1009, __FUNCTION__, (TREE_LIST)))->list.value)) != BV_FN (v)(((tree_check ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1009, __FUNCTION__, (TREE_LIST)))->list.value))) |
1010 | *virtuals = TREE_CHAIN (*virtuals)((contains_struct_check ((*virtuals), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1010, __FUNCTION__))->common.chain); |
1011 | v = *virtuals; |
1012 | } |
1013 | |
1014 | BV_DELTA (v)(((tree_check ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1014, __FUNCTION__, (TREE_LIST)))->list.purpose)) = delta; |
1015 | BV_VCALL_INDEX (v)(((contains_struct_check ((v), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1015, __FUNCTION__))->typed.type)) = NULL_TREE(tree) __null; |
1016 | BV_FN (v)(((tree_check ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1016, __FUNCTION__, (TREE_LIST)))->list.value)) = fndecl; |
1017 | } |
1018 | } |
1019 | |
1020 | |
1021 | /* Add method METHOD to class TYPE. If VIA_USING indicates whether |
1022 | METHOD is being injected via a using_decl. Returns true if the |
1023 | method could be added to the method vec. */ |
1024 | |
1025 | bool |
1026 | add_method (tree type, tree method, bool via_using) |
1027 | { |
1028 | if (method == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1029 | return false; |
1030 | |
1031 | gcc_assert (!DECL_EXTERN_C_P (method))((void)(!(!((((contains_struct_check ((method), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1031, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check ((method), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1031, __FUNCTION__))->decl_common.lang_specific)->u.base .language : (((enum tree_code) (method)->base.code) == FUNCTION_DECL ? lang_c : lang_cplusplus)) == lang_c)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1031, __FUNCTION__), 0 : 0)); |
1032 | |
1033 | tree *slot = find_member_slot (type, DECL_NAME (method)((contains_struct_check ((method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1033, __FUNCTION__))->decl_minimal.name)); |
1034 | tree current_fns = slot ? *slot : NULL_TREE(tree) __null; |
1035 | |
1036 | /* See below. */ |
1037 | int losem = -1; |
1038 | |
1039 | /* Check to see if we've already got this method. */ |
1040 | for (ovl_iterator iter (current_fns); iter; ++iter) |
1041 | { |
1042 | tree fn = *iter; |
1043 | |
1044 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) != TREE_CODE (method)((enum tree_code) (method)->base.code)) |
1045 | continue; |
1046 | |
1047 | /* Two using-declarations can coexist, we'll complain about ambiguity in |
1048 | overload resolution. */ |
1049 | if (via_using && iter.using_p () |
1050 | /* Except handle inherited constructors specially. */ |
1051 | && ! 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/class.cc" , 1051, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1051, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) |
1052 | { |
1053 | if (fn == method) |
1054 | /* Don't add the same one twice. */ |
1055 | return false; |
1056 | continue; |
1057 | } |
1058 | |
1059 | /* [over.load] Member function declarations with the |
1060 | same name and the same parameter types cannot be |
1061 | overloaded if any of them is a static member |
1062 | function declaration. |
1063 | |
1064 | [over.load] Member function declarations with the same name and |
1065 | the same parameter-type-list as well as member function template |
1066 | declarations with the same name, the same parameter-type-list, and |
1067 | the same template parameter lists cannot be overloaded if any of |
1068 | them, but not all, have a ref-qualifier. |
1069 | |
1070 | [namespace.udecl] When a using-declaration brings names |
1071 | from a base class into a derived class scope, member |
1072 | functions in the derived class override and/or hide member |
1073 | functions with the same name and parameter types in a base |
1074 | class (rather than conflicting). */ |
1075 | tree fn_type = TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1075, __FUNCTION__))->typed.type); |
1076 | tree method_type = TREE_TYPE (method)((contains_struct_check ((method), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1076, __FUNCTION__))->typed.type); |
1077 | |
1078 | /* Compare the quals on the 'this' parm. Don't compare |
1079 | the whole types, as used functions are treated as |
1080 | coming from the using class in overload resolution. */ |
1081 | if (! DECL_STATIC_FUNCTION_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/class.cc" , 1081, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1081, __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/class.cc" , 1081, __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/class.cc" , 1081, __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/class.cc" , 1081, __FUNCTION__); <->u.fn; })->static_function ) |
1082 | && ! DECL_STATIC_FUNCTION_P (method)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1082, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1082, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1082, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1082, __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/class.cc" , 1082, __FUNCTION__); <->u.fn; })->static_function ) |
1083 | /* Either both or neither need to be ref-qualified for |
1084 | differing quals to allow overloading. */ |
1085 | && (FUNCTION_REF_QUALIFIED (fn_type)((tree_not_check2 (((tree_check2 ((fn_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1085, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1085, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) |
1086 | == FUNCTION_REF_QUALIFIED (method_type)((tree_not_check2 (((tree_check2 ((method_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1086, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1086, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) |
1087 | && (type_memfn_quals (fn_type) != type_memfn_quals (method_type) |
1088 | || type_memfn_rqual (fn_type) != type_memfn_rqual (method_type))) |
1089 | continue; |
1090 | |
1091 | tree real_fn = fn; |
1092 | tree real_method = method; |
1093 | |
1094 | /* Templates and conversion ops must match return types. */ |
1095 | if ((DECL_CONV_FN_P (fn)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1095, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) || TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL) |
1096 | && !same_type_p (TREE_TYPE (fn_type), TREE_TYPE (method_type))comptypes ((((contains_struct_check ((fn_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1096, __FUNCTION__))->typed.type)), (((contains_struct_check ((method_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1096, __FUNCTION__))->typed.type)), 0)) |
1097 | continue; |
1098 | |
1099 | /* For templates, the template parameters must be identical. */ |
1100 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL) |
1101 | { |
1102 | if (!comp_template_parms (DECL_TEMPLATE_PARMS (fn)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1102, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments, |
1103 | DECL_TEMPLATE_PARMS (method)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1103, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments)) |
1104 | continue; |
1105 | |
1106 | real_fn = DECL_TEMPLATE_RESULT (fn)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1106, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
1107 | real_method = DECL_TEMPLATE_RESULT (method)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1107, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
1108 | } |
1109 | |
1110 | tree parms1 = TYPE_ARG_TYPES (fn_type)((tree_check2 ((fn_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1110, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
1111 | tree parms2 = TYPE_ARG_TYPES (method_type)((tree_check2 ((method_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1111, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
1112 | if (! DECL_STATIC_FUNCTION_P (real_fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (real_fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((real_fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1112, __FUNCTION__, (TEMPLATE_DECL))))))))->result : real_fn )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1112, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (real_fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (real_fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((real_fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1112, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((real_fn ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1112, __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/class.cc" , 1112, __FUNCTION__); <->u.fn; })->static_function )) |
1113 | parms1 = TREE_CHAIN (parms1)((contains_struct_check ((parms1), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1113, __FUNCTION__))->common.chain); |
1114 | if (! DECL_STATIC_FUNCTION_P (real_method)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (real_method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((real_method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1114, __FUNCTION__, (TEMPLATE_DECL))))))))->result : real_method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1114, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (real_method)->base.code) == FUNCTION_DECL || (((enum tree_code) (real_method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((real_method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1114, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((real_method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1114, __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/class.cc" , 1114, __FUNCTION__); <->u.fn; })->static_function )) |
1115 | parms2 = TREE_CHAIN (parms2)((contains_struct_check ((parms2), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1115, __FUNCTION__))->common.chain); |
1116 | |
1117 | /* Bring back parameters omitted from an inherited ctor. The |
1118 | method and the function can have different omittedness. */ |
1119 | if (ctor_omit_inherited_parms (real_fn)) |
1120 | parms1 = FUNCTION_FIRST_USER_PARMTYPE (DECL_CLONED_FUNCTION (real_fn))skip_artificial_parms_for (((((contains_struct_check (((tree_check ((real_fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1120, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1120, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)), ((tree_check2 ((((contains_struct_check (((((contains_struct_check (((tree_check ((real_fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1120, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1120, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1120, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1120, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); |
1121 | if (ctor_omit_inherited_parms (real_method)) |
1122 | parms2 = (FUNCTION_FIRST_USER_PARMTYPEskip_artificial_parms_for (((((contains_struct_check (((tree_check ((real_method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)), ((tree_check2 ((((contains_struct_check (((((contains_struct_check (((tree_check ((real_method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)) |
1123 | (DECL_CLONED_FUNCTION (real_method))skip_artificial_parms_for (((((contains_struct_check (((tree_check ((real_method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)), ((tree_check2 ((((contains_struct_check (((((contains_struct_check (((tree_check ((real_method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1123, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values))); |
1124 | |
1125 | if (!compparms (parms1, parms2)) |
1126 | continue; |
1127 | |
1128 | if (!equivalently_constrained (fn, method)) |
1129 | { |
1130 | if (processing_template_declscope_chain->x_processing_template_decl) |
1131 | /* We can't check satisfaction in dependent context, wait until |
1132 | the class is instantiated. */ |
1133 | continue; |
1134 | |
1135 | special_function_kind sfk = special_memfn_p (method); |
1136 | |
1137 | if (sfk == sfk_none |
1138 | || DECL_INHERITED_CTOR (fn)((((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/class.cc" , 1138, __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/class.cc" , 1138, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1138, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1138, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1138, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1138, __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/class.cc" , 1138, __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/class.cc" , 1138, __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/class.cc" , 1138, __FUNCTION__); <->u.fn; })->context : (tree ) __null) |
1139 | || TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL) |
1140 | /* Member function templates and non-special member functions |
1141 | coexist if they are not equivalently constrained. A member |
1142 | function is not hidden by an inherited constructor. */ |
1143 | continue; |
1144 | |
1145 | /* P0848: For special member functions, deleted, unsatisfied, or |
1146 | less constrained overloads are ineligible. We implement this |
1147 | by removing them from CLASSTYPE_MEMBER_VEC. Destructors don't |
1148 | use the notion of eligibility, and the selected destructor can |
1149 | be deleted, but removing unsatisfied or less constrained |
1150 | overloads has the same effect as overload resolution. */ |
1151 | bool dtor = (sfk == sfk_destructor); |
1152 | if (losem == -1) |
1153 | losem = ((!dtor && DECL_DELETED_FN (method)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1153, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1153, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1153, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1153, __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/class.cc" , 1153, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p )) |
1154 | || !constraints_satisfied_p (method)); |
1155 | bool losef = ((!dtor && DECL_DELETED_FN (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/class.cc" , 1155, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1155, __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/class.cc" , 1155, __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/class.cc" , 1155, __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/class.cc" , 1155, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p )) |
1156 | || !constraints_satisfied_p (fn)); |
1157 | int win; |
1158 | if (losem || losef) |
1159 | win = losem - losef; |
1160 | else |
1161 | win = more_constrained (fn, method); |
1162 | if (win > 0) |
1163 | /* Leave FN in the method vec, discard METHOD. */ |
1164 | return false; |
1165 | else if (win < 0) |
1166 | { |
1167 | /* Remove FN, add METHOD. */ |
1168 | current_fns = iter.remove_node (current_fns); |
1169 | continue; |
1170 | } |
1171 | else |
1172 | /* Let them coexist for now. */ |
1173 | continue; |
1174 | } |
1175 | |
1176 | /* If these are versions of the same function, process and |
1177 | move on. */ |
1178 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL |
1179 | && maybe_version_functions (method, fn, true)) |
1180 | continue; |
1181 | |
1182 | if (DECL_INHERITED_CTOR (method)((((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1182, __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/class.cc" , 1182, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) |
1183 | { |
1184 | if (!DECL_INHERITED_CTOR (fn)((((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/class.cc" , 1184, __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/class.cc" , 1184, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1184, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1184, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1184, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1184, __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/class.cc" , 1184, __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/class.cc" , 1184, __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/class.cc" , 1184, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) |
1185 | /* Defer to the other function. */ |
1186 | return false; |
1187 | |
1188 | tree basem = DECL_INHERITED_CTOR_BASE (method)(((((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __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/class.cc" , 1188, __FUNCTION__); <->u.fn; })->context : (tree ) __null) ? ((contains_struct_check ((global_options.x_flag_new_inheriting_ctors ? strip_inheriting_ctors (method) : ((((enum tree_code) (method )->base.code) == FUNCTION_DECL || (((enum tree_code) (method )->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __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/class.cc" , 1188, __FUNCTION__); <->u.fn; })->context : (tree ) __null)), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1188, __FUNCTION__))->decl_minimal.context) : (tree) __null ); |
1189 | tree basef = DECL_INHERITED_CTOR_BASE (fn)(((((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/class.cc" , 1189, __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/class.cc" , 1189, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1189, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1189, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1189, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1189, __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/class.cc" , 1189, __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/class.cc" , 1189, __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/class.cc" , 1189, __FUNCTION__); <->u.fn; })->context : (tree ) __null) ? ((contains_struct_check ((global_options.x_flag_new_inheriting_ctors ? strip_inheriting_ctors (fn) : ((((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/class.cc" , 1189, __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/class.cc" , 1189, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1189, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1189, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1189, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1189, __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/class.cc" , 1189, __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/class.cc" , 1189, __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/class.cc" , 1189, __FUNCTION__); <->u.fn; })->context : (tree ) __null)), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1189, __FUNCTION__))->decl_minimal.context) : (tree) __null ); |
1190 | if (flag_new_inheriting_ctorsglobal_options.x_flag_new_inheriting_ctors) |
1191 | { |
1192 | if (basem == basef) |
1193 | { |
1194 | /* Inheriting the same constructor along different |
1195 | paths, combine them. */ |
1196 | SET_DECL_INHERITED_CTOR(__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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__); <->u.fn; })->context = (ovl_make (((((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __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/class.cc" , 1197, __FUNCTION__); <->u.fn; })->context : (tree ) __null), ((((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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__); <->u.fn; })->context : (tree ) __null)))) |
1197 | (fn, ovl_make (DECL_INHERITED_CTOR (method),(__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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__); <->u.fn; })->context = (ovl_make (((((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __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/class.cc" , 1197, __FUNCTION__); <->u.fn; })->context : (tree ) __null), ((((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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__); <->u.fn; })->context : (tree ) __null)))) |
1198 | DECL_INHERITED_CTOR (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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__); <->u.fn; })->context = (ovl_make (((((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (method)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result : method )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (method)->base.code) == FUNCTION_DECL || (((enum tree_code) (method)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((method ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1197, __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/class.cc" , 1197, __FUNCTION__); <->u.fn; })->context : (tree ) __null), ((((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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1198, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __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/class.cc" , 1198, __FUNCTION__); <->u.fn; })->context : (tree ) __null)))); |
1199 | /* And discard the new one. */ |
1200 | return false; |
1201 | } |
1202 | else |
1203 | /* Inherited ctors can coexist until overload |
1204 | resolution. */ |
1205 | continue; |
1206 | } |
1207 | |
1208 | error_at (DECL_SOURCE_LOCATION (method)((contains_struct_check ((method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1208, __FUNCTION__))->decl_minimal.locus), |
1209 | "%q#D conflicts with version inherited from %qT", |
1210 | method, basef); |
1211 | inform (DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1211, __FUNCTION__))->decl_minimal.locus), |
1212 | "version inherited from %qT declared here", |
1213 | basef); |
1214 | return false; |
1215 | } |
1216 | |
1217 | if (via_using) |
1218 | /* Defer to the local function. */ |
1219 | return false; |
1220 | else if (iter.using_p () |
1221 | || (flag_new_inheriting_ctorsglobal_options.x_flag_new_inheriting_ctors |
1222 | && DECL_INHERITED_CTOR (fn)((((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/class.cc" , 1222, __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/class.cc" , 1222, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((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/class.cc" , 1222, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1222, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __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/class.cc" , 1222, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1222, __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/class.cc" , 1222, __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/class.cc" , 1222, __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/class.cc" , 1222, __FUNCTION__); <->u.fn; })->context : (tree ) __null))) |
1223 | { |
1224 | /* Remove the inherited function. */ |
1225 | current_fns = iter.remove_node (current_fns); |
1226 | continue; |
1227 | } |
1228 | else |
1229 | { |
1230 | error_at (DECL_SOURCE_LOCATION (method)((contains_struct_check ((method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1230, __FUNCTION__))->decl_minimal.locus), |
1231 | "%q#D cannot be overloaded with %q#D", method, fn); |
1232 | inform (DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1232, __FUNCTION__))->decl_minimal.locus), |
1233 | "previous declaration %q#D", fn); |
1234 | return false; |
1235 | } |
1236 | } |
1237 | |
1238 | current_fns = ovl_insert (method, current_fns, via_using); |
1239 | |
1240 | if (!COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__))->type_common.size) != (tree) __null ) && !DECL_CONV_FN_P (method)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1240, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
1241 | && !push_class_level_binding (DECL_NAME (method)((contains_struct_check ((method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1241, __FUNCTION__))->decl_minimal.name), current_fns)) |
1242 | return false; |
1243 | |
1244 | if (!slot) |
1245 | slot = add_member_slot (type, DECL_NAME (method)((contains_struct_check ((method), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1245, __FUNCTION__))->decl_minimal.name)); |
1246 | |
1247 | /* Maintain TYPE_HAS_USER_CONSTRUCTOR, etc. */ |
1248 | grok_special_member_properties (method); |
1249 | |
1250 | *slot = current_fns; |
1251 | |
1252 | return true; |
1253 | } |
1254 | |
1255 | /* Subroutines of finish_struct. */ |
1256 | |
1257 | /* Change the access of FDECL to ACCESS in T. Return 1 if change was |
1258 | legit, otherwise return 0. */ |
1259 | |
1260 | static int |
1261 | alter_access (tree t, tree fdecl, tree access) |
1262 | { |
1263 | tree elem; |
1264 | |
1265 | retrofit_lang_decl (fdecl); |
1266 | |
1267 | gcc_assert (!DECL_DISCRIMINATOR_P (fdecl))((void)(!(!(((((enum tree_code) (fdecl)->base.code) == VAR_DECL && ((fdecl)->base.static_flag)) || (((enum tree_code ) (fdecl)->base.code) == TYPE_DECL && ((contains_struct_check ((fdecl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1267, __FUNCTION__))->decl_common.lang_flag_2))) && (((contains_struct_check ((fdecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1267, __FUNCTION__))->decl_minimal.context) && ( (enum tree_code) (((contains_struct_check ((fdecl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1267, __FUNCTION__))->decl_minimal.context))->base.code ) == FUNCTION_DECL))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1267, __FUNCTION__), 0 : 0)); |
1268 | |
1269 | elem = purpose_member (t, DECL_ACCESS (fdecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((fdecl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1269, __FUNCTION__))->decl_common.lang_specific); if (!( (((enum tree_code) (fdecl)->base.code) == VAR_DECL || ((enum tree_code) (fdecl)->base.code) == FUNCTION_DECL) || ((enum tree_code) (fdecl)->base.code) == FIELD_DECL || ((enum tree_code ) (fdecl)->base.code) == CONST_DECL || ((enum tree_code) ( fdecl)->base.code) == TYPE_DECL || ((enum tree_code) (fdecl )->base.code) == TEMPLATE_DECL || ((enum tree_code) (fdecl )->base.code) == USING_DECL || ((enum tree_code) (fdecl)-> base.code) == CONCEPT_DECL)) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1269, __FUNCTION__); <->u.min; })->access)); |
1270 | if (elem) |
1271 | { |
1272 | if (TREE_VALUE (elem)((tree_check ((elem), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1272, __FUNCTION__, (TREE_LIST)))->list.value) != access) |
1273 | { |
1274 | if (TREE_CODE (TREE_TYPE (fdecl))((enum tree_code) (((contains_struct_check ((fdecl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1274, __FUNCTION__))->typed.type))->base.code) == FUNCTION_DECL) |
1275 | error ("conflicting access specifications for method" |
1276 | " %q+D, ignored", TREE_TYPE (fdecl)((contains_struct_check ((fdecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1276, __FUNCTION__))->typed.type)); |
1277 | else |
1278 | error ("conflicting access specifications for field %qE, ignored", |
1279 | DECL_NAME (fdecl)((contains_struct_check ((fdecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1279, __FUNCTION__))->decl_minimal.name)); |
1280 | } |
1281 | else |
1282 | { |
1283 | /* They're changing the access to the same thing they changed |
1284 | it to before. That's OK. */ |
1285 | ; |
1286 | } |
1287 | } |
1288 | else |
1289 | { |
1290 | perform_or_defer_access_check (TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1290, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), fdecl, fdecl, |
1291 | tf_warning_or_error); |
1292 | DECL_ACCESS (fdecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((fdecl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1292, __FUNCTION__))->decl_common.lang_specific); if (!( (((enum tree_code) (fdecl)->base.code) == VAR_DECL || ((enum tree_code) (fdecl)->base.code) == FUNCTION_DECL) || ((enum tree_code) (fdecl)->base.code) == FIELD_DECL || ((enum tree_code ) (fdecl)->base.code) == CONST_DECL || ((enum tree_code) ( fdecl)->base.code) == TYPE_DECL || ((enum tree_code) (fdecl )->base.code) == TEMPLATE_DECL || ((enum tree_code) (fdecl )->base.code) == USING_DECL || ((enum tree_code) (fdecl)-> base.code) == CONCEPT_DECL)) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1292, __FUNCTION__); <->u.min; })->access) = tree_cons (t, access, DECL_ACCESS (fdecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((fdecl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1292, __FUNCTION__))->decl_common.lang_specific); if (!( (((enum tree_code) (fdecl)->base.code) == VAR_DECL || ((enum tree_code) (fdecl)->base.code) == FUNCTION_DECL) || ((enum tree_code) (fdecl)->base.code) == FIELD_DECL || ((enum tree_code ) (fdecl)->base.code) == CONST_DECL || ((enum tree_code) ( fdecl)->base.code) == TYPE_DECL || ((enum tree_code) (fdecl )->base.code) == TEMPLATE_DECL || ((enum tree_code) (fdecl )->base.code) == USING_DECL || ((enum tree_code) (fdecl)-> base.code) == CONCEPT_DECL)) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1292, __FUNCTION__); <->u.min; })->access)); |
1293 | return 1; |
1294 | } |
1295 | return 0; |
1296 | } |
1297 | |
1298 | /* Return the access node for DECL's access in its enclosing class. */ |
1299 | |
1300 | tree |
1301 | declared_access (tree decl) |
1302 | { |
1303 | return (TREE_PRIVATE (decl)((decl)->base.private_flag) ? access_private_nodeglobal_trees[TI_PRIVATE] |
1304 | : TREE_PROTECTED (decl)((decl)->base.protected_flag) ? access_protected_nodeglobal_trees[TI_PROTECTED] |
1305 | : access_public_nodeglobal_trees[TI_PUBLIC]); |
1306 | } |
1307 | |
1308 | /* If DECL is a non-dependent using of non-ctor function members, push them |
1309 | and return true, otherwise return false. Called from |
1310 | finish_member_declaration. */ |
1311 | |
1312 | bool |
1313 | maybe_push_used_methods (tree decl) |
1314 | { |
1315 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != USING_DECL) |
1316 | return false; |
1317 | tree used = strip_using_decl (decl); |
1318 | if (!used || !is_overloaded_fn (used)) |
1319 | return false; |
1320 | |
1321 | /* Add the functions to CLASSTYPE_MEMBER_VEC so that overload resolution |
1322 | works within the class body. */ |
1323 | for (tree f : ovl_range (used)) |
1324 | { |
1325 | if (DECL_CONSTRUCTOR_P (f)((tree_check (((((enum tree_code) (f)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((f), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1325, __FUNCTION__, (TEMPLATE_DECL))))))))->result : f)) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1325, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) |
1326 | /* Inheriting constructors are handled separately. */ |
1327 | return false; |
1328 | |
1329 | bool added = add_method (current_class_typescope_chain->class_type, f, true); |
1330 | |
1331 | if (added) |
1332 | alter_access (current_class_typescope_chain->class_type, f, current_access_specifierscope_chain->access_specifier); |
1333 | |
1334 | /* If add_method returns false because f was already declared, look |
1335 | for a duplicate using-declaration. */ |
1336 | else |
1337 | for (tree d = TYPE_FIELDS (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1337, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); d; d = DECL_CHAIN (d)(((contains_struct_check (((contains_struct_check ((d), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1337, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1337, __FUNCTION__))->common.chain))) |
1338 | if (TREE_CODE (d)((enum tree_code) (d)->base.code) == USING_DECL |
1339 | && DECL_NAME (d)((contains_struct_check ((d), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1339, __FUNCTION__))->decl_minimal.name) == DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1339, __FUNCTION__))->decl_minimal.name) |
1340 | && same_type_p (USING_DECL_SCOPE (d), USING_DECL_SCOPE (decl))comptypes ((((contains_struct_check (((tree_check ((d), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1340, __FUNCTION__, (USING_DECL)))), (TS_DECL_NON_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1340, __FUNCTION__))->decl_non_common.result)), (((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1340, __FUNCTION__, (USING_DECL)))), (TS_DECL_NON_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1340, __FUNCTION__))->decl_non_common.result)), 0)) |
1341 | { |
1342 | diagnose_name_conflict (decl, d); |
1343 | break; |
1344 | } |
1345 | } |
1346 | return true; |
1347 | } |
1348 | |
1349 | /* Process the USING_DECL, which is a member of T. */ |
1350 | |
1351 | static void |
1352 | handle_using_decl (tree using_decl, tree t) |
1353 | { |
1354 | tree decl = USING_DECL_DECLS (using_decl)((contains_struct_check (((tree_check ((using_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1354, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1354, __FUNCTION__))->decl_common.initial); |
1355 | |
1356 | gcc_assert (!processing_template_decl && decl)((void)(!(!scope_chain->x_processing_template_decl && decl) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1356, __FUNCTION__), 0 : 0)); |
1357 | |
1358 | cp_emit_debug_info_for_using (decl, t); |
1359 | |
1360 | if (is_overloaded_fn (decl)) |
1361 | /* Handled in maybe_push_used_methods. */ |
1362 | return; |
1363 | |
1364 | tree name = DECL_NAME (using_decl)((contains_struct_check ((using_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1364, __FUNCTION__))->decl_minimal.name); |
1365 | tree old_value = lookup_member (t, name, /*protect=*/0, /*want_type=*/false, |
1366 | tf_warning_or_error); |
1367 | if (old_value) |
1368 | { |
1369 | old_value = OVL_FIRST (old_value)ovl_first (old_value); |
1370 | |
1371 | if (DECL_P (old_value)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (old_value)->base.code))] == tcc_declaration) && DECL_CONTEXT (old_value)((contains_struct_check ((old_value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1371, __FUNCTION__))->decl_minimal.context) == t) |
1372 | /* OK */; |
1373 | else |
1374 | old_value = NULL_TREE(tree) __null; |
1375 | } |
1376 | |
1377 | if (! old_value) |
1378 | ; |
1379 | else if (is_overloaded_fn (old_value)) |
1380 | { |
1381 | error_at (DECL_SOURCE_LOCATION (using_decl)((contains_struct_check ((using_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1381, __FUNCTION__))->decl_minimal.locus), "%qD invalid in %q#T " |
1382 | "because of local method %q#D with same name", |
1383 | using_decl, t, old_value); |
1384 | inform (DECL_SOURCE_LOCATION (old_value)((contains_struct_check ((old_value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1384, __FUNCTION__))->decl_minimal.locus), |
1385 | "local method %q#D declared here", old_value); |
1386 | return; |
1387 | } |
1388 | else if (!DECL_ARTIFICIAL (old_value)((contains_struct_check ((old_value), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1388, __FUNCTION__))->decl_common.artificial_flag)) |
1389 | { |
1390 | error_at (DECL_SOURCE_LOCATION (using_decl)((contains_struct_check ((using_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1390, __FUNCTION__))->decl_minimal.locus), "%qD invalid in %q#T " |
1391 | "because of local member %q#D with same name", |
1392 | using_decl, t, old_value); |
1393 | inform (DECL_SOURCE_LOCATION (old_value)((contains_struct_check ((old_value), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1393, __FUNCTION__))->decl_minimal.locus), |
1394 | "local member %q#D declared here", old_value); |
1395 | return; |
1396 | } |
1397 | |
1398 | iloc_sentinel ils (DECL_SOURCE_LOCATION (using_decl)((contains_struct_check ((using_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1398, __FUNCTION__))->decl_minimal.locus)); |
1399 | tree access = declared_access (using_decl); |
1400 | |
1401 | /* Make type T see field decl FDECL with access ACCESS. */ |
1402 | if (USING_DECL_UNRELATED_P (using_decl)((contains_struct_check (((tree_check ((using_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1402, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1402, __FUNCTION__))->decl_common.lang_flag_2)) |
1403 | { |
1404 | /* C++20 using enum can import non-inherited enumerators into class |
1405 | scope. We implement that by making a copy of the CONST_DECL for which |
1406 | CONST_DECL_USING_P is true. */ |
1407 | gcc_assert (TREE_CODE (decl) == CONST_DECL)((void)(!(((enum tree_code) (decl)->base.code) == CONST_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1407, __FUNCTION__), 0 : 0)); |
1408 | |
1409 | auto cas = make_temp_override (current_access_specifierscope_chain->access_specifier, access); |
1410 | tree copy = copy_decl (decl); |
1411 | DECL_CONTEXT (copy)((contains_struct_check ((copy), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1411, __FUNCTION__))->decl_minimal.context) = t; |
1412 | DECL_ARTIFICIAL (copy)((contains_struct_check ((copy), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1412, __FUNCTION__))->decl_common.artificial_flag) = true; |
1413 | /* We emitted debug info for the USING_DECL above; make sure we don't |
1414 | also emit anything for this clone. */ |
1415 | DECL_IGNORED_P (copy)((contains_struct_check ((copy), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1415, __FUNCTION__))->decl_common.ignored_flag) = true; |
1416 | DECL_SOURCE_LOCATION (copy)((contains_struct_check ((copy), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1416, __FUNCTION__))->decl_minimal.locus) = DECL_SOURCE_LOCATION (using_decl)((contains_struct_check ((using_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1416, __FUNCTION__))->decl_minimal.locus); |
1417 | finish_member_declaration (copy); |
1418 | DECL_ABSTRACT_ORIGIN (copy)((contains_struct_check ((copy), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1418, __FUNCTION__))->decl_common.abstract_origin) = decl; |
1419 | } |
1420 | else |
1421 | alter_access (t, decl, access); |
1422 | } |
1423 | |
1424 | /* Data structure for find_abi_tags_r, below. */ |
1425 | |
1426 | struct abi_tag_data |
1427 | { |
1428 | tree t; // The type that we're checking for missing tags. |
1429 | tree subob; // The subobject of T that we're getting tags from. |
1430 | tree tags; // error_mark_node for diagnostics, or a list of missing tags. |
1431 | }; |
1432 | |
1433 | /* Subroutine of find_abi_tags_r. Handle a single TAG found on the class TP |
1434 | in the context of P. TAG can be either an identifier (the DECL_NAME of |
1435 | a tag NAMESPACE_DECL) or a STRING_CST (a tag attribute). */ |
1436 | |
1437 | static void |
1438 | check_tag (tree tag, tree id, tree *tp, abi_tag_data *p) |
1439 | { |
1440 | if (!IDENTIFIER_MARKED (id)((tree_not_check2 (((tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1440, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1440, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) |
1441 | { |
1442 | if (p->tags != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1443 | { |
1444 | /* We're collecting tags from template arguments or from |
1445 | the type of a variable or function return type. */ |
1446 | p->tags = tree_cons (NULL_TREE(tree) __null, tag, p->tags); |
1447 | |
1448 | /* Don't inherit this tag multiple times. */ |
1449 | IDENTIFIER_MARKED (id)((tree_not_check2 (((tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1449, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1449, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) = true; |
1450 | |
1451 | if (TYPE_P (p->t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (p->t)->base.code))] == tcc_type)) |
1452 | { |
1453 | /* Tags inherited from type template arguments are only used |
1454 | to avoid warnings. */ |
1455 | ABI_TAG_IMPLICIT (p->tags)((tree_not_check2 (((tree_check ((p->tags), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1455, __FUNCTION__, (TREE_LIST)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1455, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = true; |
1456 | return; |
1457 | } |
1458 | /* For functions and variables we want to warn, too. */ |
1459 | } |
1460 | |
1461 | /* Otherwise we're diagnosing missing tags. */ |
1462 | if (TREE_CODE (p->t)((enum tree_code) (p->t)->base.code) == FUNCTION_DECL) |
1463 | { |
1464 | auto_diagnostic_group d; |
1465 | if (warning (OPT_Wabi_tag, "%qD inherits the %E ABI tag " |
1466 | "that %qT (used in its return type) has", |
1467 | p->t, tag, *tp)) |
1468 | inform (location_of (*tp), "%qT declared here", *tp); |
1469 | } |
1470 | else if (VAR_P (p->t)(((enum tree_code) (p->t)->base.code) == VAR_DECL)) |
1471 | { |
1472 | auto_diagnostic_group d; |
1473 | if (warning (OPT_Wabi_tag, "%qD inherits the %E ABI tag " |
1474 | "that %qT (used in its type) has", p->t, tag, *tp)) |
1475 | inform (location_of (*tp), "%qT declared here", *tp); |
1476 | } |
1477 | else if (TYPE_P (p->subob)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (p->subob)->base.code))] == tcc_type)) |
1478 | { |
1479 | auto_diagnostic_group d; |
1480 | if (warning (OPT_Wabi_tag, "%qT does not have the %E ABI tag " |
1481 | "that base %qT has", p->t, tag, p->subob)) |
1482 | inform (location_of (p->subob), "%qT declared here", |
1483 | p->subob); |
1484 | } |
1485 | else |
1486 | { |
1487 | auto_diagnostic_group d; |
1488 | if (warning (OPT_Wabi_tag, "%qT does not have the %E ABI tag " |
1489 | "that %qT (used in the type of %qD) has", |
1490 | p->t, tag, *tp, p->subob)) |
1491 | { |
1492 | inform (location_of (p->subob), "%qD declared here", |
1493 | p->subob); |
1494 | inform (location_of (*tp), "%qT declared here", *tp); |
1495 | } |
1496 | } |
1497 | } |
1498 | } |
1499 | |
1500 | /* Find all the ABI tags in the attribute list ATTR and either call |
1501 | check_tag (if TP is non-null) or set IDENTIFIER_MARKED to val. */ |
1502 | |
1503 | static void |
1504 | mark_or_check_attr_tags (tree attr, tree *tp, abi_tag_data *p, bool val) |
1505 | { |
1506 | if (!attr) |
1507 | return; |
1508 | for (; (attr = lookup_attribute ("abi_tag", attr)); |
1509 | attr = TREE_CHAIN (attr)((contains_struct_check ((attr), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1509, __FUNCTION__))->common.chain)) |
1510 | for (tree list = TREE_VALUE (attr)((tree_check ((attr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1510, __FUNCTION__, (TREE_LIST)))->list.value); list; |
1511 | list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1511, __FUNCTION__))->common.chain)) |
1512 | { |
1513 | tree tag = TREE_VALUE (list)((tree_check ((list), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1513, __FUNCTION__, (TREE_LIST)))->list.value); |
1514 | tree id = get_identifier (TREE_STRING_POINTER (tag))(__builtin_constant_p (((const char *)((tree_check ((tag), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1514, __FUNCTION__, (STRING_CST)))->string.str))) ? get_identifier_with_length ((((const char *)((tree_check ((tag), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1514, __FUNCTION__, (STRING_CST)))->string.str))), strlen (((const char *)((tree_check ((tag), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1514, __FUNCTION__, (STRING_CST)))->string.str)))) : get_identifier (((const char *)((tree_check ((tag), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1514, __FUNCTION__, (STRING_CST)))->string.str)))); |
1515 | if (tp) |
1516 | check_tag (tag, id, tp, p); |
1517 | else |
1518 | IDENTIFIER_MARKED (id)((tree_not_check2 (((tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1518, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1518, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) = val; |
1519 | } |
1520 | } |
1521 | |
1522 | /* Find all the ABI tags on T and its enclosing scopes and either call |
1523 | check_tag (if TP is non-null) or set IDENTIFIER_MARKED to val. */ |
1524 | |
1525 | static void |
1526 | mark_or_check_tags (tree t, tree *tp, abi_tag_data *p, bool val) |
1527 | { |
1528 | while (t != global_namespacecp_global_trees[CPTI_GLOBAL]) |
1529 | { |
1530 | tree attr; |
1531 | if (TYPE_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (t)->base.code))] == tcc_type)) |
1532 | { |
1533 | attr = TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1533, __FUNCTION__))->type_common.attributes); |
1534 | t = CP_TYPE_CONTEXT (t)(!(! (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1534, __FUNCTION__))->type_common.context)) || ((enum tree_code ) (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1534, __FUNCTION__))->type_common.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((t), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1534, __FUNCTION__))->type_common.context) : cp_global_trees [CPTI_GLOBAL]); |
1535 | } |
1536 | else |
1537 | { |
1538 | attr = DECL_ATTRIBUTES (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1538, __FUNCTION__))->decl_common.attributes); |
1539 | t = CP_DECL_CONTEXT (t)(!(! (((contains_struct_check ((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1539, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1539, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((t), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1539, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]); |
1540 | } |
1541 | mark_or_check_attr_tags (attr, tp, p, val); |
1542 | } |
1543 | } |
1544 | |
1545 | /* walk_tree callback for check_abi_tags: if the type at *TP involves any |
1546 | types with ABI tags, add the corresponding identifiers to the VEC in |
1547 | *DATA and set IDENTIFIER_MARKED. */ |
1548 | |
1549 | static tree |
1550 | find_abi_tags_r (tree *tp, int *walk_subtrees, void *data) |
1551 | { |
1552 | if (TYPE_P (*tp)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (*tp)->base.code))] == tcc_type) && *walk_subtrees == 1 && flag_abi_versionglobal_options.x_flag_abi_version != 14) |
1553 | /* Tell cp_walk_subtrees to look though typedefs. [PR98481] */ |
1554 | *walk_subtrees = 2; |
1555 | |
1556 | 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/class.cc" , 1556, __FUNCTION__))->type_common.lang_flag_5)) || ((enum tree_code) (*tp)->base.code) == ENUMERAL_TYPE)) |
1557 | return NULL_TREE(tree) __null; |
1558 | |
1559 | /* walk_tree shouldn't be walking into any subtrees of a RECORD_TYPE |
1560 | anyway, but let's make sure of it. */ |
1561 | *walk_subtrees = false; |
1562 | |
1563 | abi_tag_data *p = static_cast<struct abi_tag_data*>(data); |
1564 | |
1565 | mark_or_check_tags (*tp, tp, p, false); |
1566 | |
1567 | return NULL_TREE(tree) __null; |
1568 | } |
1569 | |
1570 | /* walk_tree callback for mark_abi_tags: if *TP is a class, set |
1571 | IDENTIFIER_MARKED on its ABI tags. */ |
1572 | |
1573 | static tree |
1574 | mark_abi_tags_r (tree *tp, int *walk_subtrees, void *data) |
1575 | { |
1576 | if (TYPE_P (*tp)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (*tp)->base.code))] == tcc_type) && *walk_subtrees == 1 && flag_abi_versionglobal_options.x_flag_abi_version != 14) |
1577 | /* Tell cp_walk_subtrees to look though typedefs. */ |
1578 | *walk_subtrees = 2; |
1579 | |
1580 | 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/class.cc" , 1580, __FUNCTION__))->type_common.lang_flag_5)) || ((enum tree_code) (*tp)->base.code) == ENUMERAL_TYPE)) |
1581 | return NULL_TREE(tree) __null; |
1582 | |
1583 | /* walk_tree shouldn't be walking into any subtrees of a RECORD_TYPE |
1584 | anyway, but let's make sure of it. */ |
1585 | *walk_subtrees = false; |
1586 | |
1587 | bool *valp = static_cast<bool*>(data); |
1588 | |
1589 | mark_or_check_tags (*tp, NULL__null, NULL__null, *valp); |
1590 | |
1591 | return NULL_TREE(tree) __null; |
1592 | } |
1593 | |
1594 | /* Set IDENTIFIER_MARKED on all the ABI tags on T and its enclosing |
1595 | scopes. */ |
1596 | |
1597 | static void |
1598 | mark_abi_tags (tree t, bool val) |
1599 | { |
1600 | mark_or_check_tags (t, NULL__null, NULL__null, val); |
1601 | if (DECL_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (t)->base.code))] == tcc_declaration)) |
1602 | { |
1603 | if (DECL_LANG_SPECIFIC (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1603, __FUNCTION__))->decl_common.lang_specific) && DECL_USE_TEMPLATE (t)(((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1603, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) |
1604 | && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check (((((contains_struct_check ( (template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1604, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))) |
1605 | { |
1606 | /* Template arguments are part of the signature. */ |
1607 | tree level = INNERMOST_TEMPLATE_ARGS (DECL_TI_ARGS (t))(get_innermost_template_args ((((struct tree_template_info*)( tree_check (((((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1607, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1607, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1607, __FUNCTION__, (TEMPLATE_INFO))))->args), 1)); |
1608 | for (int j = 0; j < TREE_VEC_LENGTH (level)((tree_check ((level), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1608, __FUNCTION__, (TREE_VEC)))->base.u.length); ++j) |
1609 | { |
1610 | tree arg = TREE_VEC_ELT (level, j)(*((const_cast<tree *> (tree_vec_elt_check ((level), (j ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1610, __FUNCTION__))))); |
1611 | cp_walk_tree_without_duplicates (&arg, mark_abi_tags_r, &val)walk_tree_without_duplicates_1 (&arg, mark_abi_tags_r, & val, cp_walk_subtrees); |
1612 | } |
1613 | } |
1614 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FUNCTION_DECL) |
1615 | /* A function's parameter types are part of the signature, so |
1616 | we don't need to inherit any tags that are also in them. */ |
1617 | for (tree arg = FUNCTION_FIRST_USER_PARMTYPE (t)skip_artificial_parms_for ((t), ((tree_check2 ((((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1617, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1617, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); arg; |
1618 | arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1618, __FUNCTION__))->common.chain)) |
1619 | cp_walk_tree_without_duplicates (&TREE_VALUE (arg),walk_tree_without_duplicates_1 (&((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1619, __FUNCTION__, (TREE_LIST)))->list.value), mark_abi_tags_r , &val, cp_walk_subtrees) |
1620 | mark_abi_tags_r, &val)walk_tree_without_duplicates_1 (&((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1619, __FUNCTION__, (TREE_LIST)))->list.value), mark_abi_tags_r , &val, cp_walk_subtrees); |
1621 | } |
1622 | } |
1623 | |
1624 | /* Check that T has all the ABI tags that subobject SUBOB has, or |
1625 | warn if not. If T is a (variable or function) declaration, also |
1626 | return any missing tags, and add them to T if JUST_CHECKING is false. */ |
1627 | |
1628 | static tree |
1629 | check_abi_tags (tree t, tree subob, bool just_checking = false) |
1630 | { |
1631 | bool inherit = DECL_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (t)->base.code))] == tcc_declaration); |
1632 | |
1633 | if (!inherit && !warn_abi_tagglobal_options.x_warn_abi_tag) |
1634 | return NULL_TREE(tree) __null; |
1635 | |
1636 | tree decl = TYPE_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (t)->base.code))] == tcc_type) ? TYPE_NAME (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1636, __FUNCTION__))->type_common.name) : t; |
1637 | if (!TREE_PUBLIC (decl)((decl)->base.public_flag)) |
1638 | /* No need to worry about things local to this TU. */ |
1639 | return NULL_TREE(tree) __null; |
1640 | |
1641 | mark_abi_tags (t, true); |
1642 | |
1643 | tree subtype = TYPE_P (subob)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (subob)->base.code))] == tcc_type) ? subob : TREE_TYPE (subob)((contains_struct_check ((subob), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1643, __FUNCTION__))->typed.type); |
1644 | struct abi_tag_data data = { t, subob, error_mark_nodeglobal_trees[TI_ERROR_MARK] }; |
1645 | if (inherit) |
1646 | data.tags = NULL_TREE(tree) __null; |
1647 | |
1648 | cp_walk_tree_without_duplicates (&subtype, find_abi_tags_r, &data)walk_tree_without_duplicates_1 (&subtype, find_abi_tags_r , &data, cp_walk_subtrees); |
1649 | |
1650 | if (!(inherit && data.tags)) |
1651 | /* We don't need to do anything with data.tags. */; |
1652 | else if (just_checking) |
1653 | for (tree t = data.tags; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1653, __FUNCTION__))->common.chain)) |
1654 | { |
1655 | tree id = get_identifier (TREE_STRING_POINTER (TREE_VALUE (t)))(__builtin_constant_p (((const char *)((tree_check ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (STRING_CST)))->string.str))) ? get_identifier_with_length ((((const char *)((tree_check ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (STRING_CST)))->string.str))), strlen (((const char *)((tree_check ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (STRING_CST)))->string.str)))) : get_identifier (((const char *)((tree_check ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1655, __FUNCTION__, (STRING_CST)))->string.str)))); |
1656 | IDENTIFIER_MARKED (id)((tree_not_check2 (((tree_check ((id), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1656, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1656, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) = false; |
1657 | } |
1658 | else |
1659 | { |
1660 | tree attr = lookup_attribute ("abi_tag", DECL_ATTRIBUTES (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1660, __FUNCTION__))->decl_common.attributes)); |
1661 | if (attr) |
1662 | TREE_VALUE (attr)((tree_check ((attr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1662, __FUNCTION__, (TREE_LIST)))->list.value) = chainon (data.tags, TREE_VALUE (attr)((tree_check ((attr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1662, __FUNCTION__, (TREE_LIST)))->list.value)); |
1663 | else |
1664 | DECL_ATTRIBUTES (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1664, __FUNCTION__))->decl_common.attributes) |
1665 | = tree_cons (abi_tag_identifiercp_global_trees[CPTI_ABI_TAG_IDENTIFIER], data.tags, DECL_ATTRIBUTES (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1665, __FUNCTION__))->decl_common.attributes)); |
1666 | } |
1667 | |
1668 | mark_abi_tags (t, false); |
1669 | |
1670 | return data.tags; |
1671 | } |
1672 | |
1673 | /* Check that DECL has all the ABI tags that are used in parts of its type |
1674 | that are not reflected in its mangled name. */ |
1675 | |
1676 | void |
1677 | check_abi_tags (tree decl) |
1678 | { |
1679 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
1680 | check_abi_tags (decl, TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1680, __FUNCTION__))->typed.type)); |
1681 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
1682 | && !DECL_CONV_FN_P (decl)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __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/class.cc" , 1682, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1682, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
1683 | && !mangle_return_type_p (decl)) |
1684 | check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1684, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1684, __FUNCTION__))->typed.type)); |
1685 | } |
1686 | |
1687 | /* Return any ABI tags that are used in parts of the type of DECL |
1688 | that are not reflected in its mangled name. This function is only |
1689 | used in backward-compatible mangling for ABI <11. */ |
1690 | |
1691 | tree |
1692 | missing_abi_tags (tree decl) |
1693 | { |
1694 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
1695 | return check_abi_tags (decl, TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1695, __FUNCTION__))->typed.type), true); |
1696 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL |
1697 | /* Don't check DECL_CONV_FN_P here like we do in check_abi_tags, so |
1698 | that we can use this function for setting need_abi_warning |
1699 | regardless of the current flag_abi_version. */ |
1700 | && !mangle_return_type_p (decl)) |
1701 | return check_abi_tags (decl, TREE_TYPE (TREE_TYPE (decl))((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1701, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1701, __FUNCTION__))->typed.type), true); |
1702 | else |
1703 | return NULL_TREE(tree) __null; |
1704 | } |
1705 | |
1706 | void |
1707 | inherit_targ_abi_tags (tree t) |
1708 | { |
1709 | if (!CLASS_TYPE_P (t)(((((enum tree_code) (t)->base.code)) == RECORD_TYPE || (( (enum tree_code) (t)->base.code)) == UNION_TYPE) && ((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1709, __FUNCTION__))->type_common.lang_flag_5)) |
1710 | || CLASSTYPE_TEMPLATE_INFO (t)(((tree_class_check (((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1710, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1710, __FUNCTION__))->type_non_common.lang_1)) == NULL_TREE(tree) __null) |
1711 | return; |
1712 | |
1713 | mark_abi_tags (t, true); |
1714 | |
1715 | tree args = CLASSTYPE_TI_ARGS (t)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1715, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1715, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1715, __FUNCTION__, (TEMPLATE_INFO))))->args; |
1716 | struct abi_tag_data data = { t, NULL_TREE(tree) __null, NULL_TREE(tree) __null }; |
1717 | for (int i = 0; i < TMPL_ARGS_DEPTH (args)((args) == (tree) __null ? 0 : (args && ((tree_check ( (args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1717, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1717, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1717, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1717, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1); ++i) |
1718 | { |
1719 | tree level = TMPL_ARGS_LEVEL (args, i+1)((args && ((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1719, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1719, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1719, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*(( const_cast<tree *> (tree_vec_elt_check ((args), ((i+1) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1719, __FUNCTION__))))) : (((void)(!((i+1) == 1) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1719, __FUNCTION__), 0 : 0)), (args))); |
1720 | for (int j = 0; j < TREE_VEC_LENGTH (level)((tree_check ((level), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1720, __FUNCTION__, (TREE_VEC)))->base.u.length); ++j) |
1721 | { |
1722 | tree arg = TREE_VEC_ELT (level, j)(*((const_cast<tree *> (tree_vec_elt_check ((level), (j ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1722, __FUNCTION__))))); |
1723 | data.subob = arg; |
1724 | cp_walk_tree_without_duplicates (&arg, find_abi_tags_r, &data)walk_tree_without_duplicates_1 (&arg, find_abi_tags_r, & data, cp_walk_subtrees); |
1725 | } |
1726 | } |
1727 | |
1728 | // If we found some tags on our template arguments, add them to our |
1729 | // abi_tag attribute. |
1730 | if (data.tags) |
1731 | { |
1732 | tree attr = lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1732, __FUNCTION__))->type_common.attributes)); |
1733 | if (attr) |
1734 | TREE_VALUE (attr)((tree_check ((attr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1734, __FUNCTION__, (TREE_LIST)))->list.value) = chainon (data.tags, TREE_VALUE (attr)((tree_check ((attr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1734, __FUNCTION__, (TREE_LIST)))->list.value)); |
1735 | else |
1736 | TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1736, __FUNCTION__))->type_common.attributes) |
1737 | = tree_cons (abi_tag_identifiercp_global_trees[CPTI_ABI_TAG_IDENTIFIER], data.tags, TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1737, __FUNCTION__))->type_common.attributes)); |
1738 | } |
1739 | |
1740 | mark_abi_tags (t, false); |
1741 | } |
1742 | |
1743 | /* Return true, iff class T has a non-virtual destructor that is |
1744 | accessible from outside the class heirarchy (i.e. is public, or |
1745 | there's a suitable friend. */ |
1746 | |
1747 | static bool |
1748 | accessible_nvdtor_p (tree t) |
1749 | { |
1750 | tree dtor = CLASSTYPE_DESTRUCTOR (t)(get_class_binding_direct (t, cp_global_trees[CPTI_DTOR_IDENTIFIER ])); |
1751 | |
1752 | /* An implicitly declared destructor is always public. And, |
1753 | if it were virtual, we would have created it by now. */ |
1754 | if (!dtor) |
1755 | return true; |
1756 | |
1757 | if (DECL_VINDEX (dtor)((tree_check ((dtor), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1757, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex )) |
1758 | return false; /* Virtual */ |
1759 | |
1760 | if (!TREE_PRIVATE (dtor)((dtor)->base.private_flag) && !TREE_PROTECTED (dtor)((dtor)->base.protected_flag)) |
1761 | return true; /* Public */ |
1762 | |
1763 | if (CLASSTYPE_FRIEND_CLASSES (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1763, __FUNCTION__))->type_with_lang_specific.lang_specific ))->friend_classes) |
1764 | || DECL_FRIENDLIST (TYPE_MAIN_DECL (t))(((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1764, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1764, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1764, __FUNCTION__))->common.chain)))), (TS_DECL_COMMON) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1764, __FUNCTION__))->decl_common.initial))) |
1765 | return true; /* Has friends */ |
1766 | |
1767 | return false; |
1768 | } |
1769 | |
1770 | /* Run through the base classes of T, updating CANT_HAVE_CONST_CTOR_P, |
1771 | and NO_CONST_ASN_REF_P. Also set flag bits in T based on |
1772 | properties of the bases. */ |
1773 | |
1774 | static void |
1775 | check_bases (tree t, |
1776 | int* cant_have_const_ctor_p, |
1777 | int* no_const_asn_ref_p) |
1778 | { |
1779 | int i; |
1780 | bool seen_non_virtual_nearly_empty_base_p = 0; |
1781 | int seen_tm_mask = 0; |
1782 | tree base_binfo; |
1783 | tree binfo; |
1784 | tree field = NULL_TREE(tree) __null; |
1785 | |
1786 | if (!CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1786, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout)) |
1787 | for (field = TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1787, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1787, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1787, __FUNCTION__))->common.chain))) |
1788 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) == FIELD_DECL) |
1789 | break; |
1790 | |
1791 | for (binfo = TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1791, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), i = 0; |
1792 | BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1792, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(base_binfo))); i++) |
1793 | { |
1794 | tree basetype = TREE_TYPE (base_binfo)((contains_struct_check ((base_binfo), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1794, __FUNCTION__))->typed.type); |
1795 | |
1796 | gcc_assert (COMPLETE_TYPE_P (basetype))((void)(!((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1796, __FUNCTION__))->type_common.size) != (tree) __null )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1796, __FUNCTION__), 0 : 0)); |
1797 | |
1798 | if (CLASSTYPE_FINAL (basetype)((tree_check3 ((basetype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1798, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->base.default_def_flag)) |
1799 | error ("cannot derive from %<final%> base %qT in derived type %qT", |
1800 | basetype, t); |
1801 | |
1802 | /* If any base class is non-literal, so is the derived class. */ |
1803 | if (!CLASSTYPE_LITERAL_P (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1803, __FUNCTION__))->type_with_lang_specific.lang_specific ))->is_literal)) |
1804 | CLASSTYPE_LITERAL_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1804, __FUNCTION__))->type_with_lang_specific.lang_specific ))->is_literal) = false; |
1805 | |
1806 | /* If the base class doesn't have copy constructors or |
1807 | assignment operators that take const references, then the |
1808 | derived class cannot have such a member automatically |
1809 | generated. */ |
1810 | if (TYPE_HAS_COPY_CTOR (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1810, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor) |
1811 | && ! TYPE_HAS_CONST_COPY_CTOR (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1811, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_ctor)) |
1812 | *cant_have_const_ctor_p = 1; |
1813 | if (TYPE_HAS_COPY_ASSIGN (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1813, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign) |
1814 | && !TYPE_HAS_CONST_COPY_ASSIGN (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1814, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_assign)) |
1815 | *no_const_asn_ref_p = 1; |
1816 | |
1817 | if (BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1817, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
1818 | /* A virtual base does not effect nearly emptiness. */ |
1819 | ; |
1820 | else if (CLASSTYPE_NEARLY_EMPTY_P (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1820, __FUNCTION__))->type_with_lang_specific.lang_specific ))->nearly_empty_p)) |
1821 | { |
1822 | if (seen_non_virtual_nearly_empty_base_p) |
1823 | /* And if there is more than one nearly empty base, then the |
1824 | derived class is not nearly empty either. */ |
1825 | CLASSTYPE_NEARLY_EMPTY_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1825, __FUNCTION__))->type_with_lang_specific.lang_specific ))->nearly_empty_p) = 0; |
1826 | else |
1827 | /* Remember we've seen one. */ |
1828 | seen_non_virtual_nearly_empty_base_p = 1; |
1829 | } |
1830 | else if (!is_empty_class (basetype)) |
1831 | /* If the base class is not empty or nearly empty, then this |
1832 | class cannot be nearly empty. */ |
1833 | CLASSTYPE_NEARLY_EMPTY_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1833, __FUNCTION__))->type_with_lang_specific.lang_specific ))->nearly_empty_p) = 0; |
1834 | |
1835 | /* A lot of properties from the bases also apply to the derived |
1836 | class. */ |
1837 | TYPE_NEEDS_CONSTRUCTING (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1837, __FUNCTION__))->type_common.needs_constructing_flag ) |= TYPE_NEEDS_CONSTRUCTING (basetype)((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1837, __FUNCTION__))->type_common.needs_constructing_flag ); |
1838 | TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1838, __FUNCTION__))->type_common.lang_flag_4)) |
1839 | |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (basetype)(((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1839, __FUNCTION__))->type_common.lang_flag_4)); |
1840 | TYPE_HAS_COMPLEX_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1840, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign) |
1841 | |= (TYPE_HAS_COMPLEX_COPY_ASSIGN (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1841, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign) |
1842 | || !TYPE_HAS_COPY_ASSIGN (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1842, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign)); |
1843 | TYPE_HAS_COMPLEX_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1843, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_ctor) |= (TYPE_HAS_COMPLEX_COPY_CTOR (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1843, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_ctor) |
1844 | || !TYPE_HAS_COPY_CTOR (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1844, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor)); |
1845 | TYPE_HAS_COMPLEX_MOVE_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1845, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign) |
1846 | |= TYPE_HAS_COMPLEX_MOVE_ASSIGN (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1846, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign); |
1847 | TYPE_HAS_COMPLEX_MOVE_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1847, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_ctor) |= TYPE_HAS_COMPLEX_MOVE_CTOR (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1847, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_ctor); |
1848 | TYPE_POLYMORPHIC_P (t)(((tree_not_check2 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1848, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) |= TYPE_POLYMORPHIC_P (basetype)(((tree_not_check2 ((basetype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1848, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)); |
1849 | CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1849, __FUNCTION__))->type_with_lang_specific.lang_specific ))->contains_empty_class_p) |
1850 | |= CLASSTYPE_CONTAINS_EMPTY_CLASS_P (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1850, __FUNCTION__))->type_with_lang_specific.lang_specific ))->contains_empty_class_p); |
1851 | TYPE_HAS_COMPLEX_DFLT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1851, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt) |= (!TYPE_HAS_DEFAULT_CONSTRUCTOR (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1851, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_default_ctor) |
1852 | || TYPE_HAS_COMPLEX_DFLT (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1852, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt)); |
1853 | SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = ((((tree_class_check ((t), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1854, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1854, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0) | (((tree_class_check ((basetype ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0))) |
1854 | (t, CLASSTYPE_READONLY_FIELDS_NEED_INIT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = ((((tree_class_check ((t), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1854, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1854, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0) | (((tree_class_check ((basetype ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0))) |
1855 | | CLASSTYPE_READONLY_FIELDS_NEED_INIT (basetype))((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = ((((tree_class_check ((t), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1854, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1854, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0) | (((tree_class_check ((basetype ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1855, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0))); |
1856 | SET_CLASSTYPE_REF_FIELDS_NEED_INIT((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init = ((((tree_class_check ((t), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1857, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1857, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init : 0) | (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init : 0))) |
1857 | (t, CLASSTYPE_REF_FIELDS_NEED_INIT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init = ((((tree_class_check ((t), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1857, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1857, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init : 0) | (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init : 0))) |
1858 | | CLASSTYPE_REF_FIELDS_NEED_INIT (basetype))((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init = ((((tree_class_check ((t), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1857, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1857, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init : 0) | (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1858, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init : 0))); |
1859 | if (TYPE_HAS_MUTABLE_P (basetype)(cp_has_mutable_p (basetype))) |
1860 | CLASSTYPE_HAS_MUTABLE (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1860, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_mutable) = 1; |
1861 | |
1862 | /* A standard-layout class is a class that: |
1863 | ... |
1864 | * has no non-standard-layout base classes, */ |
1865 | CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1865, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout) |= CLASSTYPE_NON_STD_LAYOUT (basetype)((((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1865, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout); |
1866 | if (!CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1866, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout)) |
1867 | { |
1868 | tree basefield; |
1869 | /* ...has no base classes of the same type as the first non-static |
1870 | data member... */ |
1871 | if (field && DECL_CONTEXT (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1871, __FUNCTION__))->decl_minimal.context) == t |
1872 | && (same_type_ignoring_top_level_qualifiers_p |
1873 | (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1873, __FUNCTION__))->typed.type), basetype))) |
1874 | CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1874, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout) = 1; |
1875 | /* DR 1813: |
1876 | ...has at most one base class subobject of any given type... */ |
1877 | else if (CLASSTYPE_REPEATED_BASE_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1877, __FUNCTION__))->type_with_lang_specific.lang_specific ))->repeated_base)) |
1878 | CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1878, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout) = 1; |
1879 | else |
1880 | /* ...has all non-static data members and bit-fields in the class |
1881 | and its base classes first declared in the same class. */ |
1882 | for (basefield = TYPE_FIELDS (basetype)((tree_check3 ((basetype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1882, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); basefield; |
1883 | basefield = DECL_CHAIN (basefield)(((contains_struct_check (((contains_struct_check ((basefield ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1883, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1883, __FUNCTION__))->common.chain))) |
1884 | if (TREE_CODE (basefield)((enum tree_code) (basefield)->base.code) == FIELD_DECL |
1885 | && !(DECL_FIELD_IS_BASE (basefield)((contains_struct_check (((tree_check ((basefield), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1885, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1885, __FUNCTION__))->decl_common.lang_flag_6) |
1886 | && is_empty_field (basefield))) |
1887 | { |
1888 | if (field) |
1889 | CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1889, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout) = 1; |
1890 | else |
1891 | field = basefield; |
1892 | break; |
1893 | } |
1894 | } |
1895 | |
1896 | /* Don't bother collecting tm attributes if transactional memory |
1897 | support is not enabled. */ |
1898 | if (flag_tmglobal_options.x_flag_tm) |
1899 | { |
1900 | tree tm_attr = find_tm_attribute (TYPE_ATTRIBUTES (basetype)((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1900, __FUNCTION__))->type_common.attributes)); |
1901 | if (tm_attr) |
1902 | seen_tm_mask |= tm_attr_to_mask (tm_attr); |
1903 | } |
1904 | |
1905 | check_abi_tags (t, basetype); |
1906 | } |
1907 | |
1908 | /* If one of the base classes had TM attributes, and the current class |
1909 | doesn't define its own, then the current class inherits one. */ |
1910 | if (seen_tm_mask && !find_tm_attribute (TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1910, __FUNCTION__))->type_common.attributes))) |
1911 | { |
1912 | tree tm_attr = tm_mask_to_attr (least_bit_hwi (seen_tm_mask)); |
1913 | TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1913, __FUNCTION__))->type_common.attributes) = tree_cons (tm_attr, NULL__null, TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1913, __FUNCTION__))->type_common.attributes)); |
1914 | } |
1915 | } |
1916 | |
1917 | /* Determine all the primary bases within T. Sets BINFO_PRIMARY_BASE_P for |
1918 | those that are primaries. Sets BINFO_LOST_PRIMARY_P for those |
1919 | that have had a nearly-empty virtual primary base stolen by some |
1920 | other base in the hierarchy. Determines CLASSTYPE_PRIMARY_BASE for |
1921 | T. */ |
1922 | |
1923 | static void |
1924 | determine_primary_bases (tree t) |
1925 | { |
1926 | unsigned i; |
1927 | tree primary = NULL_TREE(tree) __null; |
1928 | tree type_binfo = TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1928, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
1929 | tree base_binfo; |
1930 | |
1931 | /* Determine the primary bases of our bases. */ |
1932 | for (base_binfo = TREE_CHAIN (type_binfo)((contains_struct_check ((type_binfo), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1932, __FUNCTION__))->common.chain); base_binfo; |
1933 | base_binfo = TREE_CHAIN (base_binfo)((contains_struct_check ((base_binfo), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1933, __FUNCTION__))->common.chain)) |
1934 | { |
1935 | tree primary = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (base_binfo))((((tree_class_check ((((contains_struct_check (((tree_check ( (base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1935, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1935, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1935, __FUNCTION__))->type_with_lang_specific.lang_specific ))->primary_base); |
1936 | |
1937 | /* See if we're the non-virtual primary of our inheritance |
1938 | chain. */ |
1939 | if (!BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1939, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
1940 | { |
1941 | tree parent = BINFO_INHERITANCE_CHAIN (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1941, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance); |
1942 | tree parent_primary = CLASSTYPE_PRIMARY_BINFO (BINFO_TYPE (parent))((((tree_class_check ((((contains_struct_check (((tree_check ( (parent), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1942, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1942, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1942, __FUNCTION__))->type_with_lang_specific.lang_specific ))->primary_base); |
1943 | |
1944 | if (parent_primary |
1945 | && SAME_BINFO_TYPE_P (BINFO_TYPE (base_binfo),((((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1945, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1945, __FUNCTION__))->typed.type)) == (((contains_struct_check (((tree_check ((parent_primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1946, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1946, __FUNCTION__))->typed.type))) |
1946 | BINFO_TYPE (parent_primary))((((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1945, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1945, __FUNCTION__))->typed.type)) == (((contains_struct_check (((tree_check ((parent_primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1946, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1946, __FUNCTION__))->typed.type)))) |
1947 | /* We are the primary binfo. */ |
1948 | BINFO_PRIMARY_P (base_binfo)((tree_not_check2 (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1948, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1948, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) = 1; |
1949 | } |
1950 | /* Determine if we have a virtual primary base, and mark it so. |
1951 | */ |
1952 | if (primary && BINFO_VIRTUAL_P (primary)((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1952, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
1953 | { |
1954 | tree this_primary = copied_binfo (primary, base_binfo); |
1955 | |
1956 | if (BINFO_PRIMARY_P (this_primary)((tree_not_check2 (((tree_check ((this_primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1956, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1956, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5)) |
1957 | /* Someone already claimed this base. */ |
1958 | BINFO_LOST_PRIMARY_P (base_binfo)((tree_not_check2 (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1958, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1958, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) = 1; |
1959 | else |
1960 | { |
1961 | tree delta; |
1962 | |
1963 | BINFO_PRIMARY_P (this_primary)((tree_not_check2 (((tree_check ((this_primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1963, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1963, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) = 1; |
1964 | BINFO_INHERITANCE_CHAIN (this_primary)((tree_check ((this_primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1964, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance) = base_binfo; |
1965 | |
1966 | /* A virtual binfo might have been copied from within |
1967 | another hierarchy. As we're about to use it as a |
1968 | primary base, make sure the offsets match. */ |
1969 | delta = size_diffop_loc (input_location, |
1970 | fold_convert (ssizetype,fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1971, __FUNCTION__, (TREE_BINFO)))->binfo.offset)) |
1971 | BINFO_OFFSET (base_binfo))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1971, __FUNCTION__, (TREE_BINFO)))->binfo.offset)), |
1972 | fold_convert (ssizetype,fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((this_primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1973, __FUNCTION__, (TREE_BINFO)))->binfo.offset)) |
1973 | BINFO_OFFSET (this_primary))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((this_primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1973, __FUNCTION__, (TREE_BINFO)))->binfo.offset))); |
1974 | |
1975 | propagate_binfo_offsets (this_primary, delta); |
1976 | } |
1977 | } |
1978 | } |
1979 | |
1980 | /* First look for a dynamic direct non-virtual base. */ |
1981 | for (i = 0; BINFO_BASE_ITERATE (type_binfo, i, base_binfo)((&(tree_check ((type_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1981, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(base_binfo))); i++) |
1982 | { |
1983 | tree basetype = BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1983, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1983, __FUNCTION__))->typed.type); |
1984 | |
1985 | if (TYPE_CONTAINS_VPTR_P (basetype)((((tree_not_check2 ((basetype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1985, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) || ((((tree_class_check ((basetype), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1985, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases)) && !BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1985, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
1986 | { |
1987 | primary = base_binfo; |
1988 | goto found; |
1989 | } |
1990 | } |
1991 | |
1992 | /* A "nearly-empty" virtual base class can be the primary base |
1993 | class, if no non-virtual polymorphic base can be found. Look for |
1994 | a nearly-empty virtual dynamic base that is not already a primary |
1995 | base of something in the hierarchy. If there is no such base, |
1996 | just pick the first nearly-empty virtual base. */ |
1997 | |
1998 | for (base_binfo = TREE_CHAIN (type_binfo)((contains_struct_check ((type_binfo), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1998, __FUNCTION__))->common.chain); base_binfo; |
1999 | base_binfo = TREE_CHAIN (base_binfo)((contains_struct_check ((base_binfo), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 1999, __FUNCTION__))->common.chain)) |
2000 | if (BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2000, __FUNCTION__, (TREE_BINFO)))->base.static_flag) |
2001 | && CLASSTYPE_NEARLY_EMPTY_P (BINFO_TYPE (base_binfo))((((tree_class_check ((((contains_struct_check (((tree_check ( (base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2001, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2001, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2001, __FUNCTION__))->type_with_lang_specific.lang_specific ))->nearly_empty_p)) |
2002 | { |
2003 | if (!BINFO_PRIMARY_P (base_binfo)((tree_not_check2 (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2003, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2003, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5)) |
2004 | { |
2005 | /* Found one that is not primary. */ |
2006 | primary = base_binfo; |
2007 | goto found; |
2008 | } |
2009 | else if (!primary) |
2010 | /* Remember the first candidate. */ |
2011 | primary = base_binfo; |
2012 | } |
2013 | |
2014 | found: |
2015 | /* If we've got a primary base, use it. */ |
2016 | if (primary) |
2017 | { |
2018 | tree basetype = BINFO_TYPE (primary)((contains_struct_check (((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2018, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2018, __FUNCTION__))->typed.type); |
2019 | |
2020 | CLASSTYPE_PRIMARY_BINFO (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2020, __FUNCTION__))->type_with_lang_specific.lang_specific ))->primary_base) = primary; |
2021 | if (BINFO_PRIMARY_P (primary)((tree_not_check2 (((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2021, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2021, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5)) |
2022 | /* We are stealing a primary base. */ |
2023 | BINFO_LOST_PRIMARY_P (BINFO_INHERITANCE_CHAIN (primary))((tree_not_check2 (((tree_check ((((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2023, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2023, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2023, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4) = 1; |
2024 | BINFO_PRIMARY_P (primary)((tree_not_check2 (((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2024, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2024, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) = 1; |
2025 | if (BINFO_VIRTUAL_P (primary)((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2025, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
2026 | { |
2027 | tree delta; |
2028 | |
2029 | BINFO_INHERITANCE_CHAIN (primary)((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2029, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance) = type_binfo; |
2030 | /* A virtual binfo might have been copied from within |
2031 | another hierarchy. As we're about to use it as a primary |
2032 | base, make sure the offsets match. */ |
2033 | delta = size_diffop_loc (input_location, ssize_int (0)size_int_kind (0, stk_ssizetype), |
2034 | fold_convert (ssizetype, BINFO_OFFSET (primary))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2034, __FUNCTION__, (TREE_BINFO)))->binfo.offset))); |
2035 | |
2036 | propagate_binfo_offsets (primary, delta); |
2037 | } |
2038 | |
2039 | primary = TYPE_BINFO (basetype)((tree_check3 ((basetype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2039, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
2040 | |
2041 | TYPE_VFIELD (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2041, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval) = TYPE_VFIELD (basetype)((tree_check3 ((basetype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2041, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval); |
2042 | BINFO_VTABLE (type_binfo)((tree_check ((type_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2042, __FUNCTION__, (TREE_BINFO)))->binfo.vtable) = BINFO_VTABLE (primary)((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2042, __FUNCTION__, (TREE_BINFO)))->binfo.vtable); |
2043 | BINFO_VIRTUALS (type_binfo)((tree_check ((type_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2043, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals) = BINFO_VIRTUALS (primary)((tree_check ((primary), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2043, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals); |
2044 | } |
2045 | } |
2046 | |
2047 | /* Update the variant types of T. */ |
2048 | |
2049 | void |
2050 | fixup_type_variants (tree type) |
2051 | { |
2052 | if (!type) |
2053 | return; |
2054 | |
2055 | for (tree variant = TYPE_NEXT_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2055, __FUNCTION__))->type_common.next_variant); |
2056 | variant; |
2057 | variant = TYPE_NEXT_VARIANT (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2057, __FUNCTION__))->type_common.next_variant)) |
2058 | { |
2059 | /* These fields are in the _TYPE part of the node, not in |
2060 | the TYPE_LANG_SPECIFIC component, so they are not shared. */ |
2061 | TYPE_HAS_USER_CONSTRUCTOR (variant)(((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2061, __FUNCTION__))->type_common.lang_flag_1)) = TYPE_HAS_USER_CONSTRUCTOR (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2061, __FUNCTION__))->type_common.lang_flag_1)); |
2062 | TYPE_NEEDS_CONSTRUCTING (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2062, __FUNCTION__))->type_common.needs_constructing_flag ) = TYPE_NEEDS_CONSTRUCTING (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2062, __FUNCTION__))->type_common.needs_constructing_flag ); |
2063 | TYPE_HAS_NONTRIVIAL_DESTRUCTOR (variant)(((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2063, __FUNCTION__))->type_common.lang_flag_4)) |
2064 | = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2064, __FUNCTION__))->type_common.lang_flag_4)); |
2065 | |
2066 | TYPE_POLYMORPHIC_P (variant)(((tree_not_check2 ((variant), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2066, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) = TYPE_POLYMORPHIC_P (type)(((tree_not_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2066, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)); |
2067 | CLASSTYPE_FINAL (variant)((tree_check3 ((variant), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2067, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->base.default_def_flag) = CLASSTYPE_FINAL (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2067, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->base.default_def_flag); |
2068 | |
2069 | TYPE_BINFO (variant)((tree_check3 ((variant), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2069, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval) = TYPE_BINFO (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2069, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
2070 | |
2071 | /* Copy whatever these are holding today. */ |
2072 | TYPE_VFIELD (variant)((tree_check3 ((variant), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2072, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval) = TYPE_VFIELD (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2072, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.minval); |
2073 | TYPE_FIELDS (variant)((tree_check3 ((variant), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2073, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2073, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
2074 | |
2075 | TYPE_SIZE (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2075, __FUNCTION__))->type_common.size) = TYPE_SIZE (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2075, __FUNCTION__))->type_common.size); |
2076 | TYPE_SIZE_UNIT (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2076, __FUNCTION__))->type_common.size_unit) = TYPE_SIZE_UNIT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2076, __FUNCTION__))->type_common.size_unit); |
2077 | |
2078 | if (!TYPE_USER_ALIGN (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2078, __FUNCTION__))->base.u.bits.user_align) |
2079 | || TYPE_NAME (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2079, __FUNCTION__))->type_common.name) == TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2079, __FUNCTION__))->type_common.name) |
2080 | || TYPE_ALIGN_RAW (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2080, __FUNCTION__))->type_common.align) < TYPE_ALIGN_RAW (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2080, __FUNCTION__))->type_common.align)) |
2081 | { |
2082 | TYPE_ALIGN_RAW (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2082, __FUNCTION__))->type_common.align) = TYPE_ALIGN_RAW (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2082, __FUNCTION__))->type_common.align); |
2083 | TYPE_USER_ALIGN (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2083, __FUNCTION__))->base.u.bits.user_align) = TYPE_USER_ALIGN (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2083, __FUNCTION__))->base.u.bits.user_align); |
2084 | } |
2085 | |
2086 | TYPE_PRECISION (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2086, __FUNCTION__))->type_common.precision) = TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2086, __FUNCTION__))->type_common.precision); |
2087 | TYPE_MODE_RAW (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2087, __FUNCTION__))->type_common.mode) = TYPE_MODE_RAW (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2087, __FUNCTION__))->type_common.mode); |
2088 | TYPE_EMPTY_P (variant)((tree_class_check ((variant), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2088, __FUNCTION__))->type_common.empty_flag) = TYPE_EMPTY_P (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2088, __FUNCTION__))->type_common.empty_flag); |
2089 | } |
2090 | } |
2091 | |
2092 | /* KLASS is a class that we're applying may_alias to after the body is |
2093 | parsed. Fixup any POINTER_TO and REFERENCE_TO types. The |
2094 | canonical type(s) will be implicitly updated. */ |
2095 | |
2096 | static void |
2097 | fixup_may_alias (tree klass) |
2098 | { |
2099 | tree t, v; |
2100 | |
2101 | for (t = TYPE_POINTER_TO (klass)((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2101, __FUNCTION__))->type_common.pointer_to); t; t = TYPE_NEXT_PTR_TO (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2101, __FUNCTION__, (POINTER_TYPE)))->type_non_common.minval )) |
2102 | for (v = TYPE_MAIN_VARIANT (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2102, __FUNCTION__))->type_common.main_variant); v; v = TYPE_NEXT_VARIANT (v)((tree_class_check ((v), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2102, __FUNCTION__))->type_common.next_variant)) |
2103 | TYPE_REF_CAN_ALIAS_ALL (v)((tree_check2 ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2103, __FUNCTION__, (POINTER_TYPE), (REFERENCE_TYPE)))-> base.static_flag) = true; |
2104 | for (t = TYPE_REFERENCE_TO (klass)((tree_class_check ((klass), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2104, __FUNCTION__))->type_common.reference_to); t; t = TYPE_NEXT_REF_TO (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2104, __FUNCTION__, (REFERENCE_TYPE)))->type_non_common. minval)) |
2105 | for (v = TYPE_MAIN_VARIANT (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2105, __FUNCTION__))->type_common.main_variant); v; v = TYPE_NEXT_VARIANT (v)((tree_class_check ((v), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2105, __FUNCTION__))->type_common.next_variant)) |
2106 | TYPE_REF_CAN_ALIAS_ALL (v)((tree_check2 ((v), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2106, __FUNCTION__, (POINTER_TYPE), (REFERENCE_TYPE)))-> base.static_flag) = true; |
2107 | } |
2108 | |
2109 | /* Early variant fixups: we apply attributes at the beginning of the class |
2110 | definition, and we need to fix up any variants that have already been |
2111 | made via elaborated-type-specifier so that check_qualified_type works. */ |
2112 | |
2113 | void |
2114 | fixup_attribute_variants (tree t) |
2115 | { |
2116 | tree variants; |
2117 | |
2118 | if (!t) |
2119 | return; |
2120 | |
2121 | tree attrs = TYPE_ATTRIBUTES (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2121, __FUNCTION__))->type_common.attributes); |
2122 | unsigned align = TYPE_ALIGN (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2122, __FUNCTION__))->type_common.align) ? ((unsigned)1) << (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2122, __FUNCTION__))->type_common.align) - 1) : 0); |
2123 | bool user_align = TYPE_USER_ALIGN (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2123, __FUNCTION__))->base.u.bits.user_align); |
2124 | bool may_alias = lookup_attribute ("may_alias", attrs); |
2125 | bool packed = TYPE_PACKED (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2125, __FUNCTION__))->base.u.bits.packed_flag); |
2126 | |
2127 | if (may_alias) |
2128 | fixup_may_alias (t); |
2129 | |
2130 | for (variants = TYPE_NEXT_VARIANT (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2130, __FUNCTION__))->type_common.next_variant); |
2131 | variants; |
2132 | variants = TYPE_NEXT_VARIANT (variants)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2132, __FUNCTION__))->type_common.next_variant)) |
2133 | { |
2134 | /* These are the two fields that check_qualified_type looks at and |
2135 | are affected by attributes. */ |
2136 | TYPE_ATTRIBUTES (variants)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2136, __FUNCTION__))->type_common.attributes) = attrs; |
2137 | unsigned valign = align; |
2138 | if (TYPE_USER_ALIGN (variants)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2138, __FUNCTION__))->base.u.bits.user_align)) |
2139 | valign = MAX (valign, TYPE_ALIGN (variants))((valign) > ((((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2139, __FUNCTION__))->type_common.align) ? ((unsigned)1) << (((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2139, __FUNCTION__))->type_common.align) - 1) : 0)) ? (valign ) : ((((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2139, __FUNCTION__))->type_common.align) ? ((unsigned)1) << (((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2139, __FUNCTION__))->type_common.align) - 1) : 0))); |
2140 | else |
2141 | TYPE_USER_ALIGN (variants)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2141, __FUNCTION__))->base.u.bits.user_align) = user_align; |
2142 | SET_TYPE_ALIGN (variants, valign)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2142, __FUNCTION__))->type_common.align = ffs_hwi (valign )); |
2143 | TYPE_PACKED (variants)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2143, __FUNCTION__))->base.u.bits.packed_flag) = packed; |
2144 | if (may_alias) |
2145 | fixup_may_alias (variants); |
2146 | } |
2147 | } |
2148 | |
2149 | /* Set memoizing fields and bits of T (and its variants) for later |
2150 | use. */ |
2151 | |
2152 | static void |
2153 | finish_struct_bits (tree t) |
2154 | { |
2155 | /* Fix up variants (if any). */ |
2156 | fixup_type_variants (t); |
2157 | |
2158 | if (BINFO_N_BASE_BINFOS (TYPE_BINFO (t))((&(tree_check ((((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2158, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2158, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> length ()) && TYPE_POLYMORPHIC_P (t)(((tree_not_check2 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2158, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2))) |
2159 | /* For a class w/o baseclasses, 'finish_struct' has set |
2160 | CLASSTYPE_PURE_VIRTUALS correctly (by definition). |
2161 | Similarly for a class whose base classes do not have vtables. |
2162 | When neither of these is true, we might have removed abstract |
2163 | virtuals (by providing a definition), added some (by declaring |
2164 | new ones), or redeclared ones from a base class. We need to |
2165 | recalculate what's really an abstract virtual at this point (by |
2166 | looking in the vtables). */ |
2167 | get_pure_virtuals (t); |
2168 | |
2169 | /* If this type has a copy constructor or a destructor, force its |
2170 | mode to be BLKmode, and force its TREE_ADDRESSABLE bit to be |
2171 | nonzero. This will cause it to be passed by invisible reference |
2172 | and prevent it from being returned in a register. */ |
2173 | if (type_has_nontrivial_copy_init (t) |
2174 | || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2174, __FUNCTION__))->type_common.lang_flag_4))) |
2175 | { |
2176 | tree variants; |
2177 | SET_DECL_MODE (TYPE_MAIN_DECL (t), BLKmode)((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2177, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2177, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2177, __FUNCTION__))->common.chain)))), (TS_DECL_COMMON) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2177, __FUNCTION__))->decl_common.mode = (((void) 0, E_BLKmode ))); |
2178 | for (variants = t; variants; variants = TYPE_NEXT_VARIANT (variants)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2178, __FUNCTION__))->type_common.next_variant)) |
2179 | { |
2180 | SET_TYPE_MODE (variants, BLKmode)((tree_class_check ((variants), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2180, __FUNCTION__))->type_common.mode = (((void) 0, E_BLKmode ))); |
2181 | TREE_ADDRESSABLE (variants)((variants)->base.addressable_flag) = 1; |
2182 | } |
2183 | } |
2184 | } |
2185 | |
2186 | /* Issue warnings about T having private constructors, but no friends, |
2187 | and so forth. |
2188 | |
2189 | HAS_NONPRIVATE_METHOD is nonzero if T has any non-private methods or |
2190 | static members. HAS_NONPRIVATE_STATIC_FN is nonzero if T has any |
2191 | non-private static member functions. */ |
2192 | |
2193 | static void |
2194 | maybe_warn_about_overly_private_class (tree t) |
2195 | { |
2196 | int has_member_fn = 0; |
2197 | int has_nonprivate_method = 0; |
2198 | bool nonprivate_ctor = false; |
2199 | |
2200 | if (!warn_ctor_dtor_privacyglobal_options.x_warn_ctor_dtor_privacy |
2201 | /* If the class has friends, those entities might create and |
2202 | access instances, so we should not warn. */ |
2203 | || (CLASSTYPE_FRIEND_CLASSES (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2203, __FUNCTION__))->type_with_lang_specific.lang_specific ))->friend_classes) |
2204 | || DECL_FRIENDLIST (TYPE_MAIN_DECL (t))(((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2204, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2204, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2204, __FUNCTION__))->common.chain)))), (TS_DECL_COMMON) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2204, __FUNCTION__))->decl_common.initial))) |
2205 | /* We will have warned when the template was declared; there's |
2206 | no need to warn on every instantiation. */ |
2207 | || CLASSTYPE_TEMPLATE_INSTANTIATION (t)(((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2207, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) & 1)) |
2208 | /* There's no reason to even consider warning about this |
2209 | class. */ |
2210 | return; |
2211 | |
2212 | /* We only issue one warning, if more than one applies, because |
2213 | otherwise, on code like: |
2214 | |
2215 | class A { |
2216 | // Oops - forgot `public:' |
2217 | A(); |
2218 | A(const A&); |
2219 | ~A(); |
2220 | }; |
2221 | |
2222 | we warn several times about essentially the same problem. */ |
2223 | |
2224 | /* Check to see if all (non-constructor, non-destructor) member |
2225 | functions are private. (Since there are no friends or |
2226 | non-private statics, we can't ever call any of the private member |
2227 | functions.) */ |
2228 | for (tree fn = TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2228, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); fn; fn = DECL_CHAIN (fn)(((contains_struct_check (((contains_struct_check ((fn), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2228, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2228, __FUNCTION__))->common.chain))) |
2229 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == USING_DECL |
2230 | && DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2230, __FUNCTION__))->decl_minimal.name) == ctor_identifiercp_global_trees[CPTI_CTOR_IDENTIFIER] |
2231 | && !TREE_PRIVATE (fn)((fn)->base.private_flag)) |
2232 | nonprivate_ctor = true; |
2233 | else if (!DECL_DECLARES_FUNCTION_P (fn)(((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/class.cc" , 2233, __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/class.cc" , 2233, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL))) |
2234 | /* Not a function. */; |
2235 | else if (DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2235, __FUNCTION__))->decl_common.artificial_flag)) |
2236 | /* We're not interested in compiler-generated methods; they don't |
2237 | provide any way to call private members. */; |
2238 | else if (!TREE_PRIVATE (fn)((fn)->base.private_flag)) |
2239 | { |
2240 | if (DECL_STATIC_FUNCTION_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/class.cc" , 2240, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2240, __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/class.cc" , 2240, __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/class.cc" , 2240, __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/class.cc" , 2240, __FUNCTION__); <->u.fn; })->static_function )) |
2241 | /* A non-private static member function is just like a |
2242 | friend; it can create and invoke private member |
2243 | functions, and be accessed without a class |
2244 | instance. */ |
2245 | return; |
2246 | |
2247 | has_nonprivate_method = 1; |
2248 | /* Keep searching for a static member function. */ |
2249 | } |
2250 | else 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/class.cc" , 2250, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2250, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) && !DECL_DESTRUCTOR_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/class.cc" , 2250, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2250, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) |
2251 | has_member_fn = 1; |
2252 | |
2253 | if (!has_nonprivate_method && has_member_fn) |
2254 | { |
2255 | /* There are no non-private methods, and there's at least one |
2256 | private member function that isn't a constructor or |
2257 | destructor. (If all the private members are |
2258 | constructors/destructors we want to use the code below that |
2259 | issues error messages specifically referring to |
2260 | constructors/destructors.) */ |
2261 | unsigned i; |
2262 | tree binfo = TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2262, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
2263 | |
2264 | for (i = 0; i != BINFO_N_BASE_BINFOS (binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2264, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> length ()); i++) |
2265 | if (BINFO_BASE_ACCESS (binfo, i)(*((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2265, __FUNCTION__, (TREE_BINFO)))->binfo.base_accesses) )[(i)] != access_private_nodeglobal_trees[TI_PRIVATE]) |
2266 | { |
2267 | has_nonprivate_method = 1; |
2268 | break; |
2269 | } |
2270 | if (!has_nonprivate_method) |
2271 | { |
2272 | warning (OPT_Wctor_dtor_privacy, |
2273 | "all member functions in class %qT are private", t); |
2274 | return; |
2275 | } |
2276 | } |
2277 | |
2278 | /* Even if some of the member functions are non-private, the class |
2279 | won't be useful for much if all the constructors or destructors |
2280 | are private: such an object can never be created or destroyed. */ |
2281 | if (tree dtor = CLASSTYPE_DESTRUCTOR (t)(get_class_binding_direct (t, cp_global_trees[CPTI_DTOR_IDENTIFIER ]))) |
2282 | if (TREE_PRIVATE (dtor)((dtor)->base.private_flag)) |
2283 | { |
2284 | warning (OPT_Wctor_dtor_privacy, |
2285 | "%q#T only defines a private destructor and has no friends", |
2286 | t); |
2287 | return; |
2288 | } |
2289 | |
2290 | /* Warn about classes that have private constructors and no friends. */ |
2291 | if (TYPE_HAS_USER_CONSTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2291, __FUNCTION__))->type_common.lang_flag_1)) |
2292 | /* Implicitly generated constructors are always public. */ |
2293 | && !CLASSTYPE_LAZY_DEFAULT_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2293, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_default_ctor)) |
2294 | { |
2295 | tree copy_or_move = NULL_TREE(tree) __null; |
2296 | |
2297 | /* If a non-template class does not define a copy |
2298 | constructor, one is defined for it, enabling it to avoid |
2299 | this warning. For a template class, this does not |
2300 | happen, and so we would normally get a warning on: |
2301 | |
2302 | template <class T> class C { private: C(); }; |
2303 | |
2304 | To avoid this asymmetry, we check TYPE_HAS_COPY_CTOR. All |
2305 | complete non-template or fully instantiated classes have this |
2306 | flag set. */ |
2307 | if (!TYPE_HAS_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2307, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor)) |
2308 | nonprivate_ctor = true; |
2309 | else |
2310 | for (tree fn : ovl_range (CLASSTYPE_CONSTRUCTORS (t)(get_class_binding_direct (t, cp_global_trees[CPTI_CTOR_IDENTIFIER ])))) |
2311 | if (TREE_PRIVATE (fn)((fn)->base.private_flag)) |
2312 | continue; |
2313 | else if (copy_fn_p (fn) || move_fn_p (fn)) |
2314 | /* Ideally, we wouldn't count any constructor that takes |
2315 | an argument of the class type as a parameter, because |
2316 | such things cannot be used to construct an instance of |
2317 | the class unless you already have one. */ |
2318 | copy_or_move = fn; |
2319 | else |
2320 | { |
2321 | nonprivate_ctor = true; |
2322 | break; |
2323 | } |
2324 | |
2325 | if (!nonprivate_ctor) |
2326 | { |
2327 | bool w = warning (OPT_Wctor_dtor_privacy, |
2328 | "%q#T only defines private constructors and has " |
2329 | "no friends", t); |
2330 | if (w && copy_or_move) |
2331 | inform (DECL_SOURCE_LOCATION (copy_or_move)((contains_struct_check ((copy_or_move), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2331, __FUNCTION__))->decl_minimal.locus), |
2332 | "%q#D is public, but requires an existing %q#T object", |
2333 | copy_or_move, t); |
2334 | return; |
2335 | } |
2336 | } |
2337 | } |
2338 | |
2339 | /* Make BINFO's vtable have N entries, including RTTI entries, |
2340 | vbase and vcall offsets, etc. Set its type and call the back end |
2341 | to lay it out. */ |
2342 | |
2343 | static void |
2344 | layout_vtable_decl (tree binfo, int n) |
2345 | { |
2346 | tree atype; |
2347 | tree vtable; |
2348 | |
2349 | atype = build_array_of_n_type (vtable_entry_typecp_global_trees[CPTI_VTABLE_ENTRY_TYPE], n); |
2350 | layout_type (atype); |
2351 | |
2352 | /* We may have to grow the vtable. */ |
2353 | vtable = get_vtbl_decl_for_binfo (binfo); |
2354 | if (!same_type_p (TREE_TYPE (vtable), atype)comptypes ((((contains_struct_check ((vtable), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2354, __FUNCTION__))->typed.type)), (atype), 0)) |
2355 | { |
2356 | TREE_TYPE (vtable)((contains_struct_check ((vtable), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2356, __FUNCTION__))->typed.type) = atype; |
2357 | DECL_SIZE (vtable)((contains_struct_check ((vtable), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2357, __FUNCTION__))->decl_common.size) = DECL_SIZE_UNIT (vtable)((contains_struct_check ((vtable), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2357, __FUNCTION__))->decl_common.size_unit) = NULL_TREE(tree) __null; |
2358 | layout_decl (vtable, 0); |
2359 | } |
2360 | } |
2361 | |
2362 | /* True iff FNDECL and BASE_FNDECL (both non-static member functions) |
2363 | have the same signature. */ |
2364 | |
2365 | int |
2366 | same_signature_p (const_tree fndecl, const_tree base_fndecl) |
2367 | { |
2368 | /* One destructor overrides another if they are the same kind of |
2369 | destructor. */ |
2370 | if (DECL_DESTRUCTOR_P (base_fndecl)((tree_check (((((enum tree_code) (base_fndecl)->base.code ) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((base_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2370, __FUNCTION__, (TEMPLATE_DECL))))))))->result : base_fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2370, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) && DECL_DESTRUCTOR_P (fndecl)((tree_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/class.cc" , 2370, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2370, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) |
2371 | && special_function_p (base_fndecl) == special_function_p (fndecl)) |
2372 | return 1; |
2373 | /* But a non-destructor never overrides a destructor, nor vice |
2374 | versa, nor do different kinds of destructors override |
2375 | one-another. For example, a complete object destructor does not |
2376 | override a deleting destructor. */ |
2377 | if (DECL_DESTRUCTOR_P (base_fndecl)((tree_check (((((enum tree_code) (base_fndecl)->base.code ) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((base_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2377, __FUNCTION__, (TEMPLATE_DECL))))))))->result : base_fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2377, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) || DECL_DESTRUCTOR_P (fndecl)((tree_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/class.cc" , 2377, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2377, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) |
2378 | return 0; |
2379 | |
2380 | if (DECL_NAME (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2380, __FUNCTION__))->decl_minimal.name) == DECL_NAME (base_fndecl)((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2380, __FUNCTION__))->decl_minimal.name) |
2381 | || (DECL_CONV_FN_P (fndecl)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2381, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
2382 | && DECL_CONV_FN_P (base_fndecl)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2382, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
2383 | && same_type_p (DECL_CONV_FN_TYPE (fndecl),comptypes ((((contains_struct_check (((((void)(!(((((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__), 0 : 0)), ((contains_struct_check ((fndecl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->typed.type)), (((contains_struct_check (((((void)(!(((((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__), 0 : 0)), ((contains_struct_check ((base_fndecl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->typed.type)), 0) |
2384 | DECL_CONV_FN_TYPE (base_fndecl))comptypes ((((contains_struct_check (((((void)(!(((((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__), 0 : 0)), ((contains_struct_check ((fndecl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->decl_minimal.name))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2383, __FUNCTION__))->typed.type)), (((contains_struct_check (((((void)(!(((((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((base_fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__), 0 : 0)), ((contains_struct_check ((base_fndecl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->decl_minimal.name))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2384, __FUNCTION__))->typed.type)), 0))) |
2385 | { |
2386 | tree fntype = TREE_TYPE (fndecl)((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2386, __FUNCTION__))->typed.type); |
2387 | tree base_fntype = TREE_TYPE (base_fndecl)((contains_struct_check ((base_fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2387, __FUNCTION__))->typed.type); |
2388 | if (type_memfn_quals (fntype) == type_memfn_quals (base_fntype) |
2389 | && type_memfn_rqual (fntype) == type_memfn_rqual (base_fntype) |
2390 | && compparms (FUNCTION_FIRST_USER_PARMTYPE (fndecl)skip_artificial_parms_for ((fndecl), ((tree_check2 ((((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2390, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2390, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)), |
2391 | FUNCTION_FIRST_USER_PARMTYPE (base_fndecl)skip_artificial_parms_for ((base_fndecl), ((tree_check2 ((((contains_struct_check ((base_fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2391, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2391, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)))) |
2392 | return 1; |
2393 | } |
2394 | return 0; |
2395 | } |
2396 | |
2397 | /* Returns TRUE if DERIVED is a binfo containing the binfo BASE as a |
2398 | subobject. */ |
2399 | |
2400 | static bool |
2401 | base_derived_from (tree derived, tree base) |
2402 | { |
2403 | tree probe; |
2404 | |
2405 | for (probe = base; probe; probe = BINFO_INHERITANCE_CHAIN (probe)((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2405, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance)) |
2406 | { |
2407 | if (probe == derived) |
2408 | return true; |
2409 | else if (BINFO_VIRTUAL_P (probe)((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2409, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
2410 | /* If we meet a virtual base, we can't follow the inheritance |
2411 | any more. See if the complete type of DERIVED contains |
2412 | such a virtual base. */ |
2413 | return (binfo_for_vbase (BINFO_TYPE (probe)((contains_struct_check (((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2413, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2413, __FUNCTION__))->typed.type), BINFO_TYPE (derived)((contains_struct_check (((tree_check ((derived), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2413, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2413, __FUNCTION__))->typed.type)) |
2414 | != NULL_TREE(tree) __null); |
2415 | } |
2416 | return false; |
2417 | } |
2418 | |
2419 | struct find_final_overrider_data { |
2420 | /* The function for which we are trying to find a final overrider. */ |
2421 | tree fn; |
2422 | /* The base class in which the function was declared. */ |
2423 | tree declaring_base; |
2424 | /* The candidate overriders. */ |
2425 | tree candidates; |
2426 | /* Path to most derived. */ |
2427 | auto_vec<tree> path; |
2428 | }; |
2429 | |
2430 | /* Add the overrider along the current path to FFOD->CANDIDATES. |
2431 | Returns true if an overrider was found; false otherwise. */ |
2432 | |
2433 | static bool |
2434 | dfs_find_final_overrider_1 (tree binfo, |
2435 | find_final_overrider_data *ffod, |
2436 | unsigned depth) |
2437 | { |
2438 | tree method; |
2439 | |
2440 | /* If BINFO is not the most derived type, try a more derived class. |
2441 | A definition there will overrider a definition here. */ |
2442 | if (depth) |
2443 | { |
2444 | depth--; |
2445 | if (dfs_find_final_overrider_1 |
2446 | (ffod->path[depth], ffod, depth)) |
2447 | return true; |
2448 | } |
2449 | |
2450 | method = look_for_overrides_here (BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2450, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2450, __FUNCTION__))->typed.type), ffod->fn); |
2451 | if (method) |
2452 | { |
2453 | tree *candidate = &ffod->candidates; |
2454 | |
2455 | /* Remove any candidates overridden by this new function. */ |
2456 | while (*candidate) |
2457 | { |
2458 | /* If *CANDIDATE overrides METHOD, then METHOD |
2459 | cannot override anything else on the list. */ |
2460 | if (base_derived_from (TREE_VALUE (*candidate)((tree_check ((*candidate), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2460, __FUNCTION__, (TREE_LIST)))->list.value), binfo)) |
2461 | return true; |
2462 | /* If METHOD overrides *CANDIDATE, remove *CANDIDATE. */ |
2463 | if (base_derived_from (binfo, TREE_VALUE (*candidate)((tree_check ((*candidate), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2463, __FUNCTION__, (TREE_LIST)))->list.value))) |
2464 | *candidate = TREE_CHAIN (*candidate)((contains_struct_check ((*candidate), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2464, __FUNCTION__))->common.chain); |
2465 | else |
2466 | candidate = &TREE_CHAIN (*candidate)((contains_struct_check ((*candidate), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2466, __FUNCTION__))->common.chain); |
2467 | } |
2468 | |
2469 | /* Add the new function. */ |
2470 | ffod->candidates = tree_cons (method, binfo, ffod->candidates); |
2471 | return true; |
2472 | } |
2473 | |
2474 | return false; |
2475 | } |
2476 | |
2477 | /* Called from find_final_overrider via dfs_walk. */ |
2478 | |
2479 | static tree |
2480 | dfs_find_final_overrider_pre (tree binfo, void *data) |
2481 | { |
2482 | find_final_overrider_data *ffod = (find_final_overrider_data *) data; |
2483 | |
2484 | if (binfo == ffod->declaring_base) |
2485 | dfs_find_final_overrider_1 (binfo, ffod, ffod->path.length ()); |
2486 | ffod->path.safe_push (binfo); |
2487 | |
2488 | return NULL_TREE(tree) __null; |
2489 | } |
2490 | |
2491 | static tree |
2492 | dfs_find_final_overrider_post (tree /*binfo*/, void *data) |
2493 | { |
2494 | find_final_overrider_data *ffod = (find_final_overrider_data *) data; |
2495 | ffod->path.pop (); |
2496 | |
2497 | return NULL_TREE(tree) __null; |
2498 | } |
2499 | |
2500 | /* Returns a TREE_LIST whose TREE_PURPOSE is the final overrider for |
2501 | FN and whose TREE_VALUE is the binfo for the base where the |
2502 | overriding occurs. BINFO (in the hierarchy dominated by the binfo |
2503 | DERIVED) is the base object in which FN is declared. */ |
2504 | |
2505 | static tree |
2506 | find_final_overrider (tree derived, tree binfo, tree fn) |
2507 | { |
2508 | find_final_overrider_data ffod; |
2509 | |
2510 | /* Getting this right is a little tricky. This is valid: |
2511 | |
2512 | struct S { virtual void f (); }; |
2513 | struct T { virtual void f (); }; |
2514 | struct U : public S, public T { }; |
2515 | |
2516 | even though calling `f' in `U' is ambiguous. But, |
2517 | |
2518 | struct R { virtual void f(); }; |
2519 | struct S : virtual public R { virtual void f (); }; |
2520 | struct T : virtual public R { virtual void f (); }; |
2521 | struct U : public S, public T { }; |
2522 | |
2523 | is not -- there's no way to decide whether to put `S::f' or |
2524 | `T::f' in the vtable for `R'. |
2525 | |
2526 | The solution is to look at all paths to BINFO. If we find |
2527 | different overriders along any two, then there is a problem. */ |
2528 | 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/class.cc" , 2528, __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/class.cc" , 2528, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2528, __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/class.cc" , 2528, __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/class.cc" , 2528, __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/class.cc" , 2528, __FUNCTION__); <->u.fn; })->thunk_p)) |
2529 | fn = THUNK_TARGET (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/class.cc" , 2529, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2529, __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/class.cc" , 2529, __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/class.cc" , 2529, __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/class.cc" , 2529, __FUNCTION__); <->u.fn; })->befriending_classes ); |
2530 | |
2531 | /* Determine the depth of the hierarchy. */ |
2532 | ffod.fn = fn; |
2533 | ffod.declaring_base = binfo; |
2534 | ffod.candidates = NULL_TREE(tree) __null; |
2535 | ffod.path.create (30); |
2536 | |
2537 | dfs_walk_all (derived, dfs_find_final_overrider_pre, |
2538 | dfs_find_final_overrider_post, &ffod); |
2539 | |
2540 | /* If there was no winner, issue an error message. */ |
2541 | if (!ffod.candidates || TREE_CHAIN (ffod.candidates)((contains_struct_check ((ffod.candidates), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2541, __FUNCTION__))->common.chain)) |
2542 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2543 | |
2544 | return ffod.candidates; |
2545 | } |
2546 | |
2547 | /* Return the index of the vcall offset for FN when TYPE is used as a |
2548 | virtual base. */ |
2549 | |
2550 | static tree |
2551 | get_vcall_index (tree fn, tree type) |
2552 | { |
2553 | vec<tree_pair_s, va_gc> *indices = CLASSTYPE_VCALL_INDICES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2553, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vcall_indices); |
2554 | tree_pair_p p; |
2555 | unsigned ix; |
2556 | |
2557 | FOR_EACH_VEC_SAFE_ELT (indices, ix, p)for (ix = 0; vec_safe_iterate ((indices), (ix), &(p)); ++ (ix)) |
2558 | if ((DECL_DESTRUCTOR_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/class.cc" , 2558, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2558, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) && DECL_DESTRUCTOR_P (p->purpose)((tree_check (((((enum tree_code) (p->purpose)->base.code ) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((p->purpose), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2558, __FUNCTION__, (TEMPLATE_DECL))))))))->result : p-> purpose)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2558, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) |
2559 | || same_signature_p (fn, p->purpose)) |
2560 | return p->value; |
2561 | |
2562 | /* There should always be an appropriate index. */ |
2563 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2563, __FUNCTION__)); |
2564 | } |
2565 | |
2566 | /* Given a DECL_VINDEX of a virtual function found in BINFO, return the final |
2567 | overrider at that index in the vtable. This should only be used when we |
2568 | know that BINFO is correct for the dynamic type of the object. */ |
2569 | |
2570 | tree |
2571 | lookup_vfn_in_binfo (tree idx, tree binfo) |
2572 | { |
2573 | int ix = tree_to_shwi (idx); |
2574 | if (TARGET_VTABLE_USES_DESCRIPTORS0) |
2575 | ix /= MAX (TARGET_VTABLE_USES_DESCRIPTORS, 1)((0) > (1) ? (0) : (1)); |
2576 | while (BINFO_PRIMARY_P (binfo)((tree_not_check2 (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2576, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2576, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5)) |
2577 | /* BINFO_VIRTUALS in a primary base isn't accurate, find the derived |
2578 | class that actually owns the vtable. */ |
2579 | binfo = BINFO_INHERITANCE_CHAIN (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2579, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance); |
2580 | tree virtuals = BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2580, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals); |
2581 | return TREE_VALUE (chain_index (ix, virtuals))((tree_check ((chain_index (ix, virtuals)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2581, __FUNCTION__, (TREE_LIST)))->list.value); |
2582 | } |
2583 | |
2584 | /* Update an entry in the vtable for BINFO, which is in the hierarchy |
2585 | dominated by T. FN is the old function; VIRTUALS points to the |
2586 | corresponding position in the new BINFO_VIRTUALS list. IX is the index |
2587 | of that entry in the list. */ |
2588 | |
2589 | static void |
2590 | update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals, |
2591 | unsigned ix) |
2592 | { |
2593 | tree b; |
2594 | tree overrider; |
2595 | tree delta; |
2596 | tree virtual_base; |
2597 | tree first_defn; |
2598 | tree overrider_fn, overrider_target; |
2599 | tree target_fn = 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/class.cc" , 2599, __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/class.cc" , 2599, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2599, __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/class.cc" , 2599, __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/class.cc" , 2599, __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/class.cc" , 2599, __FUNCTION__); <->u.fn; })->thunk_p) ? THUNK_TARGET (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/class.cc" , 2599, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2599, __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/class.cc" , 2599, __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/class.cc" , 2599, __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/class.cc" , 2599, __FUNCTION__); <->u.fn; })->befriending_classes ) : fn; |
2600 | tree over_return, base_return; |
2601 | bool lost = false; |
2602 | |
2603 | /* Find the nearest primary base (possibly binfo itself) which defines |
2604 | this function; this is the class the caller will convert to when |
2605 | calling FN through BINFO. */ |
2606 | for (b = binfo; ; b = get_primary_binfo (b)) |
2607 | { |
2608 | gcc_assert (b)((void)(!(b) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2608, __FUNCTION__), 0 : 0)); |
2609 | if (look_for_overrides_here (BINFO_TYPE (b)((contains_struct_check (((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2609, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2609, __FUNCTION__))->typed.type), target_fn)) |
2610 | break; |
2611 | |
2612 | /* The nearest definition is from a lost primary. */ |
2613 | if (BINFO_LOST_PRIMARY_P (b)((tree_not_check2 (((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2613, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2613, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) |
2614 | lost = true; |
2615 | } |
2616 | first_defn = b; |
2617 | |
2618 | /* Find the final overrider. */ |
2619 | overrider = find_final_overrider (TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2619, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), b, target_fn); |
2620 | if (overrider == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2621 | { |
2622 | error ("no unique final overrider for %qD in %qT", target_fn, t); |
2623 | return; |
2624 | } |
2625 | overrider_target = overrider_fn = TREE_PURPOSE (overrider)((tree_check ((overrider), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2625, __FUNCTION__, (TREE_LIST)))->list.purpose); |
2626 | |
2627 | /* Check for adjusting covariant return types. */ |
2628 | over_return = TREE_TYPE (TREE_TYPE (overrider_target))((contains_struct_check ((((contains_struct_check ((overrider_target ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2628, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2628, __FUNCTION__))->typed.type); |
2629 | base_return = TREE_TYPE (TREE_TYPE (target_fn))((contains_struct_check ((((contains_struct_check ((target_fn ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2629, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2629, __FUNCTION__))->typed.type); |
2630 | |
2631 | if (INDIRECT_TYPE_P (over_return)((((enum tree_code) (over_return)->base.code) == POINTER_TYPE ) || (((enum tree_code) (over_return)->base.code) == REFERENCE_TYPE )) |
2632 | && TREE_CODE (over_return)((enum tree_code) (over_return)->base.code) == TREE_CODE (base_return)((enum tree_code) (base_return)->base.code) |
2633 | && CLASS_TYPE_P (TREE_TYPE (over_return))(((((enum tree_code) (((contains_struct_check ((over_return), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2633, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((over_return ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2633, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((over_return ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2633, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2633, __FUNCTION__))->type_common.lang_flag_5)) |
2634 | && CLASS_TYPE_P (TREE_TYPE (base_return))(((((enum tree_code) (((contains_struct_check ((base_return), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2634, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((base_return ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2634, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((base_return ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2634, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2634, __FUNCTION__))->type_common.lang_flag_5)) |
2635 | /* If the overrider is invalid, don't even try. */ |
2636 | && !DECL_INVALID_OVERRIDER_P (overrider_target)(((contains_struct_check ((overrider_target), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2636, __FUNCTION__))->decl_common.lang_flag_4))) |
2637 | { |
2638 | /* If FN is a covariant thunk, we must figure out the adjustment |
2639 | to the final base FN was converting to. As OVERRIDER_TARGET might |
2640 | also be converting to the return type of FN, we have to |
2641 | combine the two conversions here. */ |
2642 | tree fixed_offset, virtual_offset; |
2643 | |
2644 | over_return = TREE_TYPE (over_return)((contains_struct_check ((over_return), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2644, __FUNCTION__))->typed.type); |
2645 | base_return = TREE_TYPE (base_return)((contains_struct_check ((base_return), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2645, __FUNCTION__))->typed.type); |
2646 | |
2647 | 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/class.cc" , 2647, __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/class.cc" , 2647, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2647, __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/class.cc" , 2647, __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/class.cc" , 2647, __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/class.cc" , 2647, __FUNCTION__); <->u.fn; })->thunk_p)) |
2648 | { |
2649 | gcc_assert (DECL_RESULT_THUNK_P (fn))((void)(!(((((enum tree_code) (fn)->base.code) == FUNCTION_DECL && ((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2649, __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/class.cc" , 2649, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2649, __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/class.cc" , 2649, __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/class.cc" , 2649, __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/class.cc" , 2649, __FUNCTION__); <->u.fn; })->thunk_p) && !__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/class.cc" , 2649, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2649, __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/class.cc" , 2649, __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/class.cc" , 2649, __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/class.cc" , 2649, __FUNCTION__); <->u.fn; })->this_thunk_p) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2649, __FUNCTION__), 0 : 0)); |
2650 | fixed_offset = ssize_int (THUNK_FIXED_OFFSET (fn))size_int_kind ((((contains_struct_check ((__extension__ ({ __typeof (fn) const __t = (fn); if (((enum tree_code) (__t)->base. code) != FUNCTION_DECL || !__t->decl_common.lang_specific || !__t->decl_common.lang_specific->u.fn.thunk_p) tree_check_failed (__t, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2650, __FUNCTION__, 0); __t; })), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2650, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.fixed_offset), stk_ssizetype); |
2651 | virtual_offset = THUNK_VIRTUAL_OFFSET (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__))->decl_common.lang_specific); if (!( (((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == VAR_DECL || ((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL ) || ((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FIELD_DECL || ((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONST_DECL || ((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TYPE_DECL || ((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL || ((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == USING_DECL || ((enum tree_code) ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONCEPT_DECL )) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2651, __FUNCTION__); <->u.min; })->access); |
2652 | } |
2653 | else |
2654 | fixed_offset = virtual_offset = NULL_TREE(tree) __null; |
2655 | |
2656 | if (virtual_offset) |
2657 | /* Find the equivalent binfo within the return type of the |
2658 | overriding function. We will want the vbase offset from |
2659 | there. */ |
2660 | virtual_offset = binfo_for_vbase (BINFO_TYPE (virtual_offset)((contains_struct_check (((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2660, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2660, __FUNCTION__))->typed.type), |
2661 | over_return); |
2662 | else if (!same_type_ignoring_top_level_qualifiers_p |
2663 | (over_return, base_return)) |
2664 | { |
2665 | /* There was no existing virtual thunk (which takes |
2666 | precedence). So find the binfo of the base function's |
2667 | return type within the overriding function's return type. |
2668 | Fortunately we know the covariancy is valid (it |
2669 | has already been checked), so we can just iterate along |
2670 | the binfos, which have been chained in inheritance graph |
2671 | order. Of course it is lame that we have to repeat the |
2672 | search here anyway -- we should really be caching pieces |
2673 | of the vtable and avoiding this repeated work. */ |
2674 | tree thunk_binfo = NULL_TREE(tree) __null; |
2675 | tree base_binfo = TYPE_BINFO (base_return)((tree_check3 ((base_return), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2675, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
2676 | |
2677 | /* Find the base binfo within the overriding function's |
2678 | return type. We will always find a thunk_binfo, except |
2679 | when the covariancy is invalid (which we will have |
2680 | already diagnosed). */ |
2681 | if (base_binfo) |
2682 | for (thunk_binfo = TYPE_BINFO (over_return)((tree_check3 ((over_return), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2682, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); thunk_binfo; |
2683 | thunk_binfo = TREE_CHAIN (thunk_binfo)((contains_struct_check ((thunk_binfo), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2683, __FUNCTION__))->common.chain)) |
2684 | if (SAME_BINFO_TYPE_P (BINFO_TYPE (thunk_binfo),((((contains_struct_check (((tree_check ((thunk_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2684, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2684, __FUNCTION__))->typed.type)) == (((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2685, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2685, __FUNCTION__))->typed.type))) |
2685 | BINFO_TYPE (base_binfo))((((contains_struct_check (((tree_check ((thunk_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2684, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2684, __FUNCTION__))->typed.type)) == (((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2685, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2685, __FUNCTION__))->typed.type)))) |
2686 | break; |
2687 | gcc_assert (thunk_binfo || errorcount)((void)(!(thunk_binfo || (global_dc)->diagnostic_count[(int ) (DK_ERROR)]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2687, __FUNCTION__), 0 : 0)); |
2688 | |
2689 | /* See if virtual inheritance is involved. */ |
2690 | for (virtual_offset = thunk_binfo; |
2691 | virtual_offset; |
2692 | virtual_offset = BINFO_INHERITANCE_CHAIN (virtual_offset)((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2692, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance)) |
2693 | if (BINFO_VIRTUAL_P (virtual_offset)((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2693, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
2694 | break; |
2695 | |
2696 | if (virtual_offset |
2697 | || (thunk_binfo && !BINFO_OFFSET_ZEROP (thunk_binfo)(integer_zerop (((tree_check ((thunk_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2697, __FUNCTION__, (TREE_BINFO)))->binfo.offset))))) |
2698 | { |
2699 | tree offset = fold_convert (ssizetype, BINFO_OFFSET (thunk_binfo))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((thunk_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2699, __FUNCTION__, (TREE_BINFO)))->binfo.offset)); |
2700 | |
2701 | if (virtual_offset) |
2702 | { |
2703 | /* We convert via virtual base. Adjust the fixed |
2704 | offset to be from there. */ |
2705 | offset = |
2706 | size_diffop (offset,size_diffop_loc (((location_t) 0), offset, fold_convert_loc ( ((location_t) 0), sizetype_tab[(int) stk_ssizetype], ((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2708, __FUNCTION__, (TREE_BINFO)))->binfo.offset))) |
2707 | fold_convert (ssizetype,size_diffop_loc (((location_t) 0), offset, fold_convert_loc ( ((location_t) 0), sizetype_tab[(int) stk_ssizetype], ((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2708, __FUNCTION__, (TREE_BINFO)))->binfo.offset))) |
2708 | BINFO_OFFSET (virtual_offset)))size_diffop_loc (((location_t) 0), offset, fold_convert_loc ( ((location_t) 0), sizetype_tab[(int) stk_ssizetype], ((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2708, __FUNCTION__, (TREE_BINFO)))->binfo.offset))); |
2709 | } |
2710 | if (fixed_offset) |
2711 | /* There was an existing fixed offset, this must be |
2712 | from the base just converted to, and the base the |
2713 | FN was thunking to. */ |
2714 | fixed_offset = size_binop (PLUS_EXPR, fixed_offset, offset)size_binop_loc (((location_t) 0), PLUS_EXPR, fixed_offset, offset ); |
2715 | else |
2716 | fixed_offset = offset; |
2717 | } |
2718 | } |
2719 | |
2720 | if (fixed_offset || virtual_offset) |
2721 | /* Replace the overriding function with a covariant thunk. We |
2722 | will emit the overriding function in its own slot as |
2723 | well. */ |
2724 | overrider_fn = make_thunk (overrider_target, /*this_adjusting=*/0, |
2725 | fixed_offset, virtual_offset); |
2726 | } |
2727 | else |
2728 | gcc_assert (DECL_INVALID_OVERRIDER_P (overrider_target) ||((void)(!((((contains_struct_check ((overrider_target), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2728, __FUNCTION__))->decl_common.lang_flag_4)) || !(((enum tree_code) (fn)->base.code) == FUNCTION_DECL && ( (contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2729, __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/class.cc" , 2729, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2729, __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/class.cc" , 2729, __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/class.cc" , 2729, __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/class.cc" , 2729, __FUNCTION__); <->u.fn; })->thunk_p)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2729, __FUNCTION__), 0 : 0)) |
2729 | !DECL_THUNK_P (fn))((void)(!((((contains_struct_check ((overrider_target), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2728, __FUNCTION__))->decl_common.lang_flag_4)) || !(((enum tree_code) (fn)->base.code) == FUNCTION_DECL && ( (contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2729, __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/class.cc" , 2729, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2729, __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/class.cc" , 2729, __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/class.cc" , 2729, __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/class.cc" , 2729, __FUNCTION__); <->u.fn; })->thunk_p)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2729, __FUNCTION__), 0 : 0)); |
2730 | |
2731 | /* If we need a covariant thunk, then we may need to adjust first_defn. |
2732 | The ABI specifies that the thunks emitted with a function are |
2733 | determined by which bases the function overrides, so we need to be |
2734 | sure that we're using a thunk for some overridden base; even if we |
2735 | know that the necessary this adjustment is zero, there may not be an |
2736 | appropriate zero-this-adjustment thunk for us to use since thunks for |
2737 | overriding virtual bases always use the vcall offset. |
2738 | |
2739 | Furthermore, just choosing any base that overrides this function isn't |
2740 | quite right, as this slot won't be used for calls through a type that |
2741 | puts a covariant thunk here. Calling the function through such a type |
2742 | will use a different slot, and that slot is the one that determines |
2743 | the thunk emitted for that base. |
2744 | |
2745 | So, keep looking until we find the base that we're really overriding |
2746 | in this slot: the nearest primary base that doesn't use a covariant |
2747 | thunk in this slot. */ |
2748 | if (overrider_target != overrider_fn) |
2749 | { |
2750 | if (BINFO_TYPE (b)((contains_struct_check (((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2750, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2750, __FUNCTION__))->typed.type) == DECL_CONTEXT (overrider_target)((contains_struct_check ((overrider_target), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2750, __FUNCTION__))->decl_minimal.context)) |
2751 | /* We already know that the overrider needs a covariant thunk. */ |
2752 | b = get_primary_binfo (b); |
2753 | for (; ; b = get_primary_binfo (b)) |
2754 | { |
2755 | tree main_binfo = TYPE_BINFO (BINFO_TYPE (b))((tree_check3 ((((contains_struct_check (((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2755, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2755, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2755, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
2756 | tree bv = chain_index (ix, BINFO_VIRTUALS (main_binfo)((tree_check ((main_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2756, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals)); |
2757 | if (!DECL_THUNK_P (TREE_VALUE (bv))(((enum tree_code) (((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value))->base .code) == FUNCTION_DECL && ((contains_struct_check (( ((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value))->base .code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((((tree_check ((bv) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TEMPLATE_DECL))))))))->result : ((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value))->base .code) == FUNCTION_DECL || (((enum tree_code) (((tree_check ( (bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value))->base .code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2757, __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/class.cc" , 2757, __FUNCTION__); <->u.fn; })->thunk_p)) |
2758 | break; |
2759 | if (BINFO_LOST_PRIMARY_P (b)((tree_not_check2 (((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2759, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2759, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)) |
2760 | lost = true; |
2761 | } |
2762 | first_defn = b; |
2763 | } |
2764 | |
2765 | /* Assume that we will produce a thunk that convert all the way to |
2766 | the final overrider, and not to an intermediate virtual base. */ |
2767 | virtual_base = NULL_TREE(tree) __null; |
2768 | |
2769 | /* See if we can convert to an intermediate virtual base first, and then |
2770 | use the vcall offset located there to finish the conversion. */ |
2771 | for (; b; b = BINFO_INHERITANCE_CHAIN (b)((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2771, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance)) |
2772 | { |
2773 | /* If we find the final overrider, then we can stop |
2774 | walking. */ |
2775 | if (SAME_BINFO_TYPE_P (BINFO_TYPE (b),((((contains_struct_check (((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2775, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2775, __FUNCTION__))->typed.type)) == (((contains_struct_check (((tree_check ((((tree_check ((overrider), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2776, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2776, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2776, __FUNCTION__))->typed.type))) |
2776 | BINFO_TYPE (TREE_VALUE (overrider)))((((contains_struct_check (((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2775, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2775, __FUNCTION__))->typed.type)) == (((contains_struct_check (((tree_check ((((tree_check ((overrider), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2776, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2776, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2776, __FUNCTION__))->typed.type)))) |
2777 | break; |
2778 | |
2779 | /* If we find a virtual base, and we haven't yet found the |
2780 | overrider, then there is a virtual base between the |
2781 | declaring base (first_defn) and the final overrider. */ |
2782 | if (BINFO_VIRTUAL_P (b)((tree_check ((b), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2782, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
2783 | { |
2784 | virtual_base = b; |
2785 | break; |
2786 | } |
2787 | } |
2788 | |
2789 | /* Compute the constant adjustment to the `this' pointer. The |
2790 | `this' pointer, when this function is called, will point at BINFO |
2791 | (or one of its primary bases, which are at the same offset). */ |
2792 | if (virtual_base) |
2793 | /* The `this' pointer needs to be adjusted from the declaration to |
2794 | the nearest virtual base. */ |
2795 | delta = size_diffop_loc (input_location, |
2796 | fold_convert (ssizetype, BINFO_OFFSET (virtual_base))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((virtual_base), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2796, __FUNCTION__, (TREE_BINFO)))->binfo.offset)), |
2797 | fold_convert (ssizetype, BINFO_OFFSET (first_defn))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((first_defn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2797, __FUNCTION__, (TREE_BINFO)))->binfo.offset))); |
2798 | else if (lost) |
2799 | /* If the nearest definition is in a lost primary, we don't need an |
2800 | entry in our vtable. Except possibly in a constructor vtable, |
2801 | if we happen to get our primary back. In that case, the offset |
2802 | will be zero, as it will be a primary base. */ |
2803 | delta = size_zero_nodeglobal_trees[TI_SIZE_ZERO]; |
2804 | else |
2805 | /* The `this' pointer needs to be adjusted from pointing to |
2806 | BINFO to pointing at the base where the final overrider |
2807 | appears. */ |
2808 | delta = size_diffop_loc (input_location, |
2809 | fold_convert (ssizetype,fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((((tree_check ((overrider), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2810, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2810, __FUNCTION__, (TREE_BINFO)))->binfo.offset)) |
2810 | BINFO_OFFSET (TREE_VALUE (overrider)))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((((tree_check ((overrider), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2810, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2810, __FUNCTION__, (TREE_BINFO)))->binfo.offset)), |
2811 | fold_convert (ssizetype, BINFO_OFFSET (binfo))fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_ssizetype ], ((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2811, __FUNCTION__, (TREE_BINFO)))->binfo.offset))); |
2812 | |
2813 | modify_vtable_entry (t, binfo, overrider_fn, delta, virtuals); |
2814 | |
2815 | if (virtual_base) |
2816 | BV_VCALL_INDEX (*virtuals)(((contains_struct_check ((*virtuals), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2816, __FUNCTION__))->typed.type)) |
2817 | = get_vcall_index (overrider_target, BINFO_TYPE (virtual_base)((contains_struct_check (((tree_check ((virtual_base), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2817, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2817, __FUNCTION__))->typed.type)); |
2818 | else |
2819 | BV_VCALL_INDEX (*virtuals)(((contains_struct_check ((*virtuals), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2819, __FUNCTION__))->typed.type)) = NULL_TREE(tree) __null; |
2820 | |
2821 | BV_LOST_PRIMARY (*virtuals)(((tree_not_check2 ((*virtuals), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2821, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) = lost; |
2822 | } |
2823 | |
2824 | /* Called from modify_all_vtables via dfs_walk. */ |
2825 | |
2826 | static tree |
2827 | dfs_modify_vtables (tree binfo, void* data) |
2828 | { |
2829 | tree t = (tree) data; |
2830 | tree virtuals; |
2831 | tree old_virtuals; |
2832 | unsigned ix; |
2833 | |
2834 | if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))((((tree_not_check2 ((((contains_struct_check (((tree_check ( (binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2834, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2834, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2834, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) || ((((tree_class_check ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2834, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2834, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2834, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases))) |
2835 | /* A base without a vtable needs no modification, and its bases |
2836 | are uninteresting. */ |
2837 | return dfs_skip_bases((tree)1); |
2838 | |
2839 | if (SAME_BINFO_TYPE_P (BINFO_TYPE (binfo), t)((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2839, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2839, __FUNCTION__))->typed.type)) == (t)) |
2840 | && !CLASSTYPE_HAS_PRIMARY_BASE_P (t)(((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2840, __FUNCTION__))->type_with_lang_specific.lang_specific ))->primary_base) != (tree) __null)) |
2841 | /* Don't do the primary vtable, if it's new. */ |
2842 | return NULL_TREE(tree) __null; |
2843 | |
2844 | if (BINFO_PRIMARY_P (binfo)((tree_not_check2 (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2844, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2844, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) && !BINFO_VIRTUAL_P (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2844, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
2845 | /* There's no need to modify the vtable for a non-virtual primary |
2846 | base; we're not going to use that vtable anyhow. We do still |
2847 | need to do this for virtual primary bases, as they could become |
2848 | non-primary in a construction vtable. */ |
2849 | return NULL_TREE(tree) __null; |
2850 | |
2851 | make_new_vtable (t, binfo); |
2852 | |
2853 | /* Now, go through each of the virtual functions in the virtual |
2854 | function table for BINFO. Find the final overrider, and update |
2855 | the BINFO_VIRTUALS list appropriately. */ |
2856 | for (ix = 0, virtuals = BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2856, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals), |
2857 | old_virtuals = BINFO_VIRTUALS (TYPE_BINFO (BINFO_TYPE (binfo)))((tree_check ((((tree_check3 ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2857, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2857, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2857, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2857, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals); |
2858 | virtuals; |
2859 | ix++, virtuals = TREE_CHAIN (virtuals)((contains_struct_check ((virtuals), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2859, __FUNCTION__))->common.chain), |
2860 | old_virtuals = TREE_CHAIN (old_virtuals)((contains_struct_check ((old_virtuals), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2860, __FUNCTION__))->common.chain)) |
2861 | update_vtable_entry_for_fn (t, |
2862 | binfo, |
2863 | BV_FN (old_virtuals)(((tree_check ((old_virtuals), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2863, __FUNCTION__, (TREE_LIST)))->list.value)), |
2864 | &virtuals, ix); |
2865 | |
2866 | return NULL_TREE(tree) __null; |
2867 | } |
2868 | |
2869 | /* Update all of the primary and secondary vtables for T. Create new |
2870 | vtables as required, and initialize their RTTI information. Each |
2871 | of the functions in VIRTUALS is declared in T and may override a |
2872 | virtual function from a base class; find and modify the appropriate |
2873 | entries to point to the overriding functions. Returns a list, in |
2874 | declaration order, of the virtual functions that are declared in T, |
2875 | but do not appear in the primary base class vtable, and which |
2876 | should therefore be appended to the end of the vtable for T. */ |
2877 | |
2878 | static tree |
2879 | modify_all_vtables (tree t, tree virtuals) |
2880 | { |
2881 | tree binfo = TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2881, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
2882 | tree *fnsp; |
2883 | |
2884 | /* Mangle the vtable name before entering dfs_walk (c++/51884). */ |
2885 | if (TYPE_CONTAINS_VPTR_P (t)((((tree_not_check2 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2885, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) || ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2885, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases))) |
2886 | get_vtable_decl (t, false); |
2887 | |
2888 | /* Update all of the vtables. */ |
2889 | dfs_walk_once (binfo, dfs_modify_vtables, NULL__null, t); |
2890 | |
2891 | /* Add virtual functions not already in our primary vtable. These |
2892 | will be both those introduced by this class, and those overridden |
2893 | from secondary bases. It does not include virtuals merely |
2894 | inherited from secondary bases. */ |
2895 | for (fnsp = &virtuals; *fnsp; ) |
2896 | { |
2897 | tree fn = TREE_VALUE (*fnsp)((tree_check ((*fnsp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2897, __FUNCTION__, (TREE_LIST)))->list.value); |
2898 | |
2899 | if (!value_member (fn, BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2899, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals)) |
2900 | || DECL_VINDEX (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2900, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex ) == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2901 | { |
2902 | /* We don't need to adjust the `this' pointer when |
2903 | calling this function. */ |
2904 | BV_DELTA (*fnsp)(((tree_check ((*fnsp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2904, __FUNCTION__, (TREE_LIST)))->list.purpose)) = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
2905 | BV_VCALL_INDEX (*fnsp)(((contains_struct_check ((*fnsp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2905, __FUNCTION__))->typed.type)) = NULL_TREE(tree) __null; |
2906 | |
2907 | /* This is a function not already in our vtable. Keep it. */ |
2908 | fnsp = &TREE_CHAIN (*fnsp)((contains_struct_check ((*fnsp), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2908, __FUNCTION__))->common.chain); |
2909 | } |
2910 | else |
2911 | /* We've already got an entry for this function. Skip it. */ |
2912 | *fnsp = TREE_CHAIN (*fnsp)((contains_struct_check ((*fnsp), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2912, __FUNCTION__))->common.chain); |
2913 | } |
2914 | |
2915 | return virtuals; |
2916 | } |
2917 | |
2918 | /* Get the base virtual function declarations in T that have the |
2919 | indicated NAME. */ |
2920 | |
2921 | static void |
2922 | get_basefndecls (tree name, tree t, vec<tree> *base_fndecls) |
2923 | { |
2924 | bool found_decls = false; |
2925 | |
2926 | /* Find virtual functions in T with the indicated NAME. */ |
2927 | for (tree method : ovl_range (get_class_binding (t, name))) |
2928 | { |
2929 | if (TREE_CODE (method)((enum tree_code) (method)->base.code) == FUNCTION_DECL && DECL_VINDEX (method)((tree_check ((method), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2929, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex )) |
2930 | { |
2931 | base_fndecls->safe_push (method); |
2932 | found_decls = true; |
2933 | } |
2934 | } |
2935 | |
2936 | if (found_decls) |
2937 | return; |
2938 | |
2939 | int n_baseclasses = BINFO_N_BASE_BINFOS (TYPE_BINFO (t))((&(tree_check ((((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2939, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2939, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> length ()); |
2940 | for (int i = 0; i < n_baseclasses; i++) |
2941 | { |
2942 | tree basetype = BINFO_TYPE (BINFO_BASE_BINFO (TYPE_BINFO (t), i))((contains_struct_check (((tree_check ((((*(&(tree_check ( (((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2942, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2942, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos))[ (i)])), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2942, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2942, __FUNCTION__))->typed.type); |
2943 | get_basefndecls (name, basetype, base_fndecls); |
2944 | } |
2945 | } |
2946 | |
2947 | /* If this method overrides a virtual method from a base, then mark |
2948 | this member function as being virtual as well. Do 'final' and |
2949 | 'override' checks too. */ |
2950 | |
2951 | void |
2952 | check_for_override (tree decl, tree ctype) |
2953 | { |
2954 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TEMPLATE_DECL) |
2955 | /* In [temp.mem] we have: |
2956 | |
2957 | A specialization of a member function template does not |
2958 | override a virtual function from a base class. */ |
2959 | return; |
2960 | |
2961 | /* IDENTIFIER_VIRTUAL_P indicates whether the name has ever been |
2962 | used for a vfunc. That avoids the expensive look_for_overrides |
2963 | call that when we know there's nothing to find. As conversion |
2964 | operators for the same type can have distinct identifiers, we |
2965 | cannot optimize those in that way. */ |
2966 | if ((IDENTIFIER_VIRTUAL_P (DECL_NAME (decl))((tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2966, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2966, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2966, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) |
2967 | || DECL_CONV_FN_P (decl)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __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/class.cc" , 2967, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2967, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) |
2968 | && look_for_overrides (ctype, decl) |
2969 | /* Check staticness after we've checked if we 'override'. */ |
2970 | && !DECL_STATIC_FUNCTION_P (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/class.cc" , 2970, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2970, __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/class.cc" , 2970, __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/class.cc" , 2970, __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/class.cc" , 2970, __FUNCTION__); <->u.fn; })->static_function )) |
2971 | { |
2972 | /* Set DECL_VINDEX to a value that is neither an INTEGER_CST nor |
2973 | the error_mark_node so that we know it is an overriding |
2974 | function. */ |
2975 | DECL_VINDEX (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2975, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex ) = decl; |
2976 | |
2977 | if (warn_overrideglobal_options.x_warn_override |
2978 | && !DECL_OVERRIDE_P (decl)(((tree_not_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2978, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) |
2979 | && !DECL_FINAL_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2979, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.final ) |
2980 | && !DECL_DESTRUCTOR_P (decl)((tree_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/class.cc" , 2980, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2980, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) |
2981 | warning_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2981, __FUNCTION__))->decl_minimal.locus), OPT_Wsuggest_override, |
2982 | "%qD can be marked override", decl); |
2983 | } |
2984 | else if (DECL_OVERRIDE_P (decl)(((tree_not_check2 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2984, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
2985 | error ("%q+#D marked %<override%>, but does not override", decl); |
2986 | |
2987 | if (DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2987, __FUNCTION__))->decl_common.virtual_flag)) |
2988 | { |
2989 | /* Remember this identifier is virtual name. */ |
2990 | IDENTIFIER_VIRTUAL_P (DECL_NAME (decl))((tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2990, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2990, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2990, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5) = true; |
2991 | |
2992 | if (!DECL_VINDEX (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2992, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex )) |
2993 | /* It's a new vfunc. */ |
2994 | DECL_VINDEX (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2994, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex ) = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2995 | |
2996 | if (DECL_DESTRUCTOR_P (decl)((tree_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/class.cc" , 2996, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2996, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) |
2997 | TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2997, __FUNCTION__))->type_common.lang_flag_4)) = true; |
2998 | } |
2999 | else if (DECL_FINAL_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 2999, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.final )) |
3000 | error ("%q+#D marked %<final%>, but is not virtual", decl); |
3001 | } |
3002 | |
3003 | /* Warn about hidden virtual functions that are not overridden in t. |
3004 | We know that constructors and destructors don't apply. */ |
3005 | |
3006 | static void |
3007 | warn_hidden (tree t) |
3008 | { |
3009 | if (vec<tree, va_gc> *member_vec = CLASSTYPE_MEMBER_VEC (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3009, __FUNCTION__))->type_with_lang_specific.lang_specific ))->members)) |
3010 | for (unsigned ix = member_vec->length (); ix--;) |
3011 | { |
3012 | tree fns = (*member_vec)[ix]; |
3013 | |
3014 | if (!OVL_P (fns)(((enum tree_code) (fns)->base.code) == FUNCTION_DECL || ( (enum tree_code) (fns)->base.code) == OVERLOAD)) |
3015 | continue; |
3016 | |
3017 | tree name = OVL_NAME (fns)((contains_struct_check ((ovl_first (fns)), (TS_DECL_MINIMAL) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3017, __FUNCTION__))->decl_minimal.name); |
3018 | auto_vec<tree, 20> base_fndecls; |
3019 | tree base_binfo; |
3020 | tree binfo; |
3021 | unsigned j; |
3022 | |
3023 | if (IDENTIFIER_CDTOR_P (name)((!((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3023, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3023, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3023, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3023, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1))) |
3024 | continue; |
3025 | |
3026 | /* Iterate through all of the base classes looking for possibly |
3027 | hidden functions. */ |
3028 | for (binfo = TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3028, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), j = 0; |
3029 | BINFO_BASE_ITERATE (binfo, j, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3029, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((j), &(base_binfo))); j++) |
3030 | { |
3031 | tree basetype = BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3031, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3031, __FUNCTION__))->typed.type); |
3032 | get_basefndecls (name, basetype, &base_fndecls); |
3033 | } |
3034 | |
3035 | /* If there are no functions to hide, continue. */ |
3036 | if (base_fndecls.is_empty ()) |
3037 | continue; |
3038 | |
3039 | /* Remove any overridden functions. */ |
3040 | bool seen_non_override = false; |
3041 | for (tree fndecl : ovl_range (fns)) |
3042 | { |
3043 | bool any_override = false; |
3044 | if (TREE_CODE (fndecl)((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL |
3045 | && DECL_VINDEX (fndecl)((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3045, __FUNCTION__, (FUNCTION_DECL)))->function_decl.vindex )) |
3046 | { |
3047 | /* If the method from the base class has the same |
3048 | signature as the method from the derived class, it |
3049 | has been overridden. Note that we can't move on |
3050 | after finding one match: fndecl might override |
3051 | multiple base fns. */ |
3052 | for (size_t k = 0; k < base_fndecls.length (); k++) |
3053 | if (base_fndecls[k] |
3054 | && same_signature_p (fndecl, base_fndecls[k])) |
3055 | { |
3056 | base_fndecls[k] = NULL_TREE(tree) __null; |
3057 | any_override = true; |
3058 | } |
3059 | } |
3060 | if (!any_override) |
3061 | seen_non_override = true; |
3062 | } |
3063 | |
3064 | if (!seen_non_override && warn_overloaded_virtualglobal_options.x_warn_overloaded_virtual == 1) |
3065 | /* All the derived fns override base virtuals. */ |
3066 | return; |
3067 | |
3068 | /* Now give a warning for all base functions without overriders, |
3069 | as they are hidden. */ |
3070 | for (tree base_fndecl : base_fndecls) |
3071 | if (base_fndecl) |
3072 | { |
3073 | auto_diagnostic_group d; |
3074 | /* Here we know it is a hider, and no overrider exists. */ |
3075 | if (warning_at (location_of (base_fndecl), |
3076 | OPT_Woverloaded_virtual_, |
3077 | "%qD was hidden", base_fndecl)) |
3078 | inform (location_of (fns), " by %qD", fns); |
3079 | } |
3080 | } |
3081 | } |
3082 | |
3083 | /* Recursive helper for finish_struct_anon. */ |
3084 | |
3085 | static void |
3086 | finish_struct_anon_r (tree field) |
3087 | { |
3088 | for (tree elt = TYPE_FIELDS (TREE_TYPE (field))((tree_check3 ((((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3088, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3088, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); elt; elt = DECL_CHAIN (elt)(((contains_struct_check (((contains_struct_check ((elt), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3088, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3088, __FUNCTION__))->common.chain))) |
3089 | { |
3090 | /* We're generally only interested in entities the user |
3091 | declared, but we also find nested classes by noticing |
3092 | the TYPE_DECL that we create implicitly. You're |
3093 | allowed to put one anonymous union inside another, |
3094 | though, so we explicitly tolerate that. We use |
3095 | TYPE_UNNAMED_P rather than ANON_AGGR_TYPE_P so that |
3096 | we also allow unnamed types used for defining fields. */ |
3097 | if (DECL_ARTIFICIAL (elt)((contains_struct_check ((elt), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3097, __FUNCTION__))->decl_common.artificial_flag) |
3098 | && (!DECL_IMPLICIT_TYPEDEF_P (elt)(((enum tree_code) (elt)->base.code) == TYPE_DECL && ((contains_struct_check ((elt), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3098, __FUNCTION__))->decl_common.lang_flag_2)) |
3099 | || TYPE_UNNAMED_P (TREE_TYPE (elt))((((((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __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 ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __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 ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__, (IDENTIFIER_NODE)))->base.private_flag )) && !((tree_check ((((((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __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 ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3099, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag )))) |
3100 | continue; |
3101 | |
3102 | TREE_PRIVATE (elt)((elt)->base.private_flag) = TREE_PRIVATE (field)((field)->base.private_flag); |
3103 | TREE_PROTECTED (elt)((elt)->base.protected_flag) = TREE_PROTECTED (field)((field)->base.protected_flag); |
3104 | |
3105 | /* Recurse into the anonymous aggregates to correctly handle |
3106 | access control (c++/24926): |
3107 | |
3108 | class A { |
3109 | union { |
3110 | union { |
3111 | int i; |
3112 | }; |
3113 | }; |
3114 | }; |
3115 | |
3116 | int j=A().i; */ |
3117 | if (DECL_NAME (elt)((contains_struct_check ((elt), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3117, __FUNCTION__))->decl_minimal.name) == NULL_TREE(tree) __null |
3118 | && ANON_AGGR_TYPE_P (TREE_TYPE (elt))((((((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3118, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3118, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((elt ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3118, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3118, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((((contains_struct_check ((elt), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3118, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3118, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr)) |
3119 | finish_struct_anon_r (elt); |
3120 | } |
3121 | } |
3122 | |
3123 | /* Fix up any anonymous union/struct members of T. */ |
3124 | |
3125 | static void |
3126 | finish_struct_anon (tree t) |
3127 | { |
3128 | for (tree field = TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3128, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3128, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3128, __FUNCTION__))->common.chain))) |
3129 | { |
3130 | if (TREE_STATIC (field)((field)->base.static_flag)) |
3131 | continue; |
3132 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL) |
3133 | continue; |
3134 | |
3135 | if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3135, __FUNCTION__))->decl_minimal.name) == NULL_TREE(tree) __null |
3136 | && 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/class.cc" , 3136, __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/class.cc" , 3136, __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/class.cc" , 3136, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3136, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((((contains_struct_check ((field), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3136, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3136, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr)) |
3137 | finish_struct_anon_r (field); |
3138 | } |
3139 | } |
3140 | |
3141 | /* Add T to CLASSTYPE_DECL_LIST of current_class_type which |
3142 | will be used later during class template instantiation. |
3143 | When FRIEND_P is zero, T can be a static member data (VAR_DECL), |
3144 | a non-static member data (FIELD_DECL), a member function |
3145 | (FUNCTION_DECL), a nested type (RECORD_TYPE, ENUM_TYPE), |
3146 | a typedef (TYPE_DECL) or a member class template (TEMPLATE_DECL) |
3147 | When FRIEND_P is nonzero, T is either a friend class |
3148 | (RECORD_TYPE, TEMPLATE_DECL) or a friend function |
3149 | (FUNCTION_DECL, TEMPLATE_DECL). */ |
3150 | |
3151 | void |
3152 | maybe_add_class_template_decl_list (tree type, tree t, int friend_p) |
3153 | { |
3154 | if (CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3154, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3154, __FUNCTION__))->type_non_common.lang_1)) |
3155 | && TREE_CODE (t)((enum tree_code) (t)->base.code) != CONST_DECL) |
3156 | { |
3157 | tree purpose = friend_p ? NULL_TREE(tree) __null : type; |
3158 | |
3159 | CLASSTYPE_DECL_LIST (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3159, __FUNCTION__))->type_with_lang_specific.lang_specific ))->decl_list) |
3160 | = tree_cons (purpose, t, CLASSTYPE_DECL_LIST (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3160, __FUNCTION__))->type_with_lang_specific.lang_specific ))->decl_list)); |
3161 | } |
3162 | } |
3163 | |
3164 | /* This function is called from declare_virt_assop_and_dtor via |
3165 | dfs_walk_all. |
3166 | |
3167 | DATA is a type that direcly or indirectly inherits the base |
3168 | represented by BINFO. If BINFO contains a virtual assignment [copy |
3169 | assignment or move assigment] operator or a virtual constructor, |
3170 | declare that function in DATA if it hasn't been already declared. */ |
3171 | |
3172 | static tree |
3173 | dfs_declare_virt_assop_and_dtor (tree binfo, void *data) |
3174 | { |
3175 | tree bv, fn, t = (tree)data; |
3176 | tree opname = assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier); |
3177 | |
3178 | gcc_assert (t && CLASS_TYPE_P (t))((void)(!(t && (((((enum tree_code) (t)->base.code )) == RECORD_TYPE || (((enum tree_code) (t)->base.code)) == UNION_TYPE) && ((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3178, __FUNCTION__))->type_common.lang_flag_5))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3178, __FUNCTION__), 0 : 0)); |
3179 | gcc_assert (binfo && TREE_CODE (binfo) == TREE_BINFO)((void)(!(binfo && ((enum tree_code) (binfo)->base .code) == TREE_BINFO) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3179, __FUNCTION__), 0 : 0)); |
3180 | |
3181 | if (!TYPE_CONTAINS_VPTR_P (BINFO_TYPE (binfo))((((tree_not_check2 ((((contains_struct_check (((tree_check ( (binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3181, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3181, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3181, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) || ((((tree_class_check ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3181, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3181, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3181, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases))) |
3182 | /* A base without a vtable needs no modification, and its bases |
3183 | are uninteresting. */ |
3184 | return dfs_skip_bases((tree)1); |
3185 | |
3186 | if (BINFO_PRIMARY_P (binfo)((tree_not_check2 (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3186, __FUNCTION__, (TREE_BINFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3186, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_5)) |
3187 | /* If this is a primary base, then we have already looked at the |
3188 | virtual functions of its vtable. */ |
3189 | return NULL_TREE(tree) __null; |
3190 | |
3191 | for (bv = BINFO_VIRTUALS (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3191, __FUNCTION__, (TREE_BINFO)))->binfo.virtuals); bv; bv = TREE_CHAIN (bv)((contains_struct_check ((bv), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3191, __FUNCTION__))->common.chain)) |
3192 | { |
3193 | fn = BV_FN (bv)(((tree_check ((bv), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3193, __FUNCTION__, (TREE_LIST)))->list.value)); |
3194 | |
3195 | if (DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3195, __FUNCTION__))->decl_minimal.name) == opname) |
3196 | { |
3197 | if (CLASSTYPE_LAZY_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3197, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_copy_assign)) |
3198 | lazily_declare_fn (sfk_copy_assignment, t); |
3199 | if (CLASSTYPE_LAZY_MOVE_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3199, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_move_assign)) |
3200 | lazily_declare_fn (sfk_move_assignment, t); |
3201 | } |
3202 | else if (DECL_DESTRUCTOR_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/class.cc" , 3202, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3202, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) |
3203 | && CLASSTYPE_LAZY_DESTRUCTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3203, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_destructor)) |
3204 | lazily_declare_fn (sfk_destructor, t); |
3205 | } |
3206 | |
3207 | return NULL_TREE(tree) __null; |
3208 | } |
3209 | |
3210 | /* If the class type T has a direct or indirect base that contains a |
3211 | virtual assignment operator or a virtual destructor, declare that |
3212 | function in T if it hasn't been already declared. */ |
3213 | |
3214 | static void |
3215 | declare_virt_assop_and_dtor (tree t) |
3216 | { |
3217 | if (!(TYPE_POLYMORPHIC_P (t)(((tree_not_check2 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3217, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) |
3218 | && (CLASSTYPE_LAZY_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3218, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_copy_assign) |
3219 | || CLASSTYPE_LAZY_MOVE_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3219, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_move_assign) |
3220 | || CLASSTYPE_LAZY_DESTRUCTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3220, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_destructor)))) |
3221 | return; |
3222 | |
3223 | dfs_walk_all (TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3223, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), |
3224 | dfs_declare_virt_assop_and_dtor, |
3225 | NULL__null, t); |
3226 | } |
3227 | |
3228 | /* Declare the inheriting constructor for class T inherited from base |
3229 | constructor CTOR with the parameter array PARMS of size NPARMS. */ |
3230 | |
3231 | static void |
3232 | one_inheriting_sig (tree t, tree ctor, tree *parms, int nparms) |
3233 | { |
3234 | gcc_assert (TYPE_MAIN_VARIANT (t) == t)((void)(!(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3234, __FUNCTION__))->type_common.main_variant) == t) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3234, __FUNCTION__), 0 : 0)); |
3235 | |
3236 | /* We don't declare an inheriting ctor that would be a default, |
3237 | copy or move ctor for derived or base. */ |
3238 | if (nparms == 0) |
3239 | return; |
3240 | if (nparms == 1 |
3241 | && TYPE_REF_P (parms[0])(((enum tree_code) (parms[0])->base.code) == REFERENCE_TYPE )) |
3242 | { |
3243 | tree parm = TYPE_MAIN_VARIANT (TREE_TYPE (parms[0]))((tree_class_check ((((contains_struct_check ((parms[0]), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3243, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3243, __FUNCTION__))->type_common.main_variant); |
3244 | if (parm == t || parm == DECL_CONTEXT (ctor)((contains_struct_check ((ctor), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3244, __FUNCTION__))->decl_minimal.context)) |
3245 | return; |
3246 | } |
3247 | |
3248 | tree parmlist = void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; |
3249 | for (int i = nparms - 1; i >= 0; i--) |
3250 | parmlist = tree_cons (NULL_TREE(tree) __null, parms[i], parmlist); |
3251 | tree fn = implicitly_declare_fn (sfk_inheriting_constructor, |
3252 | t, false, ctor, parmlist); |
3253 | |
3254 | if (add_method (t, fn, false)) |
3255 | { |
3256 | DECL_CHAIN (fn)(((contains_struct_check (((contains_struct_check ((fn), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3256, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3256, __FUNCTION__))->common.chain)) = TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3256, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
3257 | TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3257, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = fn; |
3258 | } |
3259 | } |
3260 | |
3261 | /* Declare all the inheriting constructors for class T inherited from base |
3262 | constructor CTOR. */ |
3263 | |
3264 | static void |
3265 | one_inherited_ctor (tree ctor, tree t, tree using_decl) |
3266 | { |
3267 | tree parms = FUNCTION_FIRST_USER_PARMTYPE (ctor)skip_artificial_parms_for ((ctor), ((tree_check2 ((((contains_struct_check ((ctor), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3267, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3267, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); |
3268 | |
3269 | if (flag_new_inheriting_ctorsglobal_options.x_flag_new_inheriting_ctors) |
3270 | { |
3271 | ctor = implicitly_declare_fn (sfk_inheriting_constructor, |
3272 | t, /*const*/false, ctor, parms); |
3273 | add_method (t, ctor, using_decl != NULL_TREE(tree) __null); |
3274 | return; |
3275 | } |
3276 | |
3277 | tree *new_parms = XALLOCAVEC (tree, list_length (parms))((tree *) __builtin_alloca(sizeof (tree) * (list_length (parms )))); |
3278 | int i = 0; |
3279 | for (; parms && parms != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; parms = TREE_CHAIN (parms)((contains_struct_check ((parms), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3279, __FUNCTION__))->common.chain)) |
3280 | { |
3281 | if (TREE_PURPOSE (parms)((tree_check ((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3281, __FUNCTION__, (TREE_LIST)))->list.purpose)) |
3282 | one_inheriting_sig (t, ctor, new_parms, i); |
3283 | new_parms[i++] = TREE_VALUE (parms)((tree_check ((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3283, __FUNCTION__, (TREE_LIST)))->list.value); |
3284 | } |
3285 | one_inheriting_sig (t, ctor, new_parms, i); |
3286 | if (parms == NULL_TREE(tree) __null) |
3287 | { |
3288 | auto_diagnostic_group d; |
3289 | if (warning (OPT_Winherited_variadic_ctor, |
3290 | "the ellipsis in %qD is not inherited", ctor)) |
3291 | inform (DECL_SOURCE_LOCATION (ctor)((contains_struct_check ((ctor), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3291, __FUNCTION__))->decl_minimal.locus), "%qD declared here", ctor); |
3292 | } |
3293 | } |
3294 | |
3295 | /* Create default constructors, assignment operators, and so forth for |
3296 | the type indicated by T, if they are needed. CANT_HAVE_CONST_CTOR, |
3297 | and CANT_HAVE_CONST_ASSIGNMENT are nonzero if, for whatever reason, |
3298 | the class cannot have a default constructor, copy constructor |
3299 | taking a const reference argument, or an assignment operator taking |
3300 | a const reference, respectively. */ |
3301 | |
3302 | static void |
3303 | add_implicitly_declared_members (tree t, tree* access_decls, |
3304 | int cant_have_const_cctor, |
3305 | int cant_have_const_assignment) |
3306 | { |
3307 | /* Destructor. */ |
3308 | if (!CLASSTYPE_DESTRUCTOR (t)(get_class_binding_direct (t, cp_global_trees[CPTI_DTOR_IDENTIFIER ]))) |
3309 | /* In general, we create destructors lazily. */ |
3310 | CLASSTYPE_LAZY_DESTRUCTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3310, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_destructor) = 1; |
3311 | |
3312 | bool move_ok = false; |
3313 | if (cxx_dialect >= cxx11 && CLASSTYPE_LAZY_DESTRUCTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3313, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_destructor) |
3314 | && !TYPE_HAS_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3314, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor) && !TYPE_HAS_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3314, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign) |
3315 | && !classtype_has_move_assign_or_move_ctor_p (t, false)) |
3316 | move_ok = true; |
3317 | |
3318 | /* [class.ctor] |
3319 | |
3320 | If there is no user-declared constructor for a class, a default |
3321 | constructor is implicitly declared. */ |
3322 | if (! TYPE_HAS_USER_CONSTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3322, __FUNCTION__))->type_common.lang_flag_1))) |
3323 | { |
3324 | TYPE_HAS_DEFAULT_CONSTRUCTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3324, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_default_ctor) = 1; |
3325 | CLASSTYPE_LAZY_DEFAULT_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3325, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_default_ctor) = 1; |
3326 | if (cxx_dialect >= cxx11) |
3327 | TYPE_HAS_CONSTEXPR_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3327, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_constexpr_ctor) |
3328 | /* Don't force the declaration to get a hard answer; if the |
3329 | definition would have made the class non-literal, it will still be |
3330 | non-literal because of the base or member in question, and that |
3331 | gives a better diagnostic. */ |
3332 | = type_maybe_constexpr_default_constructor (t); |
3333 | } |
3334 | |
3335 | /* [class.ctor] |
3336 | |
3337 | If a class definition does not explicitly declare a copy |
3338 | constructor, one is declared implicitly. */ |
3339 | if (! TYPE_HAS_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3339, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor)) |
3340 | { |
3341 | TYPE_HAS_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3341, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor) = 1; |
3342 | TYPE_HAS_CONST_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3342, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_ctor) = !cant_have_const_cctor; |
3343 | CLASSTYPE_LAZY_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3343, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_copy_ctor) = 1; |
3344 | if (move_ok) |
3345 | CLASSTYPE_LAZY_MOVE_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3345, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_move_ctor) = 1; |
3346 | } |
3347 | |
3348 | /* If there is no assignment operator, one will be created if and |
3349 | when it is needed. For now, just record whether or not the type |
3350 | of the parameter to the assignment operator will be a const or |
3351 | non-const reference. */ |
3352 | if (!TYPE_HAS_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3352, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign)) |
3353 | { |
3354 | TYPE_HAS_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3354, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign) = 1; |
3355 | TYPE_HAS_CONST_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3355, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_assign) = !cant_have_const_assignment; |
3356 | CLASSTYPE_LAZY_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3356, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_copy_assign) = 1; |
3357 | if (move_ok && !LAMBDA_TYPE_P (t)(((enum tree_code) (t)->base.code) == RECORD_TYPE && ((((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __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/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __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/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((t), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __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/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __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/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3357, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag ))) |
3358 | CLASSTYPE_LAZY_MOVE_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3358, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_move_assign) = 1; |
3359 | } |
3360 | |
3361 | /* We can't be lazy about declaring functions that might override |
3362 | a virtual function from a base class. */ |
3363 | declare_virt_assop_and_dtor (t); |
3364 | |
3365 | /* If the class definition does not explicitly declare an == operator |
3366 | function, but declares a defaulted three-way comparison operator function, |
3367 | an == operator function is declared implicitly. */ |
3368 | if (!classtype_has_op (t, EQ_EXPR)) |
3369 | if (tree space = classtype_has_defaulted_op (t, SPACESHIP_EXPR)) |
3370 | { |
3371 | tree eq = implicitly_declare_fn (sfk_comparison, t, false, space, |
3372 | NULL_TREE(tree) __null); |
3373 | bool is_friend = DECL_CONTEXT (space)((contains_struct_check ((space), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3373, __FUNCTION__))->decl_minimal.context) != t; |
3374 | if (is_friend) |
3375 | do_friend (NULL_TREE(tree) __null, DECL_NAME (eq)((contains_struct_check ((eq), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3375, __FUNCTION__))->decl_minimal.name), eq, |
3376 | NO_SPECIAL, true); |
3377 | else |
3378 | { |
3379 | add_method (t, eq, false); |
3380 | DECL_CHAIN (eq)(((contains_struct_check (((contains_struct_check ((eq), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3380, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3380, __FUNCTION__))->common.chain)) = TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3380, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); |
3381 | TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3381, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = eq; |
3382 | } |
3383 | maybe_add_class_template_decl_list (t, eq, is_friend); |
3384 | } |
3385 | |
3386 | while (*access_decls) |
3387 | { |
3388 | tree using_decl = TREE_VALUE (*access_decls)((tree_check ((*access_decls), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3388, __FUNCTION__, (TREE_LIST)))->list.value); |
3389 | tree decl = USING_DECL_DECLS (using_decl)((contains_struct_check (((tree_check ((using_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3389, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3389, __FUNCTION__))->decl_common.initial); |
3390 | if (DECL_NAME (using_decl)((contains_struct_check ((using_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3390, __FUNCTION__))->decl_minimal.name) == ctor_identifiercp_global_trees[CPTI_CTOR_IDENTIFIER]) |
3391 | { |
3392 | /* declare, then remove the decl */ |
3393 | tree ctor_list = decl; |
3394 | location_t loc = input_location; |
3395 | input_location = DECL_SOURCE_LOCATION (using_decl)((contains_struct_check ((using_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3395, __FUNCTION__))->decl_minimal.locus); |
3396 | for (tree fn : ovl_range (ctor_list)) |
3397 | one_inherited_ctor (fn, t, using_decl); |
3398 | *access_decls = TREE_CHAIN (*access_decls)((contains_struct_check ((*access_decls), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3398, __FUNCTION__))->common.chain); |
3399 | input_location = loc; |
3400 | } |
3401 | else |
3402 | access_decls = &TREE_CHAIN (*access_decls)((contains_struct_check ((*access_decls), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3402, __FUNCTION__))->common.chain); |
3403 | } |
3404 | } |
3405 | |
3406 | /* Cache of enum_min_precision values. */ |
3407 | static GTY((deletable)) hash_map<tree, int> *enum_to_min_precision; |
3408 | |
3409 | /* Return the minimum precision of a bit-field needed to store all |
3410 | enumerators of ENUMERAL_TYPE TYPE. */ |
3411 | |
3412 | static int |
3413 | enum_min_precision (tree type) |
3414 | { |
3415 | type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3415, __FUNCTION__))->type_common.main_variant); |
3416 | /* For unscoped enums without fixed underlying type and without mode |
3417 | attribute we can just use precision of the underlying type. */ |
3418 | if (UNSCOPED_ENUM_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE && !((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3418, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag) ) |
3419 | && !ENUM_FIXED_UNDERLYING_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3419, __FUNCTION__))->type_common.lang_flag_5)) |
3420 | && !lookup_attribute ("mode", TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3420, __FUNCTION__))->type_common.attributes))) |
3421 | return TYPE_PRECISION (ENUM_UNDERLYING_TYPE (type))((tree_class_check ((((contains_struct_check (((tree_check (( type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3421, __FUNCTION__, (ENUMERAL_TYPE)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3421, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3421, __FUNCTION__))->type_common.precision); |
3422 | |
3423 | if (enum_to_min_precision == NULL__null) |
3424 | enum_to_min_precision = hash_map<tree, int>::create_ggc (37); |
3425 | |
3426 | bool existed; |
3427 | int &prec = enum_to_min_precision->get_or_insert (type, &existed); |
3428 | if (existed) |
3429 | return prec; |
3430 | |
3431 | tree minnode, maxnode; |
3432 | if (TYPE_VALUES (type)((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3432, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values )) |
3433 | { |
3434 | minnode = maxnode = NULL_TREE(tree) __null; |
3435 | for (tree values = TYPE_VALUES (type)((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3435, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values ); |
3436 | values; values = TREE_CHAIN (values)((contains_struct_check ((values), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3436, __FUNCTION__))->common.chain)) |
3437 | { |
3438 | tree decl = TREE_VALUE (values)((tree_check ((values), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3438, __FUNCTION__, (TREE_LIST)))->list.value); |
3439 | tree value = DECL_INITIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3439, __FUNCTION__))->decl_common.initial); |
3440 | if (value == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
3441 | value = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
3442 | if (!minnode) |
3443 | minnode = maxnode = value; |
3444 | else if (tree_int_cst_lt (maxnode, value)) |
3445 | maxnode = value; |
3446 | else if (tree_int_cst_lt (value, minnode)) |
3447 | minnode = value; |
3448 | } |
3449 | } |
3450 | else |
3451 | minnode = maxnode = integer_zero_nodeglobal_trees[TI_INTEGER_ZERO]; |
3452 | |
3453 | signop sgn = tree_int_cst_sgn (minnode) >= 0 ? UNSIGNED : SIGNED; |
3454 | int lowprec = tree_int_cst_min_precision (minnode, sgn); |
3455 | int highprec = tree_int_cst_min_precision (maxnode, sgn); |
3456 | prec = MAX (lowprec, highprec)((lowprec) > (highprec) ? (lowprec) : (highprec)); |
3457 | return prec; |
3458 | } |
3459 | |
3460 | /* FIELD is a bit-field. We are finishing the processing for its |
3461 | enclosing type. Issue any appropriate messages and set appropriate |
3462 | flags. Returns false if an error has been diagnosed. */ |
3463 | |
3464 | static bool |
3465 | check_bitfield_decl (tree field) |
3466 | { |
3467 | tree type = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3467, __FUNCTION__))->typed.type); |
3468 | tree w; |
3469 | |
3470 | /* Extract the declared width of the bitfield, which has been |
3471 | temporarily stashed in DECL_BIT_FIELD_REPRESENTATIVE by grokbitfield. */ |
3472 | w = DECL_BIT_FIELD_REPRESENTATIVE (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3472, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier ); |
3473 | gcc_assert (w != NULL_TREE)((void)(!(w != (tree) __null) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3473, __FUNCTION__), 0 : 0)); |
3474 | /* Remove the bit-field width indicator so that the rest of the |
3475 | compiler does not treat that value as a qualifier. */ |
3476 | DECL_BIT_FIELD_REPRESENTATIVE (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3476, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier ) = NULL_TREE(tree) __null; |
3477 | |
3478 | /* Detect invalid bit-field type. */ |
3479 | 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))) |
3480 | { |
3481 | error_at (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3481, __FUNCTION__))->decl_minimal.locus), |
3482 | "bit-field %q#D with non-integral type %qT", field, type); |
3483 | w = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3484 | } |
3485 | else |
3486 | { |
3487 | location_t loc = input_location; |
3488 | /* Avoid the non_lvalue wrapper added by fold for PLUS_EXPRs. */ |
3489 | STRIP_NOPS (w)(w) = tree_strip_nop_conversions ((const_cast<union tree_node *> (((w))))); |
3490 | |
3491 | /* detect invalid field size. */ |
3492 | input_location = DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3492, __FUNCTION__))->decl_minimal.locus); |
3493 | w = cxx_constant_value (w); |
3494 | input_location = loc; |
3495 | |
3496 | if (TREE_CODE (w)((enum tree_code) (w)->base.code) != INTEGER_CST) |
3497 | { |
3498 | error ("bit-field %q+D width not an integer constant", field); |
3499 | w = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3500 | } |
3501 | else if (tree_int_cst_sgn (w) < 0) |
3502 | { |
3503 | error ("negative width in bit-field %q+D", field); |
3504 | w = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3505 | } |
3506 | else if (integer_zerop (w) && DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3506, __FUNCTION__))->decl_minimal.name) != 0) |
3507 | { |
3508 | error ("zero width for bit-field %q+D", field); |
3509 | w = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3510 | } |
3511 | else if ((TREE_CODE (type)((enum tree_code) (type)->base.code) != ENUMERAL_TYPE |
3512 | && TREE_CODE (type)((enum tree_code) (type)->base.code) != BOOLEAN_TYPE |
3513 | && compare_tree_int (w, TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3513, __FUNCTION__))->type_common.precision)) > 0) |
3514 | || ((TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE |
3515 | || TREE_CODE (type)((enum tree_code) (type)->base.code) == BOOLEAN_TYPE) |
3516 | && tree_int_cst_lt (TYPE_SIZE (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3516, __FUNCTION__))->type_common.size), w))) |
3517 | warning_at (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3517, __FUNCTION__))->decl_minimal.locus), 0, |
3518 | "width of %qD exceeds its type", field); |
3519 | else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE) |
3520 | { |
3521 | int prec = enum_min_precision (type); |
3522 | if (compare_tree_int (w, prec) < 0) |
3523 | warning_at (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3523, __FUNCTION__))->decl_minimal.locus), 0, |
3524 | "%qD is too small to hold all values of %q#T", |
3525 | field, type); |
3526 | } |
3527 | } |
3528 | |
3529 | if (w != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
3530 | { |
3531 | DECL_SIZE (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3531, __FUNCTION__))->decl_common.size) = fold_convert (bitsizetype, w)fold_convert_loc (((location_t) 0), sizetype_tab[(int) stk_bitsizetype ], w); |
3532 | DECL_BIT_FIELD (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3532, __FUNCTION__, (FIELD_DECL)))->decl_common.decl_flag_1 ) = 1; |
3533 | return true; |
3534 | } |
3535 | else |
3536 | { |
3537 | /* Non-bit-fields are aligned for their type. */ |
3538 | DECL_BIT_FIELD (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3538, __FUNCTION__, (FIELD_DECL)))->decl_common.decl_flag_1 ) = 0; |
3539 | CLEAR_DECL_C_BIT_FIELD (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3539, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3539, __FUNCTION__))->decl_common.lang_flag_4) = 0); |
3540 | return false; |
3541 | } |
3542 | } |
3543 | |
3544 | /* FIELD is a non bit-field. We are finishing the processing for its |
3545 | enclosing type T. Issue any appropriate messages and set appropriate |
3546 | flags. */ |
3547 | |
3548 | static bool |
3549 | check_field_decl (tree field, |
3550 | tree t, |
3551 | int* cant_have_const_ctor, |
3552 | int* no_const_asn_ref) |
3553 | { |
3554 | tree type = strip_array_types (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3554, __FUNCTION__))->typed.type)); |
3555 | bool any_default_members = false; |
3556 | |
3557 | /* In C++98 an anonymous union cannot contain any fields which would change |
3558 | the settings of CANT_HAVE_CONST_CTOR and friends. */ |
3559 | if (ANON_UNION_TYPE_P (type)(((enum tree_code) (type)->base.code) == UNION_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/class.cc" , 3559, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3559, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr)) && cxx_dialect < cxx11) |
3560 | ; |
3561 | /* And, we don't set TYPE_HAS_CONST_COPY_CTOR, etc., for anonymous |
3562 | structs. So, we recurse through their fields here. */ |
3563 | else 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/class.cc" , 3563, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3563, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr)) |
3564 | { |
3565 | for (tree fields = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3565, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); fields; |
3566 | fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3566, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3566, __FUNCTION__))->common.chain))) |
3567 | if (TREE_CODE (fields)((enum tree_code) (fields)->base.code) == FIELD_DECL) |
3568 | any_default_members |= check_field_decl (fields, t, |
3569 | cant_have_const_ctor, |
3570 | no_const_asn_ref); |
3571 | } |
3572 | /* Check members with class type for constructors, destructors, |
3573 | etc. */ |
3574 | else 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/class.cc" , 3574, __FUNCTION__))->type_common.lang_flag_5))) |
3575 | { |
3576 | /* Never let anything with uninheritable virtuals |
3577 | make it through without complaint. */ |
3578 | abstract_virtuals_error (field, type); |
3579 | |
3580 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == UNION_TYPE && cxx_dialect < cxx11) |
3581 | { |
3582 | static bool warned; |
3583 | int oldcount = errorcount(global_dc)->diagnostic_count[(int) (DK_ERROR)]; |
3584 | if (TYPE_NEEDS_CONSTRUCTING (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3584, __FUNCTION__))->type_common.needs_constructing_flag )) |
3585 | error ("member %q+#D with constructor not allowed in union", |
3586 | field); |
3587 | if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3587, __FUNCTION__))->type_common.lang_flag_4))) |
3588 | error ("member %q+#D with destructor not allowed in union", field); |
3589 | if (TYPE_HAS_COMPLEX_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3589, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign)) |
3590 | error ("member %q+#D with copy assignment operator not allowed in union", |
3591 | field); |
3592 | if (!warned && errorcount(global_dc)->diagnostic_count[(int) (DK_ERROR)] > oldcount) |
3593 | { |
3594 | inform (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3594, __FUNCTION__))->decl_minimal.locus), "unrestricted unions " |
3595 | "only available with %<-std=c++11%> or %<-std=gnu++11%>"); |
3596 | warned = true; |
3597 | } |
3598 | } |
3599 | else |
3600 | { |
3601 | TYPE_NEEDS_CONSTRUCTING (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3601, __FUNCTION__))->type_common.needs_constructing_flag ) |= TYPE_NEEDS_CONSTRUCTING (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3601, __FUNCTION__))->type_common.needs_constructing_flag ); |
3602 | TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3602, __FUNCTION__))->type_common.lang_flag_4)) |
3603 | |= TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3603, __FUNCTION__))->type_common.lang_flag_4)); |
3604 | TYPE_HAS_COMPLEX_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3604, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign) |
3605 | |= (TYPE_HAS_COMPLEX_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3605, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign) |
3606 | || !TYPE_HAS_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3606, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign)); |
3607 | TYPE_HAS_COMPLEX_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3607, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_ctor) |= (TYPE_HAS_COMPLEX_COPY_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3607, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_ctor) |
3608 | || !TYPE_HAS_COPY_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3608, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor)); |
3609 | TYPE_HAS_COMPLEX_MOVE_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3609, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign) |= TYPE_HAS_COMPLEX_MOVE_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3609, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign); |
3610 | TYPE_HAS_COMPLEX_MOVE_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3610, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_ctor) |= TYPE_HAS_COMPLEX_MOVE_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3610, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_ctor); |
3611 | TYPE_HAS_COMPLEX_DFLT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3611, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt) |= (!TYPE_HAS_DEFAULT_CONSTRUCTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3611, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_default_ctor) |
3612 | || TYPE_HAS_COMPLEX_DFLT (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3612, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt)); |
3613 | } |
3614 | |
3615 | if (TYPE_HAS_COPY_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3615, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor) |
3616 | && !TYPE_HAS_CONST_COPY_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3616, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_ctor)) |
3617 | *cant_have_const_ctor = 1; |
3618 | |
3619 | if (TYPE_HAS_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3619, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign) |
3620 | && !TYPE_HAS_CONST_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3620, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_assign)) |
3621 | *no_const_asn_ref = 1; |
3622 | } |
3623 | |
3624 | check_abi_tags (t, field); |
3625 | |
3626 | if (DECL_INITIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3626, __FUNCTION__))->decl_common.initial) != NULL_TREE(tree) __null) |
3627 | /* `build_class_init_list' does not recognize |
3628 | non-FIELD_DECLs. */ |
3629 | any_default_members = true; |
3630 | |
3631 | return any_default_members; |
3632 | } |
3633 | |
3634 | /* Check the data members (both static and non-static), class-scoped |
3635 | typedefs, etc., appearing in the declaration of T. Issue |
3636 | appropriate diagnostics. Sets ACCESS_DECLS to a list (in |
3637 | declaration order) of access declarations; each TREE_VALUE in this |
3638 | list is a USING_DECL. |
3639 | |
3640 | In addition, set the following flags: |
3641 | |
3642 | EMPTY_P |
3643 | The class is empty, i.e., contains no non-static data members. |
3644 | |
3645 | CANT_HAVE_CONST_CTOR_P |
3646 | This class cannot have an implicitly generated copy constructor |
3647 | taking a const reference. |
3648 | |
3649 | CANT_HAVE_CONST_ASN_REF |
3650 | This class cannot have an implicitly generated assignment |
3651 | operator taking a const reference. |
3652 | |
3653 | All of these flags should be initialized before calling this |
3654 | function. */ |
3655 | |
3656 | static void |
3657 | check_field_decls (tree t, tree *access_decls, |
3658 | int *cant_have_const_ctor_p, |
3659 | int *no_const_asn_ref_p) |
3660 | { |
3661 | int cant_pack = 0; |
3662 | |
3663 | /* Assume there are no access declarations. */ |
3664 | *access_decls = NULL_TREE(tree) __null; |
3665 | /* Effective C has things to say about classes with pointer members. */ |
3666 | tree pointer_member = NULL_TREE(tree) __null; |
3667 | /* Default initialized members affect the whole class. */ |
3668 | tree default_init_member = NULL_TREE(tree) __null; |
3669 | /* Lack of any non-static data member of non-volatile literal |
3670 | type affects a union. */ |
3671 | bool found_nv_literal_p = false; |
3672 | /* Standard layout requires all FIELDS have same access. */ |
3673 | int field_access = -1; |
3674 | |
3675 | for (tree field = TYPE_FIELDS (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3675, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3675, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3675, __FUNCTION__))->common.chain))) |
3676 | { |
3677 | tree type = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3677, __FUNCTION__))->typed.type); |
3678 | |
3679 | switch (TREE_CODE (field)((enum tree_code) (field)->base.code)) |
3680 | { |
3681 | default: |
3682 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3682, __FUNCTION__)); |
3683 | |
3684 | case USING_DECL: |
3685 | /* Save the access declarations for our caller. */ |
3686 | *access_decls = tree_cons (NULL_TREE(tree) __null, field, *access_decls); |
3687 | break; |
3688 | |
3689 | case TYPE_DECL: |
3690 | case TEMPLATE_DECL: |
3691 | break; |
3692 | |
3693 | case FUNCTION_DECL: |
3694 | /* FIXME: We should fold in the checking from check_methods. */ |
3695 | break; |
3696 | |
3697 | case CONST_DECL: |
3698 | DECL_NONLOCAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3698, __FUNCTION__))->decl_common.nonlocal_flag) = 1; |
3699 | break; |
3700 | |
3701 | case VAR_DECL: |
3702 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == UNION_TYPE |
3703 | && cxx_dialect < cxx11) |
3704 | { |
3705 | /* [class.union] |
3706 | |
3707 | (C++98) If a union contains a static data member, |
3708 | ... the program is ill-formed. */ |
3709 | if (cxx_dialect < cxx11) |
3710 | error ("in C++98 %q+D may not be static because it is " |
3711 | "a member of a union", field); |
3712 | } |
3713 | goto data_member; |
3714 | |
3715 | case FIELD_DECL: |
3716 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == UNION_TYPE) |
3717 | { |
3718 | /* [class.union] |
3719 | |
3720 | If a union contains ... or a [non-static data] member |
3721 | of reference type, the program is ill-formed. */ |
3722 | if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE)) |
3723 | error ("non-static data member %q+D in a union may not " |
3724 | "have reference type %qT", field, type); |
3725 | } |
3726 | |
3727 | data_member: |
3728 | /* Common VAR_DECL & FIELD_DECL processing. */ |
3729 | DECL_CONTEXT (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3729, __FUNCTION__))->decl_minimal.context) = t; |
3730 | DECL_NONLOCAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3730, __FUNCTION__))->decl_common.nonlocal_flag) = 1; |
3731 | |
3732 | /* Template instantiation can cause this. Perhaps this |
3733 | should be a specific instantiation check? */ |
3734 | if (TREE_CODE (type)((enum tree_code) (type)->base.code) == FUNCTION_TYPE) |
3735 | { |
3736 | error ("data member %q+D invalidly declared function type", field); |
3737 | type = build_pointer_type (type); |
3738 | TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3738, __FUNCTION__))->typed.type) = type; |
3739 | } |
3740 | else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == METHOD_TYPE) |
3741 | { |
3742 | error ("data member %q+D invalidly declared method type", field); |
3743 | type = build_pointer_type (type); |
3744 | TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3744, __FUNCTION__))->typed.type) = type; |
3745 | } |
3746 | |
3747 | break; |
3748 | } |
3749 | |
3750 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL) |
3751 | continue; |
3752 | |
3753 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
3754 | continue; |
3755 | |
3756 | /* If it is not a union and at least one non-static data member is |
3757 | non-literal, the whole class becomes non-literal. Per Core/1453, |
3758 | volatile non-static data members and base classes are also not allowed. |
3759 | If it is a union, we might set CLASSTYPE_LITERAL_P after we've seen all |
3760 | members. |
3761 | Note: if the type is incomplete we will complain later on. */ |
3762 | if (COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3762, __FUNCTION__))->type_common.size) != (tree) __null )) |
3763 | { |
3764 | if (!literal_type_p (type) || CP_TYPE_VOLATILE_P (type)((cp_type_quals (type) & TYPE_QUAL_VOLATILE) != 0)) |
3765 | CLASSTYPE_LITERAL_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3765, __FUNCTION__))->type_with_lang_specific.lang_specific ))->is_literal) = false; |
3766 | else |
3767 | found_nv_literal_p = true; |
3768 | } |
3769 | |
3770 | int this_field_access = (TREE_PROTECTED (field)((field)->base.protected_flag) ? 1 |
3771 | : TREE_PRIVATE (field)((field)->base.private_flag) ? 2 : 0); |
3772 | if (field_access != this_field_access) |
3773 | { |
3774 | /* A standard-layout class is a class that: |
3775 | |
3776 | ... has the same access control (Clause 11) for all |
3777 | non-static data members, */ |
3778 | if (field_access < 0) |
3779 | field_access = this_field_access; |
3780 | else |
3781 | CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3781, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout) = 1; |
3782 | |
3783 | /* Aggregates must be public. */ |
3784 | if (this_field_access) |
3785 | CLASSTYPE_NON_AGGREGATE (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3785, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_aggregate) = 1; |
3786 | } |
3787 | |
3788 | /* If this is of reference type, check if it needs an init. */ |
3789 | if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE)) |
3790 | { |
3791 | CLASSTYPE_NON_LAYOUT_POD_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3791, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_pod_class) = 1; |
3792 | CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3792, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout) = 1; |
3793 | if (DECL_INITIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3793, __FUNCTION__))->decl_common.initial) == NULL_TREE(tree) __null) |
3794 | SET_CLASSTYPE_REF_FIELDS_NEED_INIT (t, 1)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3794, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init = (1)); |
3795 | if (cxx_dialect < cxx11) |
3796 | { |
3797 | /* ARM $12.6.2: [A member initializer list] (or, for an |
3798 | aggregate, initialization by a brace-enclosed list) is the |
3799 | only way to initialize non-static const and reference |
3800 | members. */ |
3801 | TYPE_HAS_COMPLEX_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3801, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign) = 1; |
3802 | TYPE_HAS_COMPLEX_MOVE_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3802, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign) = 1; |
3803 | } |
3804 | } |
3805 | |
3806 | type = strip_array_types (type); |
3807 | |
3808 | if (TYPE_PACKED (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3808, __FUNCTION__))->base.u.bits.packed_flag)) |
3809 | { |
3810 | if (!layout_pod_type_p (type) && !TYPE_PACKED (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3810, __FUNCTION__))->base.u.bits.packed_flag)) |
3811 | { |
3812 | warning_at (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3812, __FUNCTION__))->decl_minimal.locus), 0, |
3813 | "ignoring packed attribute because of" |
3814 | " unpacked non-POD field %q#D", field); |
3815 | cant_pack = 1; |
3816 | } |
3817 | else if (DECL_C_BIT_FIELD (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3817, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3817, __FUNCTION__))->decl_common.lang_flag_4) == 1) |
3818 | || TYPE_ALIGN (TREE_TYPE (field))(((tree_class_check ((((contains_struct_check ((field), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3818, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3818, __FUNCTION__))->type_common.align) ? ((unsigned)1) << (((tree_class_check ((((contains_struct_check ((field ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3818, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3818, __FUNCTION__))->type_common.align) - 1) : 0) > BITS_PER_UNIT(8)) |
3819 | DECL_PACKED (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3819, __FUNCTION__, (FIELD_DECL)))->base.u.bits.packed_flag ) = 1; |
3820 | } |
3821 | |
3822 | if (DECL_C_BIT_FIELD (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3822, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3822, __FUNCTION__))->decl_common.lang_flag_4) == 1) |
3823 | && integer_zerop (DECL_BIT_FIELD_REPRESENTATIVE (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3823, __FUNCTION__, (FIELD_DECL)))->field_decl.qualifier ))) |
3824 | /* We don't treat zero-width bitfields as making a class |
3825 | non-empty. */ |
3826 | ; |
3827 | else if (field_poverlapping_p (field) |
3828 | && is_empty_class (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3828, __FUNCTION__))->typed.type))) |
3829 | /* Empty data members also don't make a class non-empty. */ |
3830 | CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3830, __FUNCTION__))->type_with_lang_specific.lang_specific ))->contains_empty_class_p) = 1; |
3831 | else |
3832 | { |
3833 | /* The class is non-empty. */ |
3834 | CLASSTYPE_EMPTY_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3834, __FUNCTION__))->type_with_lang_specific.lang_specific ))->empty_p) = 0; |
3835 | /* The class is not even nearly empty. */ |
3836 | CLASSTYPE_NEARLY_EMPTY_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3836, __FUNCTION__))->type_with_lang_specific.lang_specific ))->nearly_empty_p) = 0; |
3837 | /* If one of the data members contains an empty class, so |
3838 | does T. */ |
3839 | 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/class.cc" , 3839, __FUNCTION__))->type_common.lang_flag_5)) |
3840 | && CLASSTYPE_CONTAINS_EMPTY_CLASS_P (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3840, __FUNCTION__))->type_with_lang_specific.lang_specific ))->contains_empty_class_p)) |
3841 | CLASSTYPE_CONTAINS_EMPTY_CLASS_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3841, __FUNCTION__))->type_with_lang_specific.lang_specific ))->contains_empty_class_p) = 1; |
3842 | } |
3843 | |
3844 | /* This is used by -Weffc++ (see below). Warn only for pointers |
3845 | to members which might hold dynamic memory. So do not warn |
3846 | for pointers to functions or pointers to members. */ |
3847 | if (TYPE_PTR_P (type)(((enum tree_code) (type)->base.code) == POINTER_TYPE) |
3848 | && !TYPE_PTRFN_P (type)((((enum tree_code) (type)->base.code) == POINTER_TYPE) && ((enum tree_code) (((contains_struct_check ((type), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3848, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE )) |
3849 | pointer_member = field; |
3850 | |
3851 | 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/class.cc" , 3851, __FUNCTION__))->type_common.lang_flag_5))) |
3852 | { |
3853 | if (CLASSTYPE_REF_FIELDS_NEED_INIT (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3853, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3853, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init : 0)) |
3854 | SET_CLASSTYPE_REF_FIELDS_NEED_INIT (t, 1)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3854, __FUNCTION__))->type_with_lang_specific.lang_specific ))->ref_needs_init = (1)); |
3855 | if (CLASSTYPE_READONLY_FIELDS_NEED_INIT (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3855, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3855, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0)) |
3856 | SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT (t, 1)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3856, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = (1)); |
3857 | } |
3858 | |
3859 | if (DECL_MUTABLE_P (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3859, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3859, __FUNCTION__))->decl_common.lang_flag_0)) || TYPE_HAS_MUTABLE_P (type)(cp_has_mutable_p (type))) |
3860 | CLASSTYPE_HAS_MUTABLE (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3860, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_mutable) = 1; |
3861 | |
3862 | if (DECL_MUTABLE_P (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3862, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3862, __FUNCTION__))->decl_common.lang_flag_0))) |
3863 | { |
3864 | if (TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE)) |
3865 | error ("member %q+D cannot be declared as a %<mutable%> " |
3866 | "reference", field); |
3867 | else if (CP_TYPE_CONST_P (type)((cp_type_quals (type) & TYPE_QUAL_CONST) != 0)) |
3868 | error ("member %q+D cannot be declared both %<const%> " |
3869 | "and %<mutable%>", field); |
3870 | } |
3871 | |
3872 | if (! layout_pod_type_p (type)) |
3873 | /* DR 148 now allows pointers to members (which are POD themselves), |
3874 | to be allowed in POD structs. */ |
3875 | CLASSTYPE_NON_LAYOUT_POD_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3875, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_pod_class) = 1; |
3876 | |
3877 | if (field_poverlapping_p (field)) |
3878 | /* A potentially-overlapping non-static data member makes the class |
3879 | non-layout-POD. */ |
3880 | CLASSTYPE_NON_LAYOUT_POD_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3880, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_pod_class) = 1; |
3881 | |
3882 | if (!std_layout_type_p (type)) |
3883 | CLASSTYPE_NON_STD_LAYOUT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3883, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_std_layout) = 1; |
3884 | |
3885 | if (! zero_init_p (type)) |
3886 | CLASSTYPE_NON_ZERO_INIT_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3886, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_zero_init) = 1; |
3887 | |
3888 | /* We set DECL_C_BIT_FIELD in grokbitfield. |
3889 | If the type and width are valid, we'll also set DECL_BIT_FIELD. */ |
3890 | if (DECL_C_BIT_FIELD (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3890, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3890, __FUNCTION__))->decl_common.lang_flag_4) == 1)) |
3891 | check_bitfield_decl (field); |
3892 | |
3893 | if (check_field_decl (field, t, |
3894 | cant_have_const_ctor_p, no_const_asn_ref_p)) |
3895 | { |
3896 | if (default_init_member |
3897 | && TREE_CODE (t)((enum tree_code) (t)->base.code) == UNION_TYPE) |
3898 | { |
3899 | error ("multiple fields in union %qT initialized", t); |
3900 | inform (DECL_SOURCE_LOCATION (default_init_member)((contains_struct_check ((default_init_member), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3900, __FUNCTION__))->decl_minimal.locus), |
3901 | "initialized member %q+D declared here", |
3902 | default_init_member); |
3903 | } |
3904 | default_init_member = field; |
3905 | } |
3906 | |
3907 | /* Now that we've removed bit-field widths from DECL_INITIAL, |
3908 | anything left in DECL_INITIAL is an NSDMI that makes the class |
3909 | non-aggregate in C++11, and non-layout-POD always. */ |
3910 | if (DECL_INITIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3910, __FUNCTION__))->decl_common.initial)) |
3911 | { |
3912 | if (cxx_dialect < cxx14) |
3913 | CLASSTYPE_NON_AGGREGATE (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3913, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_aggregate) = true; |
3914 | else |
3915 | CLASSTYPE_NON_POD_AGGREGATE (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3915, __FUNCTION__))->type_with_lang_specific.lang_specific ))->non_pod_aggregate) = true; |
3916 | } |
3917 | |
3918 | if (CP_TYPE_CONST_P (type)((cp_type_quals (type) & TYPE_QUAL_CONST) != 0)) |
3919 | { |
3920 | /* If any field is const, the structure type is pseudo-const. */ |
3921 | C_TYPE_FIELDS_READONLY (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3921, __FUNCTION__))->type_with_lang_specific.lang_specific ))->fields_readonly) = 1; |
3922 | if (DECL_INITIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3922, __FUNCTION__))->decl_common.initial) == NULL_TREE(tree) __null) |
3923 | SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT (t, 1)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3923, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = (1)); |
3924 | if (cxx_dialect < cxx11) |
3925 | { |
3926 | /* ARM $12.6.2: [A member initializer list] (or, for an |
3927 | aggregate, initialization by a brace-enclosed list) is the |
3928 | only way to initialize non-static const and reference |
3929 | members. */ |
3930 | TYPE_HAS_COMPLEX_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3930, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign) = 1; |
3931 | TYPE_HAS_COMPLEX_MOVE_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3931, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign) = 1; |
3932 | } |
3933 | } |
3934 | /* A field that is pseudo-const makes the structure likewise. */ |
3935 | else 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/class.cc" , 3935, __FUNCTION__))->type_common.lang_flag_5))) |
3936 | { |
3937 | C_TYPE_FIELDS_READONLY (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3937, __FUNCTION__))->type_with_lang_specific.lang_specific ))->fields_readonly) |= C_TYPE_FIELDS_READONLY (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3937, __FUNCTION__))->type_with_lang_specific.lang_specific ))->fields_readonly); |
3938 | SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT (t,((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = ((((tree_class_check ((t), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3939, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3939, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0) | (((tree_class_check ((type), ( tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0))) |
3939 | CLASSTYPE_READONLY_FIELDS_NEED_INIT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = ((((tree_class_check ((t), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3939, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3939, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0) | (((tree_class_check ((type), ( tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0))) |
3940 | | CLASSTYPE_READONLY_FIELDS_NEED_INIT (type))((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init = ((((tree_class_check ((t), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3939, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3939, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0) | (((tree_class_check ((type), ( tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ) ? (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3940, __FUNCTION__))->type_with_lang_specific.lang_specific ))->const_needs_init : 0))); |
3941 | } |
3942 | |
3943 | /* Core issue 80: A non-static data member is required to have a |
3944 | different name from the class iff the class has a |
3945 | user-declared constructor. */ |
3946 | if (constructor_name_p (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3946, __FUNCTION__))->decl_minimal.name), t) |
3947 | && TYPE_HAS_USER_CONSTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3947, __FUNCTION__))->type_common.lang_flag_1))) |
3948 | permerror (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3948, __FUNCTION__))->decl_minimal.locus), |
3949 | "field %q#D with same name as class", field); |
3950 | } |
3951 | |
3952 | /* Per CWG 2096, a type is a literal type if it is a union, and at least |
3953 | one of its non-static data members is of non-volatile literal type. */ |
3954 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == UNION_TYPE && found_nv_literal_p) |
3955 | CLASSTYPE_LITERAL_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3955, __FUNCTION__))->type_with_lang_specific.lang_specific ))->is_literal) = true; |
3956 | |
3957 | /* Effective C++ rule 11: if a class has dynamic memory held by pointers, |
3958 | it should also define a copy constructor and an assignment operator to |
3959 | implement the correct copy semantic (deep vs shallow, etc.). As it is |
3960 | not feasible to check whether the constructors do allocate dynamic memory |
3961 | and store it within members, we approximate the warning like this: |
3962 | |
3963 | -- Warn only if there are members which are pointers |
3964 | -- Warn only if there is a non-trivial constructor (otherwise, |
3965 | there cannot be memory allocated). |
3966 | -- Warn only if there is a non-trivial destructor. We assume that the |
3967 | user at least implemented the cleanup correctly, and a destructor |
3968 | is needed to free dynamic memory. |
3969 | |
3970 | This seems enough for practical purposes. */ |
3971 | if (warn_ecppglobal_options.x_warn_ecpp |
3972 | && pointer_member |
3973 | && TYPE_HAS_USER_CONSTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3973, __FUNCTION__))->type_common.lang_flag_1)) |
3974 | && TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3974, __FUNCTION__))->type_common.lang_flag_4)) |
3975 | && !(TYPE_HAS_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3975, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor) && TYPE_HAS_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3975, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign))) |
3976 | { |
3977 | if (warning (OPT_Weffc__, "%q#T has pointer data members", t)) |
3978 | { |
3979 | if (! TYPE_HAS_COPY_CTOR (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3979, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_ctor)) |
3980 | { |
3981 | warning (OPT_Weffc__, |
3982 | " but does not declare %<%T(const %T&)%>", t, t); |
3983 | if (!TYPE_HAS_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3983, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign)) |
3984 | warning (OPT_Weffc__, " or %<operator=(const %T&)%>", t); |
3985 | } |
3986 | else if (! TYPE_HAS_COPY_ASSIGN (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3986, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_copy_assign)) |
3987 | warning (OPT_Weffc__, |
3988 | " but does not declare %<operator=(const %T&)%>", t); |
3989 | inform (DECL_SOURCE_LOCATION (pointer_member)((contains_struct_check ((pointer_member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3989, __FUNCTION__))->decl_minimal.locus), |
3990 | "pointer member %q+D declared here", pointer_member); |
3991 | } |
3992 | } |
3993 | |
3994 | /* Non-static data member initializers make the default constructor |
3995 | non-trivial. */ |
3996 | if (default_init_member) |
3997 | { |
3998 | TYPE_NEEDS_CONSTRUCTING (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3998, __FUNCTION__))->type_common.needs_constructing_flag ) = true; |
3999 | TYPE_HAS_COMPLEX_DFLT (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 3999, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt) = true; |
4000 | } |
4001 | |
4002 | /* If any of the fields couldn't be packed, unset TYPE_PACKED. */ |
4003 | if (cant_pack) |
4004 | TYPE_PACKED (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4004, __FUNCTION__))->base.u.bits.packed_flag) = 0; |
4005 | |
4006 | /* Check anonymous struct/anonymous union fields. */ |
4007 | finish_struct_anon (t); |
4008 | |
4009 | /* We've built up the list of access declarations in reverse order. |
4010 | Fix that now. */ |
4011 | *access_decls = nreverse (*access_decls); |
4012 | } |
4013 | |
4014 | /* If TYPE is an empty class type, records its OFFSET in the table of |
4015 | OFFSETS. */ |
4016 | |
4017 | static int |
4018 | record_subobject_offset (tree type, tree offset, splay_tree offsets) |
4019 | { |
4020 | splay_tree_node n; |
4021 | |
4022 | if (!is_empty_class (type)) |
4023 | return 0; |
4024 | |
4025 | /* Record the location of this empty object in OFFSETS. */ |
4026 | n = splay_tree_lookup (offsets, (splay_tree_key) offset); |
4027 | if (!n) |
4028 | n = splay_tree_insert (offsets, |
4029 | (splay_tree_key) offset, |
4030 | (splay_tree_value) NULL_TREE(tree) __null); |
4031 | n->value = ((splay_tree_value) |
4032 | tree_cons (NULL_TREE(tree) __null, |
4033 | type, |
4034 | (tree) n->value)); |
4035 | |
4036 | return 0; |
4037 | } |
4038 | |
4039 | /* Returns nonzero if TYPE is an empty class type and there is |
4040 | already an entry in OFFSETS for the same TYPE as the same OFFSET. */ |
4041 | |
4042 | static int |
4043 | check_subobject_offset (tree type, tree offset, splay_tree offsets) |
4044 | { |
4045 | splay_tree_node n; |
4046 | tree t; |
4047 | |
4048 | if (!is_empty_class (type)) |
4049 | return 0; |
4050 | |
4051 | /* Record the location of this empty object in OFFSETS. */ |
4052 | n = splay_tree_lookup (offsets, (splay_tree_key) offset); |
4053 | if (!n) |
4054 | return 0; |
4055 | |
4056 | for (t = (tree) n->value; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4056, __FUNCTION__))->common.chain)) |
4057 | if (same_type_p (TREE_VALUE (t), type)comptypes ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4057, __FUNCTION__, (TREE_LIST)))->list.value)), (type), 0)) |
4058 | return 1; |
4059 | |
4060 | return 0; |
4061 | } |
4062 | |
4063 | /* Walk through all the subobjects of TYPE (located at OFFSET). Call |
4064 | F for every subobject, passing it the type, offset, and table of |
4065 | OFFSETS. If VBASES_P is one, then virtual non-primary bases should |
4066 | be traversed. |
4067 | |
4068 | If MAX_OFFSET is non-NULL, then subobjects with an offset greater |
4069 | than MAX_OFFSET will not be walked. |
4070 | |
4071 | If F returns a nonzero value, the traversal ceases, and that value |
4072 | is returned. Otherwise, returns zero. */ |
4073 | |
4074 | static int |
4075 | walk_subobject_offsets (tree type, |
4076 | subobject_offset_fn f, |
4077 | tree offset, |
4078 | splay_tree offsets, |
4079 | tree max_offset, |
4080 | int vbases_p) |
4081 | { |
4082 | int r = 0; |
4083 | tree type_binfo = NULL_TREE(tree) __null; |
4084 | |
4085 | /* If this OFFSET is bigger than the MAX_OFFSET, then we should |
4086 | stop. */ |
4087 | if (max_offset && tree_int_cst_lt (max_offset, offset)) |
4088 | return 0; |
4089 | |
4090 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
4091 | return 0; |
4092 | |
4093 | if (!TYPE_P (type)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (type)->base.code))] == tcc_type)) |
4094 | { |
4095 | type_binfo = type; |
4096 | type = BINFO_TYPE (type)((contains_struct_check (((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4096, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4096, __FUNCTION__))->typed.type); |
4097 | } |
4098 | |
4099 | 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/class.cc" , 4099, __FUNCTION__))->type_common.lang_flag_5))) |
4100 | { |
4101 | tree field; |
4102 | tree binfo; |
4103 | int i; |
4104 | |
4105 | /* Avoid recursing into objects that are not interesting. */ |
4106 | if (!CLASSTYPE_CONTAINS_EMPTY_CLASS_P (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4106, __FUNCTION__))->type_with_lang_specific.lang_specific ))->contains_empty_class_p)) |
4107 | return 0; |
4108 | |
4109 | /* Record the location of TYPE. */ |
4110 | r = (*f) (type, offset, offsets); |
4111 | if (r) |
4112 | return r; |
4113 | |
4114 | /* Iterate through the direct base classes of TYPE. */ |
4115 | if (!type_binfo) |
4116 | type_binfo = TYPE_BINFO (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4116, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); |
4117 | for (i = 0; BINFO_BASE_ITERATE (type_binfo, i, binfo)((&(tree_check ((type_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4117, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(binfo))); i++) |
4118 | { |
4119 | tree binfo_offset; |
4120 | |
4121 | if (BINFO_VIRTUAL_P (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4121, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) |
4122 | continue; |
4123 | |
4124 | tree orig_binfo; |
4125 | /* We cannot rely on BINFO_OFFSET being set for the base |
4126 | class yet, but the offsets for direct non-virtual |
4127 | bases can be calculated by going back to the TYPE. */ |
4128 | orig_binfo = BINFO_BASE_BINFO (TYPE_BINFO (type), i)((*(&(tree_check ((((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4128, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4128, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos))[ (i)]); |
4129 | binfo_offset = size_binop (PLUS_EXPR,size_binop_loc (((location_t) 0), PLUS_EXPR, offset, ((tree_check ((orig_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4131, __FUNCTION__, (TREE_BINFO)))->binfo.offset)) |
4130 | offset,size_binop_loc (((location_t) 0), PLUS_EXPR, offset, ((tree_check ((orig_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4131, __FUNCTION__, (TREE_BINFO)))->binfo.offset)) |
4131 | BINFO_OFFSET (orig_binfo))size_binop_loc (((location_t) 0), PLUS_EXPR, offset, ((tree_check ((orig_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4131, __FUNCTION__, (TREE_BINFO)))->binfo.offset)); |
4132 | |
4133 | r = walk_subobject_offsets (binfo, |
4134 | f, |
4135 | binfo_offset, |
4136 | offsets, |
4137 | max_offset, |
4138 | /*vbases_p=*/0); |
4139 | if (r) |
4140 | return r; |
4141 | } |
4142 | |
4143 | if (CLASSTYPE_VBASECLASSES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/class.cc" , 4143, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases)) |
4144 | { |
4145 | unsigned ix; |
4146 | vec<tree, va_gc> *vbases; |
4147 | |
4148 | /* Iterate through the virtual base classes of TYPE. In G++ |
4149 | 3.2, we included virtual bases in the direct base class |
4150 | loop above, which results in incorrect results; the |