File: | build/gcc/cp/typeck.cc |
Warning: | line 4440, column 14 Called C++ object pointer is null |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Build expressions with type checking for C++ compiler. | ||||
2 | Copyright (C) 1987-2023 Free Software Foundation, Inc. | ||||
3 | Hacked 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 | /* This file is part of the C++ front end. | ||||
23 | It contains routines to build C++ expressions given their operands, | ||||
24 | including computing the types of the result, C and C++ specific error | ||||
25 | checks, and some optimization. */ | ||||
26 | |||||
27 | #include "config.h" | ||||
28 | #include "system.h" | ||||
29 | #include "coretypes.h" | ||||
30 | #include "target.h" | ||||
31 | #include "cp-tree.h" | ||||
32 | #include "stor-layout.h" | ||||
33 | #include "varasm.h" | ||||
34 | #include "intl.h" | ||||
35 | #include "convert.h" | ||||
36 | #include "c-family/c-objc.h" | ||||
37 | #include "c-family/c-ubsan.h" | ||||
38 | #include "gcc-rich-location.h" | ||||
39 | #include "stringpool.h" | ||||
40 | #include "attribs.h" | ||||
41 | #include "asan.h" | ||||
42 | #include "gimplify.h" | ||||
43 | |||||
44 | static tree cp_build_addr_expr_strict (tree, tsubst_flags_t); | ||||
45 | static tree cp_build_function_call (tree, tree, tsubst_flags_t); | ||||
46 | static tree pfn_from_ptrmemfunc (tree); | ||||
47 | static tree delta_from_ptrmemfunc (tree); | ||||
48 | static tree convert_for_assignment (tree, tree, impl_conv_rhs, tree, int, | ||||
49 | tsubst_flags_t, int); | ||||
50 | static tree cp_pointer_int_sum (location_t, enum tree_code, tree, tree, | ||||
51 | tsubst_flags_t); | ||||
52 | static tree rationalize_conditional_expr (enum tree_code, tree, | ||||
53 | tsubst_flags_t); | ||||
54 | static bool comp_ptr_ttypes_real (tree, tree, int); | ||||
55 | static bool comp_except_types (tree, tree, bool); | ||||
56 | static bool comp_array_types (const_tree, const_tree, compare_bounds_t, bool); | ||||
57 | static tree pointer_diff (location_t, tree, tree, tree, tsubst_flags_t, tree *); | ||||
58 | static tree get_delta_difference (tree, tree, bool, bool, tsubst_flags_t); | ||||
59 | static void casts_away_constness_r (tree *, tree *, tsubst_flags_t); | ||||
60 | static bool casts_away_constness (tree, tree, tsubst_flags_t); | ||||
61 | static bool maybe_warn_about_returning_address_of_local (tree, location_t = UNKNOWN_LOCATION((location_t) 0)); | ||||
62 | static void error_args_num (location_t, tree, bool); | ||||
63 | static int convert_arguments (tree, vec<tree, va_gc> **, tree, int, | ||||
64 | tsubst_flags_t); | ||||
65 | static bool is_std_move_p (tree); | ||||
66 | static bool is_std_forward_p (tree); | ||||
67 | |||||
68 | /* Do `exp = require_complete_type (exp);' to make sure exp | ||||
69 | does not have an incomplete type. (That includes void types.) | ||||
70 | Returns error_mark_node if the VALUE does not have | ||||
71 | complete type when this function returns. */ | ||||
72 | |||||
73 | tree | ||||
74 | require_complete_type (tree value, | ||||
75 | tsubst_flags_t complain /* = tf_warning_or_error */) | ||||
76 | { | ||||
77 | tree type; | ||||
78 | |||||
79 | if (processing_template_declscope_chain->x_processing_template_decl || value == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
80 | return value; | ||||
81 | |||||
82 | if (TREE_CODE (value)((enum tree_code) (value)->base.code) == OVERLOAD) | ||||
83 | type = unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE]; | ||||
84 | else | ||||
85 | type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 85, __FUNCTION__))->typed.type); | ||||
86 | |||||
87 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
88 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
89 | |||||
90 | /* First, detect a valid value with a complete type. */ | ||||
91 | if (COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 91, __FUNCTION__))->type_common.size) != (tree) __null)) | ||||
92 | return value; | ||||
93 | |||||
94 | if (complete_type_or_maybe_complain (type, value, complain)) | ||||
95 | return value; | ||||
96 | else | ||||
97 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
98 | } | ||||
99 | |||||
100 | /* Try to complete TYPE, if it is incomplete. For example, if TYPE is | ||||
101 | a template instantiation, do the instantiation. Returns TYPE, | ||||
102 | whether or not it could be completed, unless something goes | ||||
103 | horribly wrong, in which case the error_mark_node is returned. */ | ||||
104 | |||||
105 | tree | ||||
106 | complete_type (tree type) | ||||
107 | { | ||||
108 | if (type == NULL_TREE(tree) __null) | ||||
109 | /* Rather than crash, we return something sure to cause an error | ||||
110 | at some point. */ | ||||
111 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
112 | |||||
113 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK] || COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 113, __FUNCTION__))->type_common.size) != (tree) __null)) | ||||
114 | ; | ||||
115 | else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE) | ||||
116 | { | ||||
117 | tree t = complete_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 117, __FUNCTION__))->typed.type)); | ||||
118 | unsigned int needs_constructing, has_nontrivial_dtor; | ||||
119 | if (COMPLETE_TYPE_P (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 119, __FUNCTION__))->type_common.size) != (tree) __null) && !dependent_type_p (type)) | ||||
120 | layout_type (type); | ||||
121 | needs_constructing | ||||
122 | = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (t))((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 122, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 122, __FUNCTION__))->type_common.needs_constructing_flag ); | ||||
123 | has_nontrivial_dtor | ||||
124 | = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (t))(((tree_class_check ((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 124, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 124, __FUNCTION__))->type_common.lang_flag_4)); | ||||
125 | for (t = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 125, __FUNCTION__))->type_common.main_variant); t; t = TYPE_NEXT_VARIANT (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 125, __FUNCTION__))->type_common.next_variant)) | ||||
126 | { | ||||
127 | TYPE_NEEDS_CONSTRUCTING (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 127, __FUNCTION__))->type_common.needs_constructing_flag ) = needs_constructing; | ||||
128 | TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 128, __FUNCTION__))->type_common.lang_flag_4)) = has_nontrivial_dtor; | ||||
129 | } | ||||
130 | } | ||||
131 | 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/typeck.cc" , 131, __FUNCTION__))->type_common.lang_flag_5))) | ||||
132 | { | ||||
133 | if (modules_p ()) | ||||
134 | /* TYPE could be a class member we've not loaded the definition of. */ | ||||
135 | lazy_load_pendings (TYPE_NAME (TYPE_MAIN_VARIANT (type))((tree_class_check ((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 135, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 135, __FUNCTION__))->type_common.name)); | ||||
136 | |||||
137 | if (CLASSTYPE_TEMPLATE_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 137, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) & 1)) | ||||
138 | instantiate_class_template (TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 138, __FUNCTION__))->type_common.main_variant)); | ||||
139 | } | ||||
140 | |||||
141 | return type; | ||||
142 | } | ||||
143 | |||||
144 | /* Like complete_type, but issue an error if the TYPE cannot be completed. | ||||
145 | VALUE is used for informative diagnostics. | ||||
146 | Returns NULL_TREE if the type cannot be made complete. */ | ||||
147 | |||||
148 | tree | ||||
149 | complete_type_or_maybe_complain (tree type, tree value, tsubst_flags_t complain) | ||||
150 | { | ||||
151 | type = complete_type (type); | ||||
152 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
153 | /* We already issued an error. */ | ||||
154 | return NULL_TREE(tree) __null; | ||||
155 | else if (!COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 155, __FUNCTION__))->type_common.size) != (tree) __null)) | ||||
156 | { | ||||
157 | if (complain & tf_error) | ||||
158 | cxx_incomplete_type_diagnostic (value, type, DK_ERROR); | ||||
159 | note_failed_type_completion_for_satisfaction (type); | ||||
160 | return NULL_TREE(tree) __null; | ||||
161 | } | ||||
162 | else | ||||
163 | return type; | ||||
164 | } | ||||
165 | |||||
166 | tree | ||||
167 | complete_type_or_else (tree type, tree value) | ||||
168 | { | ||||
169 | return complete_type_or_maybe_complain (type, value, tf_warning_or_error); | ||||
170 | } | ||||
171 | |||||
172 | |||||
173 | /* Return the common type of two parameter lists. | ||||
174 | We assume that comptypes has already been done and returned 1; | ||||
175 | if that isn't so, this may crash. | ||||
176 | |||||
177 | As an optimization, free the space we allocate if the parameter | ||||
178 | lists are already common. */ | ||||
179 | |||||
180 | static tree | ||||
181 | commonparms (tree p1, tree p2) | ||||
182 | { | ||||
183 | tree oldargs = p1, newargs, n; | ||||
184 | int i, len; | ||||
185 | int any_change = 0; | ||||
186 | |||||
187 | len = list_length (p1); | ||||
188 | newargs = tree_last (p1); | ||||
189 | |||||
190 | if (newargs == void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) | ||||
191 | i = 1; | ||||
192 | else | ||||
193 | { | ||||
194 | i = 0; | ||||
195 | newargs = 0; | ||||
196 | } | ||||
197 | |||||
198 | for (; i < len; i++) | ||||
199 | newargs = tree_cons (NULL_TREE(tree) __null, NULL_TREE(tree) __null, newargs); | ||||
200 | |||||
201 | n = newargs; | ||||
202 | |||||
203 | for (i = 0; p1; | ||||
204 | p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 204, __FUNCTION__))->common.chain), p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 204, __FUNCTION__))->common.chain), n = TREE_CHAIN (n)((contains_struct_check ((n), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 204, __FUNCTION__))->common.chain), i++) | ||||
205 | { | ||||
206 | if (TREE_PURPOSE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 206, __FUNCTION__, (TREE_LIST)))->list.purpose) && !TREE_PURPOSE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 206, __FUNCTION__, (TREE_LIST)))->list.purpose)) | ||||
207 | { | ||||
208 | TREE_PURPOSE (n)((tree_check ((n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 208, __FUNCTION__, (TREE_LIST)))->list.purpose) = TREE_PURPOSE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 208, __FUNCTION__, (TREE_LIST)))->list.purpose); | ||||
209 | any_change = 1; | ||||
210 | } | ||||
211 | else if (! TREE_PURPOSE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 211, __FUNCTION__, (TREE_LIST)))->list.purpose)) | ||||
212 | { | ||||
213 | if (TREE_PURPOSE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 213, __FUNCTION__, (TREE_LIST)))->list.purpose)) | ||||
214 | { | ||||
215 | TREE_PURPOSE (n)((tree_check ((n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 215, __FUNCTION__, (TREE_LIST)))->list.purpose) = TREE_PURPOSE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 215, __FUNCTION__, (TREE_LIST)))->list.purpose); | ||||
216 | any_change = 1; | ||||
217 | } | ||||
218 | } | ||||
219 | else | ||||
220 | { | ||||
221 | if (simple_cst_equal (TREE_PURPOSE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 221, __FUNCTION__, (TREE_LIST)))->list.purpose), TREE_PURPOSE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 221, __FUNCTION__, (TREE_LIST)))->list.purpose)) != 1) | ||||
222 | any_change = 1; | ||||
223 | TREE_PURPOSE (n)((tree_check ((n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 223, __FUNCTION__, (TREE_LIST)))->list.purpose) = TREE_PURPOSE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 223, __FUNCTION__, (TREE_LIST)))->list.purpose); | ||||
224 | } | ||||
225 | if (TREE_VALUE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 225, __FUNCTION__, (TREE_LIST)))->list.value) != TREE_VALUE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 225, __FUNCTION__, (TREE_LIST)))->list.value)) | ||||
226 | { | ||||
227 | any_change = 1; | ||||
228 | TREE_VALUE (n)((tree_check ((n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 228, __FUNCTION__, (TREE_LIST)))->list.value) = merge_types (TREE_VALUE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 228, __FUNCTION__, (TREE_LIST)))->list.value), TREE_VALUE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 228, __FUNCTION__, (TREE_LIST)))->list.value)); | ||||
229 | } | ||||
230 | else | ||||
231 | TREE_VALUE (n)((tree_check ((n), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 231, __FUNCTION__, (TREE_LIST)))->list.value) = TREE_VALUE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 231, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
232 | } | ||||
233 | if (! any_change) | ||||
234 | return oldargs; | ||||
235 | |||||
236 | return newargs; | ||||
237 | } | ||||
238 | |||||
239 | /* Given a type, perhaps copied for a typedef, | ||||
240 | find the "original" version of it. */ | ||||
241 | static tree | ||||
242 | original_type (tree t) | ||||
243 | { | ||||
244 | int quals = cp_type_quals (t); | ||||
245 | while (t != error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
246 | && TYPE_NAME (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 246, __FUNCTION__))->type_common.name) != NULL_TREE(tree) __null) | ||||
247 | { | ||||
248 | tree x = TYPE_NAME (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 248, __FUNCTION__))->type_common.name); | ||||
249 | if (TREE_CODE (x)((enum tree_code) (x)->base.code) != TYPE_DECL) | ||||
250 | break; | ||||
251 | x = DECL_ORIGINAL_TYPE (x)((tree_check ((x), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 251, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result ); | ||||
252 | if (x == NULL_TREE(tree) __null) | ||||
253 | break; | ||||
254 | t = x; | ||||
255 | } | ||||
256 | return cp_build_qualified_type (t, quals); | ||||
257 | } | ||||
258 | |||||
259 | /* Merge the attributes of type OTHER_TYPE into the attributes of type TYPE | ||||
260 | and return a variant of TYPE with the merged attributes. */ | ||||
261 | |||||
262 | static tree | ||||
263 | merge_type_attributes_from (tree type, tree other_type) | ||||
264 | { | ||||
265 | tree attrs = targetm.merge_type_attributes (type, other_type); | ||||
266 | attrs = restrict_type_identity_attributes_to (attrs, TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 266, __FUNCTION__))->type_common.attributes)); | ||||
267 | return cp_build_type_attribute_variant (type, attrs); | ||||
268 | } | ||||
269 | |||||
270 | /* Compare floating point conversion ranks and subranks of T1 and T2 | ||||
271 | types. If T1 and T2 have unordered conversion ranks, return 3. | ||||
272 | If T1 has greater conversion rank than T2, return 2. | ||||
273 | If T2 has greater conversion rank than T1, return -2. | ||||
274 | If T1 has equal conversion rank as T2, return -1, 0 or 1 depending | ||||
275 | on if T1 has smaller, equal or greater conversion subrank than | ||||
276 | T2. */ | ||||
277 | |||||
278 | int | ||||
279 | cp_compare_floating_point_conversion_ranks (tree t1, tree t2) | ||||
280 | { | ||||
281 | tree mv1 = TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 281, __FUNCTION__))->type_common.main_variant); | ||||
282 | tree mv2 = TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 282, __FUNCTION__))->type_common.main_variant); | ||||
283 | int extended1 = 0; | ||||
284 | int extended2 = 0; | ||||
285 | |||||
286 | if (mv1 == mv2) | ||||
287 | return 0; | ||||
288 | |||||
289 | for (int i = 0; i < NUM_FLOATN_NX_TYPES(TI_FLOATN_NX_TYPE_LAST - TI_FLOATN_NX_TYPE_FIRST + 1); ++i) | ||||
290 | { | ||||
291 | if (mv1 == FLOATN_NX_TYPE_NODE (i)global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)]) | ||||
292 | extended1 = i + 1; | ||||
293 | if (mv2 == FLOATN_NX_TYPE_NODE (i)global_trees[TI_FLOATN_NX_TYPE_FIRST + (i)]) | ||||
294 | extended2 = i + 1; | ||||
295 | } | ||||
296 | if (mv1 == bfloat16_type_nodeglobal_trees[TI_BFLOAT16_TYPE]) | ||||
297 | extended1 = true; | ||||
298 | if (mv2 == bfloat16_type_nodeglobal_trees[TI_BFLOAT16_TYPE]) | ||||
299 | extended2 = true; | ||||
300 | if (extended2 && !extended1) | ||||
301 | { | ||||
302 | int ret = cp_compare_floating_point_conversion_ranks (t2, t1); | ||||
303 | return ret == 3 ? 3 : -ret; | ||||
304 | } | ||||
305 | |||||
306 | const struct real_format *fmt1 = REAL_MODE_FORMAT (TYPE_MODE (t1))(real_format_for_mode[(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 306, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)]) == MODE_DECIMAL_FLOAT) ? (((((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 306, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)) - MIN_MODE_DECIMAL_FLOAT) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[((((enum tree_code) ((tree_class_check ((t1), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 306, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)]) == MODE_FLOAT ? ((((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 306, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)) - MIN_MODE_FLOAT) : ((fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 306, __FUNCTION__)), 0)]); | ||||
307 | const struct real_format *fmt2 = REAL_MODE_FORMAT (TYPE_MODE (t2))(real_format_for_mode[(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 307, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)]) == MODE_DECIMAL_FLOAT) ? (((((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 307, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)) - MIN_MODE_DECIMAL_FLOAT) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[((((enum tree_code) ((tree_class_check ((t2), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 307, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)]) == MODE_FLOAT ? ((((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 307, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)) - MIN_MODE_FLOAT) : ((fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 307, __FUNCTION__)), 0)]); | ||||
308 | gcc_assert (fmt1->b == 2 && fmt2->b == 2)((void)(!(fmt1->b == 2 && fmt2->b == 2) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 308, __FUNCTION__), 0 : 0)); | ||||
309 | /* For {ibm,mips}_extended_format formats, the type has variable | ||||
310 | precision up to ~2150 bits when the first double is around maximum | ||||
311 | representable double and second double is subnormal minimum. | ||||
312 | So, e.g. for __ibm128 vs. std::float128_t, they have unordered | ||||
313 | ranks. */ | ||||
314 | int p1 = (MODE_COMPOSITE_P (TYPE_MODE (t1))((((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)]) == MODE_FLOAT || ((enum mode_class ) mode_class[((((enum tree_code) ((tree_class_check ((t1), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)]) == MODE_DECIMAL_FLOAT || ((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)]) == MODE_COMPLEX_FLOAT || ((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode)]) == MODE_VECTOR_FLOAT) && ((real_format_for_mode[(((enum mode_class) mode_class[as_a < scalar_float_mode> ((mode_to_inner (((((enum tree_code) (( tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))]) == MODE_DECIMAL_FLOAT ) ? (((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))) - MIN_MODE_DECIMAL_FLOAT ) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[as_a <scalar_float_mode> ((mode_to_inner ( ((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))]) == MODE_FLOAT ? ((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code ) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))) - MIN_MODE_FLOAT) : (( fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)), 0)]))->pnan < ((real_format_for_mode [(((enum mode_class) mode_class[as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((t1 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))]) == MODE_DECIMAL_FLOAT ) ? (((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))) - MIN_MODE_DECIMAL_FLOAT ) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[as_a <scalar_float_mode> ((mode_to_inner ( ((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))]) == MODE_FLOAT ? ((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code ) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode))))) - MIN_MODE_FLOAT) : (( fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 314, __FUNCTION__)), 0)]))->p) | ||||
315 | ? fmt1->emax - fmt1->emin + fmt1->p - 1 : fmt1->p); | ||||
316 | int p2 = (MODE_COMPOSITE_P (TYPE_MODE (t2))((((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)]) == MODE_FLOAT || ((enum mode_class ) mode_class[((((enum tree_code) ((tree_class_check ((t2), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)]) == MODE_DECIMAL_FLOAT || ((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)]) == MODE_COMPLEX_FLOAT || ((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode)]) == MODE_VECTOR_FLOAT) && ((real_format_for_mode[(((enum mode_class) mode_class[as_a < scalar_float_mode> ((mode_to_inner (((((enum tree_code) (( tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))]) == MODE_DECIMAL_FLOAT ) ? (((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))) - MIN_MODE_DECIMAL_FLOAT ) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[as_a <scalar_float_mode> ((mode_to_inner ( ((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))]) == MODE_FLOAT ? ((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code ) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))) - MIN_MODE_FLOAT) : (( fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)), 0)]))->pnan < ((real_format_for_mode [(((enum mode_class) mode_class[as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((t2 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))]) == MODE_DECIMAL_FLOAT ) ? (((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))) - MIN_MODE_DECIMAL_FLOAT ) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[as_a <scalar_float_mode> ((mode_to_inner ( ((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))]) == MODE_FLOAT ? ((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code ) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode))))) - MIN_MODE_FLOAT) : (( fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 316, __FUNCTION__)), 0)]))->p) | ||||
317 | ? fmt2->emax - fmt2->emin + fmt2->p - 1 : fmt2->p); | ||||
318 | /* The rank of a floating point type T is greater than the rank of | ||||
319 | any floating-point type whose set of values is a proper subset | ||||
320 | of the set of values of T. */ | ||||
321 | if ((p1 > p2 && fmt1->emax >= fmt2->emax) | ||||
322 | || (p1 == p2 && fmt1->emax > fmt2->emax)) | ||||
323 | return 2; | ||||
324 | if ((p1 < p2 && fmt1->emax <= fmt2->emax) | ||||
325 | || (p1 == p2 && fmt1->emax < fmt2->emax)) | ||||
326 | return -2; | ||||
327 | if ((p1 > p2 && fmt1->emax < fmt2->emax) | ||||
328 | || (p1 < p2 && fmt1->emax > fmt2->emax)) | ||||
329 | return 3; | ||||
330 | if (!extended1 && !extended2) | ||||
331 | { | ||||
332 | /* The rank of long double is greater than the rank of double, which | ||||
333 | is greater than the rank of float. */ | ||||
334 | if (t1 == long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE]) | ||||
335 | return 2; | ||||
336 | else if (t2 == long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE]) | ||||
337 | return -2; | ||||
338 | if (t1 == double_type_nodeglobal_trees[TI_DOUBLE_TYPE]) | ||||
339 | return 2; | ||||
340 | else if (t2 == double_type_nodeglobal_trees[TI_DOUBLE_TYPE]) | ||||
341 | return -2; | ||||
342 | if (t1 == float_type_nodeglobal_trees[TI_FLOAT_TYPE]) | ||||
343 | return 2; | ||||
344 | else if (t2 == float_type_nodeglobal_trees[TI_FLOAT_TYPE]) | ||||
345 | return -2; | ||||
346 | return 0; | ||||
347 | } | ||||
348 | /* Two extended floating-point types with the same set of values have equal | ||||
349 | ranks. */ | ||||
350 | if (extended1 && extended2) | ||||
351 | { | ||||
352 | if ((extended1 <= NUM_FLOATN_TYPES(TI_FLOATN_TYPE_LAST - TI_FLOATN_TYPE_FIRST + 1)) == (extended2 <= NUM_FLOATN_TYPES(TI_FLOATN_TYPE_LAST - TI_FLOATN_TYPE_FIRST + 1))) | ||||
353 | { | ||||
354 | /* Prefer higher extendedN value. */ | ||||
355 | if (extended1 > extended2) | ||||
356 | return 1; | ||||
357 | else if (extended1 < extended2) | ||||
358 | return -1; | ||||
359 | else | ||||
360 | return 0; | ||||
361 | } | ||||
362 | else if (extended1 <= NUM_FLOATN_TYPES(TI_FLOATN_TYPE_LAST - TI_FLOATN_TYPE_FIRST + 1)) | ||||
363 | /* Prefer _FloatN type over _FloatMx type. */ | ||||
364 | return 1; | ||||
365 | else if (extended2 <= NUM_FLOATN_TYPES(TI_FLOATN_TYPE_LAST - TI_FLOATN_TYPE_FIRST + 1)) | ||||
366 | return -1; | ||||
367 | else | ||||
368 | return 0; | ||||
369 | } | ||||
370 | |||||
371 | /* gcc_assert (extended1 && !extended2); */ | ||||
372 | tree *p; | ||||
373 | int cnt = 0; | ||||
374 | for (p = &float_type_nodeglobal_trees[TI_FLOAT_TYPE]; p <= &long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE]; ++p) | ||||
375 | { | ||||
376 | const struct real_format *fmt3 = REAL_MODE_FORMAT (TYPE_MODE (*p))(real_format_for_mode[(((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 376, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)]) == MODE_DECIMAL_FLOAT) ? (((((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 376, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)) - MIN_MODE_DECIMAL_FLOAT) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[((((enum tree_code) ((tree_class_check ((*p), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 376, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)]) == MODE_FLOAT ? ((((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 376, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)) - MIN_MODE_FLOAT) : ((fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 376, __FUNCTION__)), 0)]); | ||||
377 | gcc_assert (fmt3->b == 2)((void)(!(fmt3->b == 2) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 377, __FUNCTION__), 0 : 0)); | ||||
378 | int p3 = (MODE_COMPOSITE_P (TYPE_MODE (*p))((((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)]) == MODE_FLOAT || ((enum mode_class ) mode_class[((((enum tree_code) ((tree_class_check ((*p), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)]) == MODE_DECIMAL_FLOAT || ((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)]) == MODE_COMPLEX_FLOAT || ((enum mode_class) mode_class[((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode)]) == MODE_VECTOR_FLOAT) && ((real_format_for_mode[(((enum mode_class) mode_class[as_a < scalar_float_mode> ((mode_to_inner (((((enum tree_code) (( tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))]) == MODE_DECIMAL_FLOAT ) ? (((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))) - MIN_MODE_DECIMAL_FLOAT ) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[as_a <scalar_float_mode> ((mode_to_inner ( ((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))]) == MODE_FLOAT ? ((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code ) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))) - MIN_MODE_FLOAT) : (( fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)), 0)]))->pnan < ((real_format_for_mode [(((enum mode_class) mode_class[as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((*p ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))]) == MODE_DECIMAL_FLOAT ) ? (((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))) - MIN_MODE_DECIMAL_FLOAT ) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class ) mode_class[as_a <scalar_float_mode> ((mode_to_inner ( ((((enum tree_code) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))]) == MODE_FLOAT ? ((as_a <scalar_float_mode> ((mode_to_inner (((((enum tree_code ) ((tree_class_check ((*p), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (*p) : (*p)->type_common.mode))))) - MIN_MODE_FLOAT) : (( fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 378, __FUNCTION__)), 0)]))->p) | ||||
379 | ? fmt3->emax - fmt3->emin + fmt3->p - 1 : fmt3->p); | ||||
380 | if (p1 == p3 && fmt1->emax == fmt3->emax) | ||||
381 | ++cnt; | ||||
382 | } | ||||
383 | /* An extended floating-point type with the same set of values | ||||
384 | as exactly one cv-unqualified standard floating-point type | ||||
385 | has a rank equal to the rank of that standard floating-point | ||||
386 | type. | ||||
387 | |||||
388 | An extended floating-point type with the same set of values | ||||
389 | as more than one cv-unqualified standard floating-point type | ||||
390 | has a rank equal to the rank of double. | ||||
391 | |||||
392 | Thus, if the latter is true and t2 is long double, t2 | ||||
393 | has higher rank. */ | ||||
394 | if (cnt > 1 && mv2 == long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE]) | ||||
395 | return -2; | ||||
396 | /* Otherwise, they have equal rank, but extended types | ||||
397 | (other than std::bfloat16_t) have higher subrank. | ||||
398 | std::bfloat16_t shouldn't have equal rank to any standard | ||||
399 | floating point type. */ | ||||
400 | return 1; | ||||
401 | } | ||||
402 | |||||
403 | /* Return the common type for two arithmetic types T1 and T2 under the | ||||
404 | usual arithmetic conversions. The default conversions have already | ||||
405 | been applied, and enumerated types converted to their compatible | ||||
406 | integer types. */ | ||||
407 | |||||
408 | static tree | ||||
409 | cp_common_type (tree t1, tree t2) | ||||
410 | { | ||||
411 | enum tree_code code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code); | ||||
412 | enum tree_code code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code); | ||||
413 | tree attributes; | ||||
414 | int i; | ||||
415 | |||||
416 | |||||
417 | /* In what follows, we slightly generalize the rules given in [expr] so | ||||
418 | as to deal with `long long' and `complex'. First, merge the | ||||
419 | attributes. */ | ||||
420 | attributes = (*targetm.merge_type_attributes) (t1, t2); | ||||
421 | |||||
422 | if (SCOPED_ENUM_P (t1)(((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE && ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 422, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) || SCOPED_ENUM_P (t2)(((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE && ((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 422, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))) | ||||
423 | { | ||||
424 | if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 424, __FUNCTION__))->type_common.main_variant) == TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 424, __FUNCTION__))->type_common.main_variant)) | ||||
425 | return build_type_attribute_variant (t1, attributes); | ||||
426 | else | ||||
427 | return NULL_TREE(tree) __null; | ||||
428 | } | ||||
429 | |||||
430 | /* FIXME: Attributes. */ | ||||
431 | gcc_assert (ARITHMETIC_TYPE_P (t1)((void)(!(((((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t1)->base.code) == REAL_TYPE || ((enum tree_code) (t1)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t1)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t1)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 433, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 433, __FUNCTION__), 0 : 0)) | ||||
432 | || VECTOR_TYPE_P (t1)((void)(!(((((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t1)->base.code) == REAL_TYPE || ((enum tree_code) (t1)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t1)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t1)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 433, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 433, __FUNCTION__), 0 : 0)) | ||||
433 | || UNSCOPED_ENUM_P (t1))((void)(!(((((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t1)->base.code) == REAL_TYPE || ((enum tree_code) (t1)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t1)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t1)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 433, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 433, __FUNCTION__), 0 : 0)); | ||||
434 | gcc_assert (ARITHMETIC_TYPE_P (t2)((void)(!(((((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t2)->base.code) == REAL_TYPE || ((enum tree_code) (t2)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t2)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t2)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 436, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 436, __FUNCTION__), 0 : 0)) | ||||
435 | || VECTOR_TYPE_P (t2)((void)(!(((((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t2)->base.code) == REAL_TYPE || ((enum tree_code) (t2)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t2)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t2)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 436, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 436, __FUNCTION__), 0 : 0)) | ||||
436 | || UNSCOPED_ENUM_P (t2))((void)(!(((((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t2)->base.code) == REAL_TYPE || ((enum tree_code) (t2)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t2)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t2)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 436, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 436, __FUNCTION__), 0 : 0)); | ||||
437 | |||||
438 | /* If one type is complex, form the common type of the non-complex | ||||
439 | components, then make that complex. Use T1 or T2 if it is the | ||||
440 | required type. */ | ||||
441 | if (code1 == COMPLEX_TYPE || code2 == COMPLEX_TYPE) | ||||
442 | { | ||||
443 | tree subtype1 = code1 == COMPLEX_TYPE ? TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 443, __FUNCTION__))->typed.type) : t1; | ||||
444 | tree subtype2 = code2 == COMPLEX_TYPE ? TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 444, __FUNCTION__))->typed.type) : t2; | ||||
445 | tree subtype | ||||
446 | = type_after_usual_arithmetic_conversions (subtype1, subtype2); | ||||
447 | |||||
448 | if (subtype == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
449 | return subtype; | ||||
450 | if (code1 == COMPLEX_TYPE && TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 450, __FUNCTION__))->typed.type) == subtype) | ||||
451 | return build_type_attribute_variant (t1, attributes); | ||||
452 | else if (code2 == COMPLEX_TYPE && TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 452, __FUNCTION__))->typed.type) == subtype) | ||||
453 | return build_type_attribute_variant (t2, attributes); | ||||
454 | else | ||||
455 | return build_type_attribute_variant (build_complex_type (subtype), | ||||
456 | attributes); | ||||
457 | } | ||||
458 | |||||
459 | if (code1 == VECTOR_TYPE) | ||||
460 | { | ||||
461 | /* When we get here we should have two vectors of the same size. | ||||
462 | Just prefer the unsigned one if present. */ | ||||
463 | if (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 463, __FUNCTION__))->base.u.bits.unsigned_flag)) | ||||
464 | return merge_type_attributes_from (t1, t2); | ||||
465 | else | ||||
466 | return merge_type_attributes_from (t2, t1); | ||||
467 | } | ||||
468 | |||||
469 | /* If only one is real, use it as the result. */ | ||||
470 | if (code1 == REAL_TYPE && code2 != REAL_TYPE) | ||||
471 | return build_type_attribute_variant (t1, attributes); | ||||
472 | if (code2 == REAL_TYPE && code1 != REAL_TYPE) | ||||
473 | return build_type_attribute_variant (t2, attributes); | ||||
474 | |||||
475 | if (code1 == REAL_TYPE | ||||
476 | && (extended_float_type_p (t1) || extended_float_type_p (t2))) | ||||
477 | { | ||||
478 | tree mv1 = TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 478, __FUNCTION__))->type_common.main_variant); | ||||
479 | tree mv2 = TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 479, __FUNCTION__))->type_common.main_variant); | ||||
480 | if (mv1 == mv2) | ||||
481 | return build_type_attribute_variant (t1, attributes); | ||||
482 | |||||
483 | int cmpret = cp_compare_floating_point_conversion_ranks (mv1, mv2); | ||||
484 | if (cmpret == 3) | ||||
485 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
486 | else if (cmpret >= 0) | ||||
487 | return build_type_attribute_variant (t1, attributes); | ||||
488 | else | ||||
489 | return build_type_attribute_variant (t2, attributes); | ||||
490 | } | ||||
491 | |||||
492 | /* Both real or both integers; use the one with greater precision. */ | ||||
493 | if (TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 493, __FUNCTION__))->type_common.precision) > TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 493, __FUNCTION__))->type_common.precision)) | ||||
494 | return build_type_attribute_variant (t1, attributes); | ||||
495 | else if (TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 495, __FUNCTION__))->type_common.precision) > TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 495, __FUNCTION__))->type_common.precision)) | ||||
496 | return build_type_attribute_variant (t2, attributes); | ||||
497 | |||||
498 | /* The types are the same; no need to do anything fancy. */ | ||||
499 | if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 499, __FUNCTION__))->type_common.main_variant) == TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 499, __FUNCTION__))->type_common.main_variant)) | ||||
500 | return build_type_attribute_variant (t1, attributes); | ||||
501 | |||||
502 | if (code1 != REAL_TYPE) | ||||
503 | { | ||||
504 | /* If one is unsigned long long, then convert the other to unsigned | ||||
505 | long long. */ | ||||
506 | if (same_type_p (TYPE_MAIN_VARIANT (t1), long_long_unsigned_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 506, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_unsigned_long_long]), 0) | ||||
507 | || same_type_p (TYPE_MAIN_VARIANT (t2), long_long_unsigned_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 507, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_unsigned_long_long]), 0)) | ||||
508 | return build_type_attribute_variant (long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long], | ||||
509 | attributes); | ||||
510 | /* If one is a long long, and the other is an unsigned long, and | ||||
511 | long long can represent all the values of an unsigned long, then | ||||
512 | convert to a long long. Otherwise, convert to an unsigned long | ||||
513 | long. Otherwise, if either operand is long long, convert the | ||||
514 | other to long long. | ||||
515 | |||||
516 | Since we're here, we know the TYPE_PRECISION is the same; | ||||
517 | therefore converting to long long cannot represent all the values | ||||
518 | of an unsigned long, so we choose unsigned long long in that | ||||
519 | case. */ | ||||
520 | if (same_type_p (TYPE_MAIN_VARIANT (t1), long_long_integer_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 520, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_long_long]), 0) | ||||
521 | || same_type_p (TYPE_MAIN_VARIANT (t2), long_long_integer_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 521, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_long_long]), 0)) | ||||
522 | { | ||||
523 | tree t = ((TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 523, __FUNCTION__))->base.u.bits.unsigned_flag) || TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 523, __FUNCTION__))->base.u.bits.unsigned_flag)) | ||||
524 | ? long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long] | ||||
525 | : long_long_integer_type_nodeinteger_types[itk_long_long]); | ||||
526 | return build_type_attribute_variant (t, attributes); | ||||
527 | } | ||||
528 | |||||
529 | /* Go through the same procedure, but for longs. */ | ||||
530 | if (same_type_p (TYPE_MAIN_VARIANT (t1), long_unsigned_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 530, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_unsigned_long]), 0) | ||||
531 | || same_type_p (TYPE_MAIN_VARIANT (t2), long_unsigned_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 531, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_unsigned_long]), 0)) | ||||
532 | return build_type_attribute_variant (long_unsigned_type_nodeinteger_types[itk_unsigned_long], | ||||
533 | attributes); | ||||
534 | if (same_type_p (TYPE_MAIN_VARIANT (t1), long_integer_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 534, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_long]), 0) | ||||
535 | || same_type_p (TYPE_MAIN_VARIANT (t2), long_integer_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 535, __FUNCTION__))->type_common.main_variant)), (integer_types [itk_long]), 0)) | ||||
536 | { | ||||
537 | tree t = ((TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 537, __FUNCTION__))->base.u.bits.unsigned_flag) || TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 537, __FUNCTION__))->base.u.bits.unsigned_flag)) | ||||
538 | ? long_unsigned_type_nodeinteger_types[itk_unsigned_long] : long_integer_type_nodeinteger_types[itk_long]); | ||||
539 | return build_type_attribute_variant (t, attributes); | ||||
540 | } | ||||
541 | |||||
542 | /* For __intN types, either the type is __int128 (and is lower | ||||
543 | priority than the types checked above, but higher than other | ||||
544 | 128-bit types) or it's known to not be the same size as other | ||||
545 | types (enforced in toplev.cc). Prefer the unsigned type. */ | ||||
546 | for (i = 0; i < NUM_INT_N_ENTS1; i ++) | ||||
547 | { | ||||
548 | if (int_n_enabled_p [i] | ||||
549 | && (same_type_p (TYPE_MAIN_VARIANT (t1), int_n_trees[i].signed_type)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 549, __FUNCTION__))->type_common.main_variant)), (int_n_trees [i].signed_type), 0) | ||||
550 | || same_type_p (TYPE_MAIN_VARIANT (t2), int_n_trees[i].signed_type)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 550, __FUNCTION__))->type_common.main_variant)), (int_n_trees [i].signed_type), 0) | ||||
551 | || same_type_p (TYPE_MAIN_VARIANT (t1), int_n_trees[i].unsigned_type)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 551, __FUNCTION__))->type_common.main_variant)), (int_n_trees [i].unsigned_type), 0) | ||||
552 | || same_type_p (TYPE_MAIN_VARIANT (t2), int_n_trees[i].unsigned_type)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 552, __FUNCTION__))->type_common.main_variant)), (int_n_trees [i].unsigned_type), 0))) | ||||
553 | { | ||||
554 | tree t = ((TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 554, __FUNCTION__))->base.u.bits.unsigned_flag) || TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 554, __FUNCTION__))->base.u.bits.unsigned_flag)) | ||||
555 | ? int_n_trees[i].unsigned_type | ||||
556 | : int_n_trees[i].signed_type); | ||||
557 | return build_type_attribute_variant (t, attributes); | ||||
558 | } | ||||
559 | } | ||||
560 | |||||
561 | /* Otherwise prefer the unsigned one. */ | ||||
562 | if (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 562, __FUNCTION__))->base.u.bits.unsigned_flag)) | ||||
563 | return build_type_attribute_variant (t1, attributes); | ||||
564 | else | ||||
565 | return build_type_attribute_variant (t2, attributes); | ||||
566 | } | ||||
567 | else | ||||
568 | { | ||||
569 | if (same_type_p (TYPE_MAIN_VARIANT (t1), long_double_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 569, __FUNCTION__))->type_common.main_variant)), (global_trees [TI_LONG_DOUBLE_TYPE]), 0) | ||||
570 | || same_type_p (TYPE_MAIN_VARIANT (t2), long_double_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 570, __FUNCTION__))->type_common.main_variant)), (global_trees [TI_LONG_DOUBLE_TYPE]), 0)) | ||||
571 | return build_type_attribute_variant (long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE], | ||||
572 | attributes); | ||||
573 | if (same_type_p (TYPE_MAIN_VARIANT (t1), double_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 573, __FUNCTION__))->type_common.main_variant)), (global_trees [TI_DOUBLE_TYPE]), 0) | ||||
574 | || same_type_p (TYPE_MAIN_VARIANT (t2), double_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 574, __FUNCTION__))->type_common.main_variant)), (global_trees [TI_DOUBLE_TYPE]), 0)) | ||||
575 | return build_type_attribute_variant (double_type_nodeglobal_trees[TI_DOUBLE_TYPE], | ||||
576 | attributes); | ||||
577 | if (same_type_p (TYPE_MAIN_VARIANT (t1), float_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 577, __FUNCTION__))->type_common.main_variant)), (global_trees [TI_FLOAT_TYPE]), 0) | ||||
578 | || same_type_p (TYPE_MAIN_VARIANT (t2), float_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 578, __FUNCTION__))->type_common.main_variant)), (global_trees [TI_FLOAT_TYPE]), 0)) | ||||
579 | return build_type_attribute_variant (float_type_nodeglobal_trees[TI_FLOAT_TYPE], | ||||
580 | attributes); | ||||
581 | |||||
582 | /* Two floating-point types whose TYPE_MAIN_VARIANTs are none of | ||||
583 | the standard C++ floating-point types. Logic earlier in this | ||||
584 | function has already eliminated the possibility that | ||||
585 | TYPE_PRECISION (t2) != TYPE_PRECISION (t1), so there's no | ||||
586 | compelling reason to choose one or the other. */ | ||||
587 | return build_type_attribute_variant (t1, attributes); | ||||
588 | } | ||||
589 | } | ||||
590 | |||||
591 | /* T1 and T2 are arithmetic or enumeration types. Return the type | ||||
592 | that will result from the "usual arithmetic conversions" on T1 and | ||||
593 | T2 as described in [expr]. */ | ||||
594 | |||||
595 | tree | ||||
596 | type_after_usual_arithmetic_conversions (tree t1, tree t2) | ||||
597 | { | ||||
598 | gcc_assert (ARITHMETIC_TYPE_P (t1)((void)(!(((((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t1)->base.code) == REAL_TYPE || ((enum tree_code) (t1)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t1)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t1)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 600, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 600, __FUNCTION__), 0 : 0)) | ||||
599 | || VECTOR_TYPE_P (t1)((void)(!(((((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t1)->base.code) == REAL_TYPE || ((enum tree_code) (t1)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t1)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t1)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 600, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 600, __FUNCTION__), 0 : 0)) | ||||
600 | || UNSCOPED_ENUM_P (t1))((void)(!(((((enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t1)->base.code) == REAL_TYPE || ((enum tree_code) (t1)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t1)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t1)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 600, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 600, __FUNCTION__), 0 : 0)); | ||||
601 | gcc_assert (ARITHMETIC_TYPE_P (t2)((void)(!(((((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t2)->base.code) == REAL_TYPE || ((enum tree_code) (t2)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t2)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t2)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 603, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 603, __FUNCTION__), 0 : 0)) | ||||
602 | || VECTOR_TYPE_P (t2)((void)(!(((((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t2)->base.code) == REAL_TYPE || ((enum tree_code) (t2)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t2)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t2)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 603, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 603, __FUNCTION__), 0 : 0)) | ||||
603 | || UNSCOPED_ENUM_P (t2))((void)(!(((((enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE) || ((enum tree_code) (t2)->base.code) == REAL_TYPE || ((enum tree_code) (t2)->base.code) == COMPLEX_TYPE) || (((enum tree_code ) (t2)->base.code) == VECTOR_TYPE) || (((enum tree_code) ( t2)->base.code) == ENUMERAL_TYPE && !((tree_check ( (t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 603, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)) ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 603, __FUNCTION__), 0 : 0)); | ||||
604 | |||||
605 | /* Perform the integral promotions. We do not promote real types here. */ | ||||
606 | if (INTEGRAL_OR_ENUMERATION_TYPE_P (t1)(((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE || (( (enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE)) | ||||
607 | && INTEGRAL_OR_ENUMERATION_TYPE_P (t2)(((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE || (( (enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE))) | ||||
608 | { | ||||
609 | t1 = type_promotes_to (t1); | ||||
610 | t2 = type_promotes_to (t2); | ||||
611 | } | ||||
612 | |||||
613 | return cp_common_type (t1, t2); | ||||
614 | } | ||||
615 | |||||
616 | static void | ||||
617 | composite_pointer_error (const op_location_t &location, | ||||
618 | diagnostic_t kind, tree t1, tree t2, | ||||
619 | composite_pointer_operation operation) | ||||
620 | { | ||||
621 | switch (operation) | ||||
622 | { | ||||
623 | case CPO_COMPARISON: | ||||
624 | emit_diagnostic (kind, location, 0, | ||||
625 | "comparison between " | ||||
626 | "distinct pointer types %qT and %qT lacks a cast", | ||||
627 | t1, t2); | ||||
628 | break; | ||||
629 | case CPO_CONVERSION: | ||||
630 | emit_diagnostic (kind, location, 0, | ||||
631 | "conversion between " | ||||
632 | "distinct pointer types %qT and %qT lacks a cast", | ||||
633 | t1, t2); | ||||
634 | break; | ||||
635 | case CPO_CONDITIONAL_EXPR: | ||||
636 | emit_diagnostic (kind, location, 0, | ||||
637 | "conditional expression between " | ||||
638 | "distinct pointer types %qT and %qT lacks a cast", | ||||
639 | t1, t2); | ||||
640 | break; | ||||
641 | default: | ||||
642 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 642, __FUNCTION__)); | ||||
643 | } | ||||
644 | } | ||||
645 | |||||
646 | /* Subroutine of composite_pointer_type to implement the recursive | ||||
647 | case. See that function for documentation of the parameters. And ADD_CONST | ||||
648 | is used to track adding "const" where needed. */ | ||||
649 | |||||
650 | static tree | ||||
651 | composite_pointer_type_r (const op_location_t &location, | ||||
652 | tree t1, tree t2, bool *add_const, | ||||
653 | composite_pointer_operation operation, | ||||
654 | tsubst_flags_t complain) | ||||
655 | { | ||||
656 | tree pointee1; | ||||
657 | tree pointee2; | ||||
658 | tree result_type; | ||||
659 | tree attributes; | ||||
660 | |||||
661 | /* Determine the types pointed to by T1 and T2. */ | ||||
662 | if (TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE)) | ||||
663 | { | ||||
664 | pointee1 = TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 664, __FUNCTION__))->typed.type); | ||||
665 | pointee2 = TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 665, __FUNCTION__))->typed.type); | ||||
666 | } | ||||
667 | else | ||||
668 | { | ||||
669 | pointee1 = TYPE_PTRMEM_POINTED_TO_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 669, __FUNCTION__))->typed.type) : ((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 669, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 669, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 669, __FUNCTION__))->typed.type)); | ||||
670 | pointee2 = TYPE_PTRMEM_POINTED_TO_TYPE (t2)((((enum tree_code) (t2)->base.code) == OFFSET_TYPE) ? ((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 670, __FUNCTION__))->typed.type) : ((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 670, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 670, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 670, __FUNCTION__))->typed.type)); | ||||
671 | } | ||||
672 | |||||
673 | /* [expr.type] | ||||
674 | |||||
675 | If T1 and T2 are similar types, the result is the cv-combined type of | ||||
676 | T1 and T2. */ | ||||
677 | if (same_type_ignoring_top_level_qualifiers_p (pointee1, pointee2)) | ||||
678 | result_type = pointee1; | ||||
679 | else if ((TYPE_PTR_P (pointee1)(((enum tree_code) (pointee1)->base.code) == POINTER_TYPE) && TYPE_PTR_P (pointee2)(((enum tree_code) (pointee2)->base.code) == POINTER_TYPE)) | ||||
680 | || (TYPE_PTRMEM_P (pointee1)((((enum tree_code) (pointee1)->base.code) == OFFSET_TYPE) || (((enum tree_code) (pointee1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((pointee1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 680, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 680, __FUNCTION__))->type_common.lang_flag_2)))) && TYPE_PTRMEM_P (pointee2)((((enum tree_code) (pointee2)->base.code) == OFFSET_TYPE) || (((enum tree_code) (pointee2)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((pointee2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 680, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 680, __FUNCTION__))->type_common.lang_flag_2)))))) | ||||
681 | { | ||||
682 | result_type = composite_pointer_type_r (location, pointee1, pointee2, | ||||
683 | add_const, operation, complain); | ||||
684 | if (result_type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
685 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
686 | } | ||||
687 | else | ||||
688 | { | ||||
689 | if (complain & tf_error) | ||||
690 | composite_pointer_error (location, DK_PERMERROR, | ||||
691 | t1, t2, operation); | ||||
692 | else | ||||
693 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
694 | result_type = void_type_nodeglobal_trees[TI_VOID_TYPE]; | ||||
695 | } | ||||
696 | const int q1 = cp_type_quals (pointee1); | ||||
697 | const int q2 = cp_type_quals (pointee2); | ||||
698 | const int quals = q1 | q2; | ||||
699 | result_type = cp_build_qualified_type (result_type, | ||||
700 | (quals | (*add_const | ||||
701 | ? TYPE_QUAL_CONST | ||||
702 | : TYPE_UNQUALIFIED))); | ||||
703 | /* The cv-combined type can add "const" as per [conv.qual]/3.3 (except for | ||||
704 | the TLQ). The reason is that both T1 and T2 can then be converted to the | ||||
705 | cv-combined type of T1 and T2. */ | ||||
706 | if (quals != q1 || quals != q2) | ||||
707 | *add_const = true; | ||||
708 | /* If the original types were pointers to members, so is the | ||||
709 | result. */ | ||||
710 | if (TYPE_PTRMEM_P (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) || (( (enum tree_code) (t1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 710, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 710, __FUNCTION__))->type_common.lang_flag_2))))) | ||||
711 | { | ||||
712 | if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), 0) | ||||
713 | TYPE_PTRMEM_CLASS_TYPE (t2))comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 712, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 713, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), 0)) | ||||
714 | { | ||||
715 | if (complain & tf_error) | ||||
716 | composite_pointer_error (location, DK_PERMERROR, | ||||
717 | t1, t2, operation); | ||||
718 | else | ||||
719 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
720 | } | ||||
721 | result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 721, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 721, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 721, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 721, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 721, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval)), | ||||
722 | result_type); | ||||
723 | } | ||||
724 | else | ||||
725 | result_type = build_pointer_type (result_type); | ||||
726 | |||||
727 | /* Merge the attributes. */ | ||||
728 | attributes = (*targetm.merge_type_attributes) (t1, t2); | ||||
729 | return build_type_attribute_variant (result_type, attributes); | ||||
730 | } | ||||
731 | |||||
732 | /* Return the composite pointer type (see [expr.type]) for T1 and T2. | ||||
733 | ARG1 and ARG2 are the values with those types. The OPERATION is to | ||||
734 | describe the operation between the pointer types, | ||||
735 | in case an error occurs. | ||||
736 | |||||
737 | This routine also implements the computation of a common type for | ||||
738 | pointers-to-members as per [expr.eq]. */ | ||||
739 | |||||
740 | tree | ||||
741 | composite_pointer_type (const op_location_t &location, | ||||
742 | tree t1, tree t2, tree arg1, tree arg2, | ||||
743 | composite_pointer_operation operation, | ||||
744 | tsubst_flags_t complain) | ||||
745 | { | ||||
746 | tree class1; | ||||
747 | tree class2; | ||||
748 | |||||
749 | /* [expr.type] | ||||
750 | |||||
751 | If one operand is a null pointer constant, the composite pointer | ||||
752 | type is the type of the other operand. */ | ||||
753 | if (null_ptr_cst_p (arg1)) | ||||
754 | return t2; | ||||
755 | if (null_ptr_cst_p (arg2)) | ||||
756 | return t1; | ||||
757 | |||||
758 | /* We have: | ||||
759 | |||||
760 | [expr.type] | ||||
761 | |||||
762 | If one of the operands has type "pointer to cv1 void", then | ||||
763 | the other has type "pointer to cv2 T", and the composite pointer | ||||
764 | type is "pointer to cv12 void", where cv12 is the union of cv1 | ||||
765 | and cv2. | ||||
766 | |||||
767 | If either type is a pointer to void, make sure it is T1. */ | ||||
768 | if (TYPE_PTR_P (t2)(((enum tree_code) (t2)->base.code) == POINTER_TYPE) && VOID_TYPE_P (TREE_TYPE (t2))(((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 768, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE )) | ||||
769 | std::swap (t1, t2); | ||||
770 | |||||
771 | /* Now, if T1 is a pointer to void, merge the qualifiers. */ | ||||
772 | if (TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE) && VOID_TYPE_P (TREE_TYPE (t1))(((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 772, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE )) | ||||
773 | { | ||||
774 | tree attributes; | ||||
775 | tree result_type; | ||||
776 | |||||
777 | if (TYPE_PTRFN_P (t2)((((enum tree_code) (t2)->base.code) == POINTER_TYPE) && ((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 777, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE )) | ||||
778 | { | ||||
779 | if (complain & tf_error) | ||||
780 | { | ||||
781 | switch (operation) | ||||
782 | { | ||||
783 | case CPO_COMPARISON: | ||||
784 | pedwarn (location, OPT_Wpedantic, | ||||
785 | "ISO C++ forbids comparison between pointer " | ||||
786 | "of type %<void *%> and pointer-to-function"); | ||||
787 | break; | ||||
788 | case CPO_CONVERSION: | ||||
789 | pedwarn (location, OPT_Wpedantic, | ||||
790 | "ISO C++ forbids conversion between pointer " | ||||
791 | "of type %<void *%> and pointer-to-function"); | ||||
792 | break; | ||||
793 | case CPO_CONDITIONAL_EXPR: | ||||
794 | pedwarn (location, OPT_Wpedantic, | ||||
795 | "ISO C++ forbids conditional expression between " | ||||
796 | "pointer of type %<void *%> and " | ||||
797 | "pointer-to-function"); | ||||
798 | break; | ||||
799 | default: | ||||
800 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 800, __FUNCTION__)); | ||||
801 | } | ||||
802 | } | ||||
803 | else | ||||
804 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
805 | } | ||||
806 | result_type | ||||
807 | = cp_build_qualified_type (void_type_nodeglobal_trees[TI_VOID_TYPE], | ||||
808 | (cp_type_quals (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 808, __FUNCTION__))->typed.type)) | ||||
809 | | cp_type_quals (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 809, __FUNCTION__))->typed.type)))); | ||||
810 | result_type = build_pointer_type (result_type); | ||||
811 | /* Merge the attributes. */ | ||||
812 | attributes = (*targetm.merge_type_attributes) (t1, t2); | ||||
813 | return build_type_attribute_variant (result_type, attributes); | ||||
814 | } | ||||
815 | |||||
816 | if (c_dialect_objc ()((c_language & clk_objc) != 0) && TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE) | ||||
817 | && TYPE_PTR_P (t2)(((enum tree_code) (t2)->base.code) == POINTER_TYPE)) | ||||
818 | { | ||||
819 | if (objc_have_common_type (t1, t2, -3, NULL_TREE(tree) __null)) | ||||
820 | return objc_common_type (t1, t2); | ||||
821 | } | ||||
822 | |||||
823 | /* if T1 or T2 is "pointer to noexcept function" and the other type is | ||||
824 | "pointer to function", where the function types are otherwise the same, | ||||
825 | "pointer to function" */ | ||||
826 | if (fnptr_conv_p (t1, t2)) | ||||
827 | return t1; | ||||
828 | if (fnptr_conv_p (t2, t1)) | ||||
829 | return t2; | ||||
830 | |||||
831 | /* [expr.eq] permits the application of a pointer conversion to | ||||
832 | bring the pointers to a common type. */ | ||||
833 | if (TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE) && TYPE_PTR_P (t2)(((enum tree_code) (t2)->base.code) == POINTER_TYPE) | ||||
834 | && CLASS_TYPE_P (TREE_TYPE (t1))(((((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 834, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 834, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((t1 ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 834, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 834, __FUNCTION__))->type_common.lang_flag_5)) | ||||
835 | && CLASS_TYPE_P (TREE_TYPE (t2))(((((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 835, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 835, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((t2 ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 835, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 835, __FUNCTION__))->type_common.lang_flag_5)) | ||||
836 | && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 836, __FUNCTION__))->typed.type), | ||||
837 | TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 837, __FUNCTION__))->typed.type))) | ||||
838 | { | ||||
839 | class1 = TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 839, __FUNCTION__))->typed.type); | ||||
840 | class2 = TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 840, __FUNCTION__))->typed.type); | ||||
841 | |||||
842 | if (DERIVED_FROM_P (class1, class2)(lookup_base ((class2), (class1), ba_any, __null, tf_none) != (tree) __null)) | ||||
843 | t2 = (build_pointer_type | ||||
844 | (cp_build_qualified_type (class1, cp_type_quals (class2)))); | ||||
845 | else if (DERIVED_FROM_P (class2, class1)(lookup_base ((class1), (class2), ba_any, __null, tf_none) != (tree) __null)) | ||||
846 | t1 = (build_pointer_type | ||||
847 | (cp_build_qualified_type (class2, cp_type_quals (class1)))); | ||||
848 | else | ||||
849 | { | ||||
850 | if (complain & tf_error) | ||||
851 | composite_pointer_error (location, DK_ERROR, t1, t2, operation); | ||||
852 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
853 | } | ||||
854 | } | ||||
855 | /* [expr.eq] permits the application of a pointer-to-member | ||||
856 | conversion to change the class type of one of the types. */ | ||||
857 | else if (TYPE_PTRMEM_P (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) || (( (enum tree_code) (t1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 857, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 857, __FUNCTION__))->type_common.lang_flag_2)))) | ||||
858 | && !same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), 0) | ||||
859 | TYPE_PTRMEM_CLASS_TYPE (t2))comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 858, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE ) ? ((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 859, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval))), 0)) | ||||
860 | { | ||||
861 | class1 = TYPE_PTRMEM_CLASS_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 861, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 861, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 861, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 861, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 861, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval)); | ||||
862 | class2 = TYPE_PTRMEM_CLASS_TYPE (t2)((((enum tree_code) (t2)->base.code) == OFFSET_TYPE) ? ((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 862, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 862, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 862, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 862, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 862, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval)); | ||||
863 | |||||
864 | if (DERIVED_FROM_P (class1, class2)(lookup_base ((class2), (class1), ba_any, __null, tf_none) != (tree) __null)) | ||||
865 | t1 = build_ptrmem_type (class2, TYPE_PTRMEM_POINTED_TO_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 865, __FUNCTION__))->typed.type) : ((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 865, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 865, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 865, __FUNCTION__))->typed.type))); | ||||
866 | else if (DERIVED_FROM_P (class2, class1)(lookup_base ((class1), (class2), ba_any, __null, tf_none) != (tree) __null)) | ||||
867 | t2 = build_ptrmem_type (class1, TYPE_PTRMEM_POINTED_TO_TYPE (t2)((((enum tree_code) (t2)->base.code) == OFFSET_TYPE) ? ((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 867, __FUNCTION__))->typed.type) : ((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 867, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 867, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 867, __FUNCTION__))->typed.type))); | ||||
868 | else | ||||
869 | { | ||||
870 | if (complain & tf_error) | ||||
871 | switch (operation) | ||||
872 | { | ||||
873 | case CPO_COMPARISON: | ||||
874 | error_at (location, "comparison between distinct " | ||||
875 | "pointer-to-member types %qT and %qT lacks a cast", | ||||
876 | t1, t2); | ||||
877 | break; | ||||
878 | case CPO_CONVERSION: | ||||
879 | error_at (location, "conversion between distinct " | ||||
880 | "pointer-to-member types %qT and %qT lacks a cast", | ||||
881 | t1, t2); | ||||
882 | break; | ||||
883 | case CPO_CONDITIONAL_EXPR: | ||||
884 | error_at (location, "conditional expression between distinct " | ||||
885 | "pointer-to-member types %qT and %qT lacks a cast", | ||||
886 | t1, t2); | ||||
887 | break; | ||||
888 | default: | ||||
889 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 889, __FUNCTION__)); | ||||
890 | } | ||||
891 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
892 | } | ||||
893 | } | ||||
894 | |||||
895 | bool add_const = false; | ||||
896 | return composite_pointer_type_r (location, t1, t2, &add_const, operation, | ||||
897 | complain); | ||||
898 | } | ||||
899 | |||||
900 | /* Return the merged type of two types. | ||||
901 | We assume that comptypes has already been done and returned 1; | ||||
902 | if that isn't so, this may crash. | ||||
903 | |||||
904 | This just combines attributes and default arguments; any other | ||||
905 | differences would cause the two types to compare unalike. */ | ||||
906 | |||||
907 | tree | ||||
908 | merge_types (tree t1, tree t2) | ||||
909 | { | ||||
910 | enum tree_code code1; | ||||
911 | enum tree_code code2; | ||||
912 | tree attributes; | ||||
913 | |||||
914 | /* Save time if the two types are the same. */ | ||||
915 | if (t1 == t2) | ||||
916 | return t1; | ||||
917 | if (original_type (t1) == original_type (t2)) | ||||
918 | return t1; | ||||
919 | |||||
920 | /* If one type is nonsense, use the other. */ | ||||
921 | if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
922 | return t2; | ||||
923 | if (t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
924 | return t1; | ||||
925 | |||||
926 | /* Handle merging an auto redeclaration with a previous deduced | ||||
927 | return type. */ | ||||
928 | if (is_auto (t1)) | ||||
929 | return t2; | ||||
930 | |||||
931 | /* Merge the attributes. */ | ||||
932 | attributes = (*targetm.merge_type_attributes) (t1, t2); | ||||
933 | |||||
934 | if (TYPE_PTRMEMFUNC_P (t1)(((enum tree_code) (t1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 934, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 934, __FUNCTION__))->type_common.lang_flag_2)))) | ||||
935 | t1 = TYPE_PTRMEMFUNC_FN_TYPE (t1)(cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 935, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 935, __FUNCTION__))->typed.type), cp_type_quals (t1))); | ||||
936 | if (TYPE_PTRMEMFUNC_P (t2)(((enum tree_code) (t2)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 936, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 936, __FUNCTION__))->type_common.lang_flag_2)))) | ||||
937 | t2 = TYPE_PTRMEMFUNC_FN_TYPE (t2)(cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 937, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 937, __FUNCTION__))->typed.type), cp_type_quals (t2))); | ||||
938 | |||||
939 | code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code); | ||||
940 | code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code); | ||||
941 | if (code1 != code2) | ||||
942 | { | ||||
943 | gcc_assert (code1 == TYPENAME_TYPE || code2 == TYPENAME_TYPE)((void)(!(code1 == TYPENAME_TYPE || code2 == TYPENAME_TYPE) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 943, __FUNCTION__), 0 : 0)); | ||||
944 | if (code1 == TYPENAME_TYPE) | ||||
945 | { | ||||
946 | t1 = resolve_typename_type (t1, /*only_current_p=*/true); | ||||
947 | code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code); | ||||
948 | } | ||||
949 | else | ||||
950 | { | ||||
951 | t2 = resolve_typename_type (t2, /*only_current_p=*/true); | ||||
952 | code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code); | ||||
953 | } | ||||
954 | } | ||||
955 | |||||
956 | switch (code1) | ||||
957 | { | ||||
958 | case POINTER_TYPE: | ||||
959 | case REFERENCE_TYPE: | ||||
960 | /* For two pointers, do this recursively on the target type. */ | ||||
961 | { | ||||
962 | tree target = merge_types (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 962, __FUNCTION__))->typed.type), TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 962, __FUNCTION__))->typed.type)); | ||||
963 | int quals = cp_type_quals (t1); | ||||
964 | |||||
965 | if (code1 == POINTER_TYPE) | ||||
966 | { | ||||
967 | t1 = build_pointer_type (target); | ||||
968 | if (TREE_CODE (target)((enum tree_code) (target)->base.code) == METHOD_TYPE) | ||||
969 | t1 = build_ptrmemfunc_type (t1); | ||||
970 | } | ||||
971 | else | ||||
972 | t1 = cp_build_reference_type (target, TYPE_REF_IS_RVALUE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 972, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag )); | ||||
973 | t1 = build_type_attribute_variant (t1, attributes); | ||||
974 | t1 = cp_build_qualified_type (t1, quals); | ||||
975 | |||||
976 | return t1; | ||||
977 | } | ||||
978 | |||||
979 | case OFFSET_TYPE: | ||||
980 | { | ||||
981 | int quals; | ||||
982 | tree pointee; | ||||
983 | quals = cp_type_quals (t1); | ||||
984 | pointee = merge_types (TYPE_PTRMEM_POINTED_TO_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 984, __FUNCTION__))->typed.type) : ((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 984, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 984, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 984, __FUNCTION__))->typed.type)), | ||||
985 | TYPE_PTRMEM_POINTED_TO_TYPE (t2)((((enum tree_code) (t2)->base.code) == OFFSET_TYPE) ? ((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 985, __FUNCTION__))->typed.type) : ((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 985, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 985, __FUNCTION__))->typed.type), cp_type_quals (t2)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 985, __FUNCTION__))->typed.type))); | ||||
986 | t1 = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 986, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 986, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 986, __FUNCTION__))->typed.type), cp_type_quals (t1)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 986, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 986, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval)), | ||||
987 | pointee); | ||||
988 | t1 = cp_build_qualified_type (t1, quals); | ||||
989 | break; | ||||
990 | } | ||||
991 | |||||
992 | case ARRAY_TYPE: | ||||
993 | { | ||||
994 | tree elt = merge_types (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 994, __FUNCTION__))->typed.type), TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 994, __FUNCTION__))->typed.type)); | ||||
995 | /* Save space: see if the result is identical to one of the args. */ | ||||
996 | if (elt == TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 996, __FUNCTION__))->typed.type) && TYPE_DOMAIN (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 996, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )) | ||||
997 | return build_type_attribute_variant (t1, attributes); | ||||
998 | if (elt == TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 998, __FUNCTION__))->typed.type) && TYPE_DOMAIN (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 998, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )) | ||||
999 | return build_type_attribute_variant (t2, attributes); | ||||
1000 | /* Merge the element types, and have a size if either arg has one. */ | ||||
1001 | t1 = build_cplus_array_type | ||||
1002 | (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2)((tree_check ((((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1002, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ) ? t1 : t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1002, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )); | ||||
1003 | break; | ||||
1004 | } | ||||
1005 | |||||
1006 | case FUNCTION_TYPE: | ||||
1007 | /* Function types: prefer the one that specified arg types. | ||||
1008 | If both do, merge the arg types. Also merge the return types. */ | ||||
1009 | { | ||||
1010 | tree valtype = merge_types (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1010, __FUNCTION__))->typed.type), TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1010, __FUNCTION__))->typed.type)); | ||||
1011 | tree p1 = TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1011, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); | ||||
1012 | tree p2 = TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1012, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); | ||||
1013 | tree parms; | ||||
1014 | |||||
1015 | /* Save space: see if the result is identical to one of the args. */ | ||||
1016 | if (valtype == TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1016, __FUNCTION__))->typed.type) && ! p2) | ||||
1017 | return cp_build_type_attribute_variant (t1, attributes); | ||||
1018 | if (valtype == TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1018, __FUNCTION__))->typed.type) && ! p1) | ||||
1019 | return cp_build_type_attribute_variant (t2, attributes); | ||||
1020 | |||||
1021 | /* Simple way if one arg fails to specify argument types. */ | ||||
1022 | if (p1 == NULL_TREE(tree) __null || TREE_VALUE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1022, __FUNCTION__, (TREE_LIST)))->list.value) == void_type_nodeglobal_trees[TI_VOID_TYPE]) | ||||
1023 | parms = p2; | ||||
1024 | else if (p2 == NULL_TREE(tree) __null || TREE_VALUE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1024, __FUNCTION__, (TREE_LIST)))->list.value) == void_type_nodeglobal_trees[TI_VOID_TYPE]) | ||||
1025 | parms = p1; | ||||
1026 | else | ||||
1027 | parms = commonparms (p1, p2); | ||||
1028 | |||||
1029 | cp_cv_quals quals = type_memfn_quals (t1); | ||||
1030 | cp_ref_qualifier rqual = type_memfn_rqual (t1); | ||||
1031 | gcc_assert (quals == type_memfn_quals (t2))((void)(!(quals == type_memfn_quals (t2)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1031, __FUNCTION__), 0 : 0)); | ||||
1032 | gcc_assert (rqual == type_memfn_rqual (t2))((void)(!(rqual == type_memfn_rqual (t2)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1032, __FUNCTION__), 0 : 0)); | ||||
1033 | |||||
1034 | tree rval = build_function_type (valtype, parms); | ||||
1035 | rval = apply_memfn_quals (rval, quals); | ||||
1036 | tree raises = merge_exception_specifiers (TYPE_RAISES_EXCEPTIONS (t1)((tree_class_check (((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1036, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1036, __FUNCTION__))->type_non_common.lang_1), | ||||
1037 | TYPE_RAISES_EXCEPTIONS (t2)((tree_class_check (((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1037, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1037, __FUNCTION__))->type_non_common.lang_1)); | ||||
1038 | bool late_return_type_p = TYPE_HAS_LATE_RETURN_TYPE (t1)(((tree_class_check (((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1038, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1038, __FUNCTION__))->type_common.lang_flag_2)); | ||||
1039 | t1 = build_cp_fntype_variant (rval, rqual, raises, late_return_type_p); | ||||
1040 | break; | ||||
1041 | } | ||||
1042 | |||||
1043 | case METHOD_TYPE: | ||||
1044 | { | ||||
1045 | /* Get this value the long way, since TYPE_METHOD_BASETYPE | ||||
1046 | is just the main variant of this. */ | ||||
1047 | tree basetype = class_of_this_parm (t2); | ||||
1048 | tree raises = merge_exception_specifiers (TYPE_RAISES_EXCEPTIONS (t1)((tree_class_check (((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1048, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1048, __FUNCTION__))->type_non_common.lang_1), | ||||
1049 | TYPE_RAISES_EXCEPTIONS (t2)((tree_class_check (((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1049, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1049, __FUNCTION__))->type_non_common.lang_1)); | ||||
1050 | cp_ref_qualifier rqual = type_memfn_rqual (t1); | ||||
1051 | tree t3; | ||||
1052 | bool late_return_type_1_p = TYPE_HAS_LATE_RETURN_TYPE (t1)(((tree_class_check (((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1052, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1052, __FUNCTION__))->type_common.lang_flag_2)); | ||||
1053 | |||||
1054 | /* If this was a member function type, get back to the | ||||
1055 | original type of type member function (i.e., without | ||||
1056 | the class instance variable up front. */ | ||||
1057 | t1 = build_function_type (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1057, __FUNCTION__))->typed.type), | ||||
1058 | TREE_CHAIN (TYPE_ARG_TYPES (t1))((contains_struct_check ((((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1058, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1058, __FUNCTION__))->common.chain)); | ||||
1059 | t2 = build_function_type (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1059, __FUNCTION__))->typed.type), | ||||
1060 | TREE_CHAIN (TYPE_ARG_TYPES (t2))((contains_struct_check ((((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1060, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1060, __FUNCTION__))->common.chain)); | ||||
1061 | t3 = merge_types (t1, t2); | ||||
1062 | t3 = build_method_type_directly (basetype, TREE_TYPE (t3)((contains_struct_check ((t3), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1062, __FUNCTION__))->typed.type), | ||||
1063 | TYPE_ARG_TYPES (t3)((tree_check2 ((t3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1063, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | ||||
1064 | t1 = build_cp_fntype_variant (t3, rqual, raises, late_return_type_1_p); | ||||
1065 | break; | ||||
1066 | } | ||||
1067 | |||||
1068 | case TYPENAME_TYPE: | ||||
1069 | /* There is no need to merge attributes into a TYPENAME_TYPE. | ||||
1070 | When the type is instantiated it will have whatever | ||||
1071 | attributes result from the instantiation. */ | ||||
1072 | return t1; | ||||
1073 | |||||
1074 | default:; | ||||
1075 | if (attribute_list_equal (TYPE_ATTRIBUTES (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1075, __FUNCTION__))->type_common.attributes), attributes)) | ||||
1076 | return t1; | ||||
1077 | else if (attribute_list_equal (TYPE_ATTRIBUTES (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1077, __FUNCTION__))->type_common.attributes), attributes)) | ||||
1078 | return t2; | ||||
1079 | break; | ||||
1080 | } | ||||
1081 | |||||
1082 | return cp_build_type_attribute_variant (t1, attributes); | ||||
1083 | } | ||||
1084 | |||||
1085 | /* Return the ARRAY_TYPE type without its domain. */ | ||||
1086 | |||||
1087 | tree | ||||
1088 | strip_array_domain (tree type) | ||||
1089 | { | ||||
1090 | tree t2; | ||||
1091 | gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1091, __FUNCTION__), 0 : 0)); | ||||
1092 | if (TYPE_DOMAIN (type)((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1092, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ) == NULL_TREE(tree) __null) | ||||
1093 | return type; | ||||
1094 | t2 = build_cplus_array_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1094, __FUNCTION__))->typed.type), NULL_TREE(tree) __null); | ||||
1095 | return cp_build_type_attribute_variant (t2, TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1095, __FUNCTION__))->type_common.attributes)); | ||||
1096 | } | ||||
1097 | |||||
1098 | /* Wrapper around cp_common_type that is used by c-common.cc and other | ||||
1099 | front end optimizations that remove promotions. | ||||
1100 | |||||
1101 | Return the common type for two arithmetic types T1 and T2 under the | ||||
1102 | usual arithmetic conversions. The default conversions have already | ||||
1103 | been applied, and enumerated types converted to their compatible | ||||
1104 | integer types. */ | ||||
1105 | |||||
1106 | tree | ||||
1107 | common_type (tree t1, tree t2) | ||||
1108 | { | ||||
1109 | /* If one type is nonsense, use the other */ | ||||
1110 | if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1111 | return t2; | ||||
1112 | if (t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1113 | return t1; | ||||
1114 | |||||
1115 | return cp_common_type (t1, t2); | ||||
1116 | } | ||||
1117 | |||||
1118 | /* Return the common type of two pointer types T1 and T2. This is the | ||||
1119 | type for the result of most arithmetic operations if the operands | ||||
1120 | have the given two types. | ||||
1121 | |||||
1122 | We assume that comp_target_types has already been done and returned | ||||
1123 | nonzero; if that isn't so, this may crash. */ | ||||
1124 | |||||
1125 | tree | ||||
1126 | common_pointer_type (tree t1, tree t2) | ||||
1127 | { | ||||
1128 | gcc_assert ((TYPE_PTR_P (t1) && TYPE_PTR_P (t2))((void)(!(((((enum tree_code) (t1)->base.code) == POINTER_TYPE ) && (((enum tree_code) (t2)->base.code) == POINTER_TYPE )) || ((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) && (((enum tree_code) (t2)->base.code) == OFFSET_TYPE )) || ((((enum tree_code) (t1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__))->type_common.lang_flag_2))) && (((enum tree_code) (t2)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__))->type_common.lang_flag_2))))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__), 0 : 0)) | ||||
1129 | || (TYPE_PTRDATAMEM_P (t1) && TYPE_PTRDATAMEM_P (t2))((void)(!(((((enum tree_code) (t1)->base.code) == POINTER_TYPE ) && (((enum tree_code) (t2)->base.code) == POINTER_TYPE )) || ((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) && (((enum tree_code) (t2)->base.code) == OFFSET_TYPE )) || ((((enum tree_code) (t1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__))->type_common.lang_flag_2))) && (((enum tree_code) (t2)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__))->type_common.lang_flag_2))))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__), 0 : 0)) | ||||
1130 | || (TYPE_PTRMEMFUNC_P (t1) && TYPE_PTRMEMFUNC_P (t2)))((void)(!(((((enum tree_code) (t1)->base.code) == POINTER_TYPE ) && (((enum tree_code) (t2)->base.code) == POINTER_TYPE )) || ((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) && (((enum tree_code) (t2)->base.code) == OFFSET_TYPE )) || ((((enum tree_code) (t1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__))->type_common.lang_flag_2))) && (((enum tree_code) (t2)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__))->type_common.lang_flag_2))))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1130, __FUNCTION__), 0 : 0)); | ||||
1131 | |||||
1132 | return composite_pointer_type (input_location, t1, t2, | ||||
1133 | error_mark_nodeglobal_trees[TI_ERROR_MARK], error_mark_nodeglobal_trees[TI_ERROR_MARK], | ||||
1134 | CPO_CONVERSION, tf_warning_or_error); | ||||
1135 | } | ||||
1136 | |||||
1137 | /* Compare two exception specifier types for exactness or subsetness, if | ||||
1138 | allowed. Returns false for mismatch, true for match (same, or | ||||
1139 | derived and !exact). | ||||
1140 | |||||
1141 | [except.spec] "If a class X ... objects of class X or any class publicly | ||||
1142 | and unambiguously derived from X. Similarly, if a pointer type Y * ... | ||||
1143 | exceptions of type Y * or that are pointers to any type publicly and | ||||
1144 | unambiguously derived from Y. Otherwise a function only allows exceptions | ||||
1145 | that have the same type ..." | ||||
1146 | This does not mention cv qualifiers and is different to what throw | ||||
1147 | [except.throw] and catch [except.catch] will do. They will ignore the | ||||
1148 | top level cv qualifiers, and allow qualifiers in the pointer to class | ||||
1149 | example. | ||||
1150 | |||||
1151 | We implement the letter of the standard. */ | ||||
1152 | |||||
1153 | static bool | ||||
1154 | comp_except_types (tree a, tree b, bool exact) | ||||
1155 | { | ||||
1156 | if (same_type_p (a, b)comptypes ((a), (b), 0)) | ||||
1157 | return true; | ||||
1158 | else if (!exact) | ||||
1159 | { | ||||
1160 | if (cp_type_quals (a) || cp_type_quals (b)) | ||||
1161 | return false; | ||||
1162 | |||||
1163 | if (TYPE_PTR_P (a)(((enum tree_code) (a)->base.code) == POINTER_TYPE) && TYPE_PTR_P (b)(((enum tree_code) (b)->base.code) == POINTER_TYPE)) | ||||
1164 | { | ||||
1165 | a = TREE_TYPE (a)((contains_struct_check ((a), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1165, __FUNCTION__))->typed.type); | ||||
1166 | b = TREE_TYPE (b)((contains_struct_check ((b), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1166, __FUNCTION__))->typed.type); | ||||
1167 | if (cp_type_quals (a) || cp_type_quals (b)) | ||||
1168 | return false; | ||||
1169 | } | ||||
1170 | |||||
1171 | if (TREE_CODE (a)((enum tree_code) (a)->base.code) != RECORD_TYPE | ||||
1172 | || TREE_CODE (b)((enum tree_code) (b)->base.code) != RECORD_TYPE) | ||||
1173 | return false; | ||||
1174 | |||||
1175 | if (publicly_uniquely_derived_p (a, b)) | ||||
1176 | return true; | ||||
1177 | } | ||||
1178 | return false; | ||||
1179 | } | ||||
1180 | |||||
1181 | /* Return true if TYPE1 and TYPE2 are equivalent exception specifiers. | ||||
1182 | If EXACT is ce_derived, T2 can be stricter than T1 (according to 15.4/5). | ||||
1183 | If EXACT is ce_type, the C++17 type compatibility rules apply. | ||||
1184 | If EXACT is ce_normal, the compatibility rules in 15.4/3 apply. | ||||
1185 | If EXACT is ce_exact, the specs must be exactly the same. Exception lists | ||||
1186 | are unordered, but we've already filtered out duplicates. Most lists will | ||||
1187 | be in order, we should try to make use of that. */ | ||||
1188 | |||||
1189 | bool | ||||
1190 | comp_except_specs (const_tree t1, const_tree t2, int exact) | ||||
1191 | { | ||||
1192 | const_tree probe; | ||||
1193 | const_tree base; | ||||
1194 | int length = 0; | ||||
1195 | |||||
1196 | if (t1 == t2) | ||||
1197 | return true; | ||||
1198 | |||||
1199 | /* First handle noexcept. */ | ||||
1200 | if (exact < ce_exact) | ||||
1201 | { | ||||
1202 | if (exact == ce_type | ||||
1203 | && (canonical_eh_spec (CONST_CAST_TREE (t1)(const_cast<union tree_node *> (((t1))))) | ||||
1204 | == canonical_eh_spec (CONST_CAST_TREE (t2)(const_cast<union tree_node *> (((t2))))))) | ||||
1205 | return true; | ||||
1206 | |||||
1207 | /* noexcept(false) is compatible with no exception-specification, | ||||
1208 | and less strict than any spec. */ | ||||
1209 | if (t1 == noexcept_false_speccp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC]) | ||||
1210 | return t2 == NULL_TREE(tree) __null || exact == ce_derived; | ||||
1211 | /* Even a derived noexcept(false) is compatible with no | ||||
1212 | exception-specification. */ | ||||
1213 | if (t2 == noexcept_false_speccp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC]) | ||||
1214 | return t1 == NULL_TREE(tree) __null; | ||||
1215 | |||||
1216 | /* Otherwise, if we aren't looking for an exact match, noexcept is | ||||
1217 | equivalent to throw(). */ | ||||
1218 | if (t1 == noexcept_true_speccp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC]) | ||||
1219 | t1 = empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]; | ||||
1220 | if (t2 == noexcept_true_speccp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC]) | ||||
1221 | t2 = empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]; | ||||
1222 | } | ||||
1223 | |||||
1224 | /* If any noexcept is left, it is only comparable to itself; | ||||
1225 | either we're looking for an exact match or we're redeclaring a | ||||
1226 | template with dependent noexcept. */ | ||||
1227 | if ((t1 && TREE_PURPOSE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1227, __FUNCTION__, (TREE_LIST)))->list.purpose)) | ||||
1228 | || (t2 && TREE_PURPOSE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1228, __FUNCTION__, (TREE_LIST)))->list.purpose))) | ||||
1229 | return (t1 && t2 | ||||
1230 | && cp_tree_equal (TREE_PURPOSE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1230, __FUNCTION__, (TREE_LIST)))->list.purpose), TREE_PURPOSE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1230, __FUNCTION__, (TREE_LIST)))->list.purpose))); | ||||
1231 | |||||
1232 | if (t1 == NULL_TREE(tree) __null) /* T1 is ... */ | ||||
1233 | return t2 == NULL_TREE(tree) __null || exact == ce_derived; | ||||
1234 | if (!TREE_VALUE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1234, __FUNCTION__, (TREE_LIST)))->list.value)) /* t1 is EMPTY */ | ||||
1235 | return t2 != NULL_TREE(tree) __null && !TREE_VALUE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1235, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
1236 | if (t2 == NULL_TREE(tree) __null) /* T2 is ... */ | ||||
1237 | return false; | ||||
1238 | if (TREE_VALUE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1238, __FUNCTION__, (TREE_LIST)))->list.value) && !TREE_VALUE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1238, __FUNCTION__, (TREE_LIST)))->list.value)) /* T2 is EMPTY, T1 is not */ | ||||
1239 | return exact == ce_derived; | ||||
1240 | |||||
1241 | /* Neither set is ... or EMPTY, make sure each part of T2 is in T1. | ||||
1242 | Count how many we find, to determine exactness. For exact matching and | ||||
1243 | ordered T1, T2, this is an O(n) operation, otherwise its worst case is | ||||
1244 | O(nm). */ | ||||
1245 | for (base = t1; t2 != NULL_TREE(tree) __null; t2 = TREE_CHAIN (t2)((contains_struct_check ((t2), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1245, __FUNCTION__))->common.chain)) | ||||
1246 | { | ||||
1247 | for (probe = base; probe != NULL_TREE(tree) __null; probe = TREE_CHAIN (probe)((contains_struct_check ((probe), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1247, __FUNCTION__))->common.chain)) | ||||
1248 | { | ||||
1249 | tree a = TREE_VALUE (probe)((tree_check ((probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1249, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
1250 | tree b = TREE_VALUE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1250, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
1251 | |||||
1252 | if (comp_except_types (a, b, exact)) | ||||
1253 | { | ||||
1254 | if (probe == base && exact > ce_derived) | ||||
1255 | base = TREE_CHAIN (probe)((contains_struct_check ((probe), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1255, __FUNCTION__))->common.chain); | ||||
1256 | length++; | ||||
1257 | break; | ||||
1258 | } | ||||
1259 | } | ||||
1260 | if (probe == NULL_TREE(tree) __null) | ||||
1261 | return false; | ||||
1262 | } | ||||
1263 | return exact == ce_derived || base == NULL_TREE(tree) __null || length == list_length (t1); | ||||
1264 | } | ||||
1265 | |||||
1266 | /* Compare the array types T1 and T2. CB says how we should behave when | ||||
1267 | comparing array bounds: bounds_none doesn't allow dimensionless arrays, | ||||
1268 | bounds_either says than any array can be [], bounds_first means that | ||||
1269 | onlt T1 can be an array with unknown bounds. STRICT is true if | ||||
1270 | qualifiers must match when comparing the types of the array elements. */ | ||||
1271 | |||||
1272 | static bool | ||||
1273 | comp_array_types (const_tree t1, const_tree t2, compare_bounds_t cb, | ||||
1274 | bool strict) | ||||
1275 | { | ||||
1276 | tree d1; | ||||
1277 | tree d2; | ||||
1278 | tree max1, max2; | ||||
1279 | |||||
1280 | if (t1 == t2) | ||||
1281 | return true; | ||||
1282 | |||||
1283 | /* The type of the array elements must be the same. */ | ||||
1284 | if (strict | ||||
1285 | ? !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1285, __FUNCTION__))->typed.type)), (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1285, __FUNCTION__))->typed.type)), 0) | ||||
1286 | : !similar_type_p (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1286, __FUNCTION__))->typed.type), TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1286, __FUNCTION__))->typed.type))) | ||||
1287 | return false; | ||||
1288 | |||||
1289 | d1 = TYPE_DOMAIN (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1289, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ); | ||||
1290 | d2 = TYPE_DOMAIN (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1290, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ); | ||||
1291 | |||||
1292 | if (d1 == d2) | ||||
1293 | return true; | ||||
1294 | |||||
1295 | /* If one of the arrays is dimensionless, and the other has a | ||||
1296 | dimension, they are of different types. However, it is valid to | ||||
1297 | write: | ||||
1298 | |||||
1299 | extern int a[]; | ||||
1300 | int a[3]; | ||||
1301 | |||||
1302 | by [basic.link]: | ||||
1303 | |||||
1304 | declarations for an array object can specify | ||||
1305 | array types that differ by the presence or absence of a major | ||||
1306 | array bound (_dcl.array_). */ | ||||
1307 | if (!d1 && d2) | ||||
1308 | return cb >= bounds_either; | ||||
1309 | else if (d1 && !d2) | ||||
1310 | return cb == bounds_either; | ||||
1311 | |||||
1312 | /* Check that the dimensions are the same. */ | ||||
1313 | |||||
1314 | if (!cp_tree_equal (TYPE_MIN_VALUE (d1)((tree_check5 ((d1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1314, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval ), TYPE_MIN_VALUE (d2)((tree_check5 ((d2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1314, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval ))) | ||||
1315 | return false; | ||||
1316 | max1 = TYPE_MAX_VALUE (d1)((tree_check5 ((d1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1316, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ); | ||||
1317 | max2 = TYPE_MAX_VALUE (d2)((tree_check5 ((d2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1317, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ); | ||||
1318 | |||||
1319 | if (!cp_tree_equal (max1, max2)) | ||||
1320 | return false; | ||||
1321 | |||||
1322 | return true; | ||||
1323 | } | ||||
1324 | |||||
1325 | /* Compare the relative position of T1 and T2 into their respective | ||||
1326 | template parameter list. | ||||
1327 | T1 and T2 must be template parameter types. | ||||
1328 | Return TRUE if T1 and T2 have the same position, FALSE otherwise. */ | ||||
1329 | |||||
1330 | static bool | ||||
1331 | comp_template_parms_position (tree t1, tree t2) | ||||
1332 | { | ||||
1333 | tree index1, index2; | ||||
1334 | gcc_assert (t1 && t2((void)(!(t1 && t2 && ((enum tree_code) (t1)-> base.code) == ((enum tree_code) (t2)->base.code) && (((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TYPE_PARM )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1338, __FUNCTION__), 0 : 0)) | ||||
1335 | && TREE_CODE (t1) == TREE_CODE (t2)((void)(!(t1 && t2 && ((enum tree_code) (t1)-> base.code) == ((enum tree_code) (t2)->base.code) && (((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TYPE_PARM )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1338, __FUNCTION__), 0 : 0)) | ||||
1336 | && (TREE_CODE (t1) == BOUND_TEMPLATE_TEMPLATE_PARM((void)(!(t1 && t2 && ((enum tree_code) (t1)-> base.code) == ((enum tree_code) (t2)->base.code) && (((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TYPE_PARM )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1338, __FUNCTION__), 0 : 0)) | ||||
1337 | || TREE_CODE (t1) == TEMPLATE_TEMPLATE_PARM((void)(!(t1 && t2 && ((enum tree_code) (t1)-> base.code) == ((enum tree_code) (t2)->base.code) && (((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TYPE_PARM )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1338, __FUNCTION__), 0 : 0)) | ||||
1338 | || TREE_CODE (t1) == TEMPLATE_TYPE_PARM))((void)(!(t1 && t2 && ((enum tree_code) (t1)-> base.code) == ((enum tree_code) (t2)->base.code) && (((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (t1)->base.code) == TEMPLATE_TYPE_PARM )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1338, __FUNCTION__), 0 : 0)); | ||||
1339 | |||||
1340 | index1 = TEMPLATE_TYPE_PARM_INDEX (TYPE_MAIN_VARIANT (t1))(((tree_class_check (((tree_check3 (((((tree_class_check ((t1 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1340, __FUNCTION__))->type_common.main_variant))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1340, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1340, __FUNCTION__))->type_non_common.values)); | ||||
1341 | index2 = TEMPLATE_TYPE_PARM_INDEX (TYPE_MAIN_VARIANT (t2))(((tree_class_check (((tree_check3 (((((tree_class_check ((t2 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1341, __FUNCTION__))->type_common.main_variant))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1341, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1341, __FUNCTION__))->type_non_common.values)); | ||||
1342 | |||||
1343 | /* Then compare their relative position. */ | ||||
1344 | if (TEMPLATE_PARM_IDX (index1)(((template_parm_index*)(tree_check ((index1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1344, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index) != TEMPLATE_PARM_IDX (index2)(((template_parm_index*)(tree_check ((index2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1344, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index) | ||||
1345 | || TEMPLATE_PARM_LEVEL (index1)(((template_parm_index*)(tree_check ((index1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1345, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level) != TEMPLATE_PARM_LEVEL (index2)(((template_parm_index*)(tree_check ((index2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1345, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level) | ||||
1346 | || (TEMPLATE_PARM_PARAMETER_PACK (index1)(((tree_not_check2 (((tree_check ((index1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1346, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1346, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) | ||||
1347 | != TEMPLATE_PARM_PARAMETER_PACK (index2)(((tree_not_check2 (((tree_check ((index2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1347, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1347, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) | ||||
1348 | return false; | ||||
1349 | |||||
1350 | /* In C++14 we can end up comparing 'auto' to a normal template | ||||
1351 | parameter. Don't confuse them. */ | ||||
1352 | if (cxx_dialect >= cxx14 && (is_auto (t1) || is_auto (t2))) | ||||
1353 | return TYPE_IDENTIFIER (t1)(((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name)) == TYPE_IDENTIFIER (t2)(((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1353, __FUNCTION__))->type_common.name)); | ||||
1354 | |||||
1355 | return true; | ||||
1356 | } | ||||
1357 | |||||
1358 | /* Heuristic check if two parameter types can be considered ABI-equivalent. */ | ||||
1359 | |||||
1360 | static bool | ||||
1361 | cxx_safe_arg_type_equiv_p (tree t1, tree t2) | ||||
1362 | { | ||||
1363 | t1 = TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1363, __FUNCTION__))->type_common.main_variant); | ||||
1364 | t2 = TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1364, __FUNCTION__))->type_common.main_variant); | ||||
1365 | |||||
1366 | if (TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE) | ||||
1367 | && TYPE_PTR_P (t2)(((enum tree_code) (t2)->base.code) == POINTER_TYPE)) | ||||
1368 | return true; | ||||
1369 | |||||
1370 | /* The signedness of the parameter matters only when an integral | ||||
1371 | type smaller than int is promoted to int, otherwise only the | ||||
1372 | precision of the parameter matters. | ||||
1373 | This check should make sure that the callee does not see | ||||
1374 | undefined values in argument registers. */ | ||||
1375 | if (INTEGRAL_TYPE_P (t1)(((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE || (( enum tree_code) (t1)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t1)->base.code) == INTEGER_TYPE) | ||||
1376 | && INTEGRAL_TYPE_P (t2)(((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE || (( enum tree_code) (t2)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (t2)->base.code) == INTEGER_TYPE) | ||||
1377 | && TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1377, __FUNCTION__))->type_common.precision) == TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1377, __FUNCTION__))->type_common.precision) | ||||
1378 | && (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1378, __FUNCTION__))->base.u.bits.unsigned_flag) == TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1378, __FUNCTION__))->base.u.bits.unsigned_flag) | ||||
1379 | || !targetm.calls.promote_prototypes (NULL_TREE(tree) __null) | ||||
1380 | || TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1380, __FUNCTION__))->type_common.precision) >= TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1380, __FUNCTION__))->type_common.precision))) | ||||
1381 | return true; | ||||
1382 | |||||
1383 | return same_type_p (t1, t2)comptypes ((t1), (t2), 0); | ||||
1384 | } | ||||
1385 | |||||
1386 | /* Check if a type cast between two function types can be considered safe. */ | ||||
1387 | |||||
1388 | static bool | ||||
1389 | cxx_safe_function_type_cast_p (tree t1, tree t2) | ||||
1390 | { | ||||
1391 | if (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1391, __FUNCTION__))->typed.type) == void_type_nodeglobal_trees[TI_VOID_TYPE] && | ||||
1392 | TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1392, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values) == void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) | ||||
1393 | return true; | ||||
1394 | |||||
1395 | if (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1395, __FUNCTION__))->typed.type) == void_type_nodeglobal_trees[TI_VOID_TYPE] && | ||||
1396 | TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1396, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values) == void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) | ||||
1397 | return true; | ||||
1398 | |||||
1399 | if (!cxx_safe_arg_type_equiv_p (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1399, __FUNCTION__))->typed.type), TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1399, __FUNCTION__))->typed.type))) | ||||
1400 | return false; | ||||
1401 | |||||
1402 | for (t1 = TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1402, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values), t2 = TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1402, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); | ||||
1403 | t1 && t2; | ||||
1404 | t1 = TREE_CHAIN (t1)((contains_struct_check ((t1), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1404, __FUNCTION__))->common.chain), t2 = TREE_CHAIN (t2)((contains_struct_check ((t2), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1404, __FUNCTION__))->common.chain)) | ||||
1405 | if (!cxx_safe_arg_type_equiv_p (TREE_VALUE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1405, __FUNCTION__, (TREE_LIST)))->list.value), TREE_VALUE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1405, __FUNCTION__, (TREE_LIST)))->list.value))) | ||||
1406 | return false; | ||||
1407 | |||||
1408 | return true; | ||||
1409 | } | ||||
1410 | |||||
1411 | /* Subroutine in comptypes. */ | ||||
1412 | |||||
1413 | static bool | ||||
1414 | structural_comptypes (tree t1, tree t2, int strict) | ||||
1415 | { | ||||
1416 | /* Both should be types that are not obviously the same. */ | ||||
1417 | gcc_checking_assert (t1 != t2 && TYPE_P (t1) && TYPE_P (t2))((void)(!(t1 != t2 && (tree_code_type_tmpl <0>:: tree_code_type[(int) (((enum tree_code) (t1)->base.code))] == tcc_type) && (tree_code_type_tmpl <0>::tree_code_type [(int) (((enum tree_code) (t2)->base.code))] == tcc_type)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1417, __FUNCTION__), 0 : 0)); | ||||
1418 | |||||
1419 | /* Suppress typename resolution under spec_hasher::equal in place of calling | ||||
1420 | push_to_top_level there. */ | ||||
1421 | if (!comparing_specializations) | ||||
1422 | { | ||||
1423 | /* TYPENAME_TYPEs should be resolved if the qualifying scope is the | ||||
1424 | current instantiation. */ | ||||
1425 | if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == TYPENAME_TYPE) | ||||
1426 | t1 = resolve_typename_type (t1, /*only_current_p=*/true); | ||||
1427 | |||||
1428 | if (TREE_CODE (t2)((enum tree_code) (t2)->base.code) == TYPENAME_TYPE) | ||||
1429 | t2 = resolve_typename_type (t2, /*only_current_p=*/true); | ||||
1430 | } | ||||
1431 | |||||
1432 | if (TYPE_PTRMEMFUNC_P (t1)(((enum tree_code) (t1)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1432, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1432, __FUNCTION__))->type_common.lang_flag_2)))) | ||||
1433 | t1 = TYPE_PTRMEMFUNC_FN_TYPE (t1)(cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1433, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1433, __FUNCTION__))->typed.type), cp_type_quals (t1))); | ||||
1434 | if (TYPE_PTRMEMFUNC_P (t2)(((enum tree_code) (t2)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1434, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1434, __FUNCTION__))->type_common.lang_flag_2)))) | ||||
1435 | t2 = TYPE_PTRMEMFUNC_FN_TYPE (t2)(cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1435, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1435, __FUNCTION__))->typed.type), cp_type_quals (t2))); | ||||
1436 | |||||
1437 | /* Different classes of types can't be compatible. */ | ||||
1438 | if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != TREE_CODE (t2)((enum tree_code) (t2)->base.code)) | ||||
1439 | return false; | ||||
1440 | |||||
1441 | /* Qualifiers must match. For array types, we will check when we | ||||
1442 | recur on the array element types. */ | ||||
1443 | if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != ARRAY_TYPE | ||||
1444 | && cp_type_quals (t1) != cp_type_quals (t2)) | ||||
1445 | return false; | ||||
1446 | if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == FUNCTION_TYPE | ||||
1447 | && type_memfn_quals (t1) != type_memfn_quals (t2)) | ||||
1448 | return false; | ||||
1449 | /* Need to check this before TYPE_MAIN_VARIANT. | ||||
1450 | FIXME function qualifiers should really change the main variant. */ | ||||
1451 | if (FUNC_OR_METHOD_TYPE_P (t1)(((enum tree_code) (t1)->base.code) == FUNCTION_TYPE || (( enum tree_code) (t1)->base.code) == METHOD_TYPE)) | ||||
1452 | { | ||||
1453 | if (type_memfn_rqual (t1) != type_memfn_rqual (t2)) | ||||
1454 | return false; | ||||
1455 | if (flag_noexcept_type | ||||
1456 | && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (t1)((tree_class_check (((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1456, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1456, __FUNCTION__))->type_non_common.lang_1), | ||||
1457 | TYPE_RAISES_EXCEPTIONS (t2)((tree_class_check (((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1457, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1457, __FUNCTION__))->type_non_common.lang_1), | ||||
1458 | ce_type)) | ||||
1459 | return false; | ||||
1460 | } | ||||
1461 | |||||
1462 | /* Allow for two different type nodes which have essentially the same | ||||
1463 | definition. Note that we already checked for equality of the type | ||||
1464 | qualifiers (just above). */ | ||||
1465 | if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != ARRAY_TYPE | ||||
1466 | && TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1466, __FUNCTION__))->type_common.main_variant) == TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1466, __FUNCTION__))->type_common.main_variant)) | ||||
1467 | goto check_alias; | ||||
1468 | |||||
1469 | /* Compare the types. Return false on known not-same. Break on not | ||||
1470 | known. Never return true from this switch -- you'll break | ||||
1471 | specialization comparison. */ | ||||
1472 | switch (TREE_CODE (t1)((enum tree_code) (t1)->base.code)) | ||||
1473 | { | ||||
1474 | case VOID_TYPE: | ||||
1475 | case BOOLEAN_TYPE: | ||||
1476 | /* All void and bool types are the same. */ | ||||
1477 | break; | ||||
1478 | |||||
1479 | case OPAQUE_TYPE: | ||||
1480 | case INTEGER_TYPE: | ||||
1481 | case FIXED_POINT_TYPE: | ||||
1482 | case REAL_TYPE: | ||||
1483 | /* With these nodes, we can't determine type equivalence by | ||||
1484 | looking at what is stored in the nodes themselves, because | ||||
1485 | two nodes might have different TYPE_MAIN_VARIANTs but still | ||||
1486 | represent the same type. For example, wchar_t and int could | ||||
1487 | have the same properties (TYPE_PRECISION, TYPE_MIN_VALUE, | ||||
1488 | TYPE_MAX_VALUE, etc.), but have different TYPE_MAIN_VARIANTs | ||||
1489 | and are distinct types. On the other hand, int and the | ||||
1490 | following typedef | ||||
1491 | |||||
1492 | typedef int INT __attribute((may_alias)); | ||||
1493 | |||||
1494 | have identical properties, different TYPE_MAIN_VARIANTs, but | ||||
1495 | represent the same type. The canonical type system keeps | ||||
1496 | track of equivalence in this case, so we fall back on it. */ | ||||
1497 | if (TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1497, __FUNCTION__))->type_common.canonical) != TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1497, __FUNCTION__))->type_common.canonical)) | ||||
1498 | return false; | ||||
1499 | |||||
1500 | /* We don't need or want the attribute comparison. */ | ||||
1501 | goto check_alias; | ||||
1502 | |||||
1503 | case TEMPLATE_TEMPLATE_PARM: | ||||
1504 | case BOUND_TEMPLATE_TEMPLATE_PARM: | ||||
1505 | if (!comp_template_parms_position (t1, t2)) | ||||
1506 | return false; | ||||
1507 | if (!comp_template_parms | ||||
1508 | (DECL_TEMPLATE_PARMS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t1))((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((((((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM) ? (((struct tree_template_info *)(tree_check (((((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t1)->base.code) == RECORD_TYPE || ( (enum tree_code) (t1)->base.code) == UNION_TYPE || ((enum tree_code ) (t1)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1508, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1508, __FUNCTION__, (TEMPLATE_INFO))))->tmpl) : ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1508, __FUNCTION__))->type_common.name))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1508, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments, | ||||
1509 | DECL_TEMPLATE_PARMS (TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL (t2))((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((((((enum tree_code) (t2)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM) ? (((struct tree_template_info *)(tree_check (((((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (t2)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t2)->base.code) == RECORD_TYPE || ( (enum tree_code) (t2)->base.code) == UNION_TYPE || ((enum tree_code ) (t2)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1509, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1509, __FUNCTION__, (TEMPLATE_INFO))))->tmpl) : ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1509, __FUNCTION__))->type_common.name))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1509, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments)) | ||||
1510 | return false; | ||||
1511 | if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == TEMPLATE_TEMPLATE_PARM) | ||||
1512 | break; | ||||
1513 | /* Don't check inheritance. */ | ||||
1514 | strict = COMPARE_STRICT0; | ||||
1515 | /* Fall through. */ | ||||
1516 | |||||
1517 | case RECORD_TYPE: | ||||
1518 | case UNION_TYPE: | ||||
1519 | if (TYPE_TEMPLATE_INFO (t1)(((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE || (( enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t1)->base.code) == RECORD_TYPE || ( (enum tree_code) (t1)->base.code) == UNION_TYPE || ((enum tree_code ) (t1)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1519, __FUNCTION__))->type_non_common.lang_1) : (tree) __null ) && TYPE_TEMPLATE_INFO (t2)(((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE || (( enum tree_code) (t2)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t2)->base.code) == RECORD_TYPE || ( (enum tree_code) (t2)->base.code) == UNION_TYPE || ((enum tree_code ) (t2)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1519, __FUNCTION__))->type_non_common.lang_1) : (tree) __null ) | ||||
1520 | && (TYPE_TI_TEMPLATE (t1)(((struct tree_template_info*)(tree_check (((((enum tree_code ) (t1)->base.code) == ENUMERAL_TYPE || ((enum tree_code) ( t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t1)->base.code) == RECORD_TYPE || ((enum tree_code ) (t1)->base.code) == UNION_TYPE || ((enum tree_code) (t1) ->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t1 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1520, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1520, __FUNCTION__, (TEMPLATE_INFO))))->tmpl) == TYPE_TI_TEMPLATE (t2)(((struct tree_template_info*)(tree_check (((((enum tree_code ) (t2)->base.code) == ENUMERAL_TYPE || ((enum tree_code) ( t2)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t2)->base.code) == RECORD_TYPE || ((enum tree_code ) (t2)->base.code) == UNION_TYPE || ((enum tree_code) (t2) ->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t2 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1520, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1520, __FUNCTION__, (TEMPLATE_INFO))))->tmpl) | ||||
1521 | || TREE_CODE (t1)((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM) | ||||
1522 | && comp_template_args (TYPE_TI_ARGS (t1)(((struct tree_template_info*)(tree_check (((((enum tree_code ) (t1)->base.code) == ENUMERAL_TYPE || ((enum tree_code) ( t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t1)->base.code) == RECORD_TYPE || ((enum tree_code ) (t1)->base.code) == UNION_TYPE || ((enum tree_code) (t1) ->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t1 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1522, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1522, __FUNCTION__, (TEMPLATE_INFO))))->args), TYPE_TI_ARGS (t2)(((struct tree_template_info*)(tree_check (((((enum tree_code ) (t2)->base.code) == ENUMERAL_TYPE || ((enum tree_code) ( t2)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t2)->base.code) == RECORD_TYPE || ((enum tree_code ) (t2)->base.code) == UNION_TYPE || ((enum tree_code) (t2) ->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t2 ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1522, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1522, __FUNCTION__, (TEMPLATE_INFO))))->args))) | ||||
1523 | break; | ||||
1524 | |||||
1525 | if ((strict & COMPARE_BASE1) && DERIVED_FROM_P (t1, t2)(lookup_base ((t2), (t1), ba_any, __null, tf_none) != (tree) __null )) | ||||
1526 | break; | ||||
1527 | else if ((strict & COMPARE_DERIVED2) && DERIVED_FROM_P (t2, t1)(lookup_base ((t1), (t2), ba_any, __null, tf_none) != (tree) __null )) | ||||
1528 | break; | ||||
1529 | |||||
1530 | return false; | ||||
1531 | |||||
1532 | case OFFSET_TYPE: | ||||
1533 | if (!comptypes (TYPE_OFFSET_BASETYPE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1533, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ), TYPE_OFFSET_BASETYPE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1533, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ), | ||||
1534 | strict & ~COMPARE_REDECLARATION4)) | ||||
1535 | return false; | ||||
1536 | if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1536, __FUNCTION__))->typed.type)), (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1536, __FUNCTION__))->typed.type)), 0)) | ||||
1537 | return false; | ||||
1538 | break; | ||||
1539 | |||||
1540 | case REFERENCE_TYPE: | ||||
1541 | if (TYPE_REF_IS_RVALUE (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1541, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag ) != TYPE_REF_IS_RVALUE (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1541, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag )) | ||||
1542 | return false; | ||||
1543 | /* fall through to checks for pointer types */ | ||||
1544 | gcc_fallthrough (); | ||||
1545 | |||||
1546 | case POINTER_TYPE: | ||||
1547 | if (TYPE_MODE (t1)((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1547, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t1) : (t1)->type_common.mode) != TYPE_MODE (t2)((((enum tree_code) ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1547, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode (t2) : (t2)->type_common.mode) | ||||
1548 | || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1548, __FUNCTION__))->typed.type)), (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1548, __FUNCTION__))->typed.type)), 0)) | ||||
1549 | return false; | ||||
1550 | break; | ||||
1551 | |||||
1552 | case METHOD_TYPE: | ||||
1553 | case FUNCTION_TYPE: | ||||
1554 | /* Exception specs and memfn_rquals were checked above. */ | ||||
1555 | if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1555, __FUNCTION__))->typed.type)), (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1555, __FUNCTION__))->typed.type)), 0)) | ||||
1556 | return false; | ||||
1557 | if (!compparms (TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1557, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values), TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1557, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values))) | ||||
1558 | return false; | ||||
1559 | break; | ||||
1560 | |||||
1561 | case ARRAY_TYPE: | ||||
1562 | /* Target types must match incl. qualifiers. */ | ||||
1563 | if (!comp_array_types (t1, t2, ((strict & COMPARE_REDECLARATION4) | ||||
1564 | ? bounds_either : bounds_none), | ||||
1565 | /*strict=*/true)) | ||||
1566 | return false; | ||||
1567 | break; | ||||
1568 | |||||
1569 | case TEMPLATE_TYPE_PARM: | ||||
1570 | /* If T1 and T2 don't have the same relative position in their | ||||
1571 | template parameters set, they can't be equal. */ | ||||
1572 | if (!comp_template_parms_position (t1, t2)) | ||||
1573 | return false; | ||||
1574 | /* If T1 and T2 don't represent the same class template deduction, | ||||
1575 | they aren't equal. */ | ||||
1576 | if (CLASS_PLACEHOLDER_TEMPLATE (t1)(((contains_struct_check ((((tree_class_check (((tree_check ( (t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1576, __FUNCTION__, (TEMPLATE_TYPE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1576, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1576, __FUNCTION__))->decl_common.initial)) | ||||
1577 | != CLASS_PLACEHOLDER_TEMPLATE (t2)(((contains_struct_check ((((tree_class_check (((tree_check ( (t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1577, __FUNCTION__, (TEMPLATE_TYPE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1577, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1577, __FUNCTION__))->decl_common.initial))) | ||||
1578 | return false; | ||||
1579 | /* Constrained 'auto's are distinct from parms that don't have the same | ||||
1580 | constraints. */ | ||||
1581 | if (!equivalent_placeholder_constraints (t1, t2)) | ||||
1582 | return false; | ||||
1583 | break; | ||||
1584 | |||||
1585 | case TYPENAME_TYPE: | ||||
1586 | if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1)(((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1586, __FUNCTION__, (TYPENAME_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1586, __FUNCTION__))->type_non_common.values)), | ||||
1587 | TYPENAME_TYPE_FULLNAME (t2)(((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1587, __FUNCTION__, (TYPENAME_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1587, __FUNCTION__))->type_non_common.values)))) | ||||
1588 | return false; | ||||
1589 | /* Qualifiers don't matter on scopes. */ | ||||
1590 | if (!same_type_ignoring_top_level_qualifiers_p (TYPE_CONTEXT (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1590, __FUNCTION__))->type_common.context), | ||||
1591 | TYPE_CONTEXT (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1591, __FUNCTION__))->type_common.context))) | ||||
1592 | return false; | ||||
1593 | break; | ||||
1594 | |||||
1595 | case UNBOUND_CLASS_TEMPLATE: | ||||
1596 | if (!cp_tree_equal (TYPE_IDENTIFIER (t1)(((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name)), TYPE_IDENTIFIER (t2)(((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1596, __FUNCTION__))->type_common.name)))) | ||||
1597 | return false; | ||||
1598 | if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2))comptypes ((((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1598, __FUNCTION__))->type_common.context)), (((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1598, __FUNCTION__))->type_common.context)), 0)) | ||||
1599 | return false; | ||||
1600 | break; | ||||
1601 | |||||
1602 | case COMPLEX_TYPE: | ||||
1603 | if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1603, __FUNCTION__))->typed.type)), (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1603, __FUNCTION__))->typed.type)), 0)) | ||||
1604 | return false; | ||||
1605 | break; | ||||
1606 | |||||
1607 | case VECTOR_TYPE: | ||||
1608 | if (gnu_vector_type_p (t1) != gnu_vector_type_p (t2) | ||||
1609 | || maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (t2)) | ||||
1610 | || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1610, __FUNCTION__))->typed.type)), (((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1610, __FUNCTION__))->typed.type)), 0)) | ||||
1611 | return false; | ||||
1612 | break; | ||||
1613 | |||||
1614 | case TYPE_PACK_EXPANSION: | ||||
1615 | return (same_type_p (PACK_EXPANSION_PATTERN (t1),comptypes (((((enum tree_code) ((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1615, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION ))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1615, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((t1), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1615, __FUNCTION__))))))), ((((enum tree_code) ((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1616, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION ))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1616, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((t2), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1616, __FUNCTION__))))))), 0) | ||||
1616 | PACK_EXPANSION_PATTERN (t2))comptypes (((((enum tree_code) ((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1615, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION ))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((t1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1615, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((t1), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1615, __FUNCTION__))))))), ((((enum tree_code) ((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1616, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION ))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((t2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1616, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((t2), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1616, __FUNCTION__))))))), 0) | ||||
1617 | && comp_template_args (PACK_EXPANSION_EXTRA_ARGS (t1)*(((enum tree_code) ((tree_check2 ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1617, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION ))))->base.code) == TYPE_PACK_EXPANSION ? &((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1617, __FUNCTION__))->type_non_common.maxval) : &(*( (const_cast<tree*> (tree_operand_check (((t1)), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1617, __FUNCTION__)))))), | ||||
1618 | PACK_EXPANSION_EXTRA_ARGS (t2)*(((enum tree_code) ((tree_check2 ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1618, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION ))))->base.code) == TYPE_PACK_EXPANSION ? &((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1618, __FUNCTION__))->type_non_common.maxval) : &(*( (const_cast<tree*> (tree_operand_check (((t2)), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1618, __FUNCTION__)))))))); | ||||
1619 | |||||
1620 | case DECLTYPE_TYPE: | ||||
1621 | if (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1621, __FUNCTION__, (DECLTYPE_TYPE))))->type_common.string_flag | ||||
1622 | != DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1622, __FUNCTION__, (DECLTYPE_TYPE))))->type_common.string_flag) | ||||
1623 | return false; | ||||
1624 | if (DECLTYPE_FOR_LAMBDA_CAPTURE (t1)((tree_not_check2 (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1624, __FUNCTION__, (DECLTYPE_TYPE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1624, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) != DECLTYPE_FOR_LAMBDA_CAPTURE (t2)((tree_not_check2 (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1624, __FUNCTION__, (DECLTYPE_TYPE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1624, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) | ||||
1625 | return false; | ||||
1626 | if (DECLTYPE_FOR_LAMBDA_PROXY (t1)((tree_not_check2 (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1626, __FUNCTION__, (DECLTYPE_TYPE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1626, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2) != DECLTYPE_FOR_LAMBDA_PROXY (t2)((tree_not_check2 (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1626, __FUNCTION__, (DECLTYPE_TYPE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1626, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) | ||||
1627 | return false; | ||||
1628 | if (!cp_tree_equal (DECLTYPE_TYPE_EXPR (t1)(((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1628, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1628, __FUNCTION__))->type_non_common.values)), DECLTYPE_TYPE_EXPR (t2)(((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1628, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1628, __FUNCTION__))->type_non_common.values)))) | ||||
1629 | return false; | ||||
1630 | break; | ||||
1631 | |||||
1632 | case TRAIT_TYPE: | ||||
1633 | if (TRAIT_TYPE_KIND (t1)((enum cp_trait_kind) ((unsigned long) (*tree_int_cst_elt_check ((((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1633, __FUNCTION__, (TRAIT_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1633, __FUNCTION__))->type_non_common.values)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1633, __FUNCTION__)))) != TRAIT_TYPE_KIND (t2)((enum cp_trait_kind) ((unsigned long) (*tree_int_cst_elt_check ((((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1633, __FUNCTION__, (TRAIT_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1633, __FUNCTION__))->type_non_common.values)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1633, __FUNCTION__))))) | ||||
1634 | return false; | ||||
1635 | if (!same_type_p (TRAIT_TYPE_TYPE1 (t1), TRAIT_TYPE_TYPE1 (t2))comptypes ((((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1635, __FUNCTION__, (TRAIT_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1635, __FUNCTION__))->type_non_common.minval)), (((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1635, __FUNCTION__, (TRAIT_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1635, __FUNCTION__))->type_non_common.minval)), 0) | ||||
1636 | || !cp_tree_equal (TRAIT_TYPE_TYPE2 (t1)((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1636, __FUNCTION__, (TRAIT_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1636, __FUNCTION__))->type_non_common.maxval), TRAIT_TYPE_TYPE2 (t2)((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1636, __FUNCTION__, (TRAIT_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1636, __FUNCTION__))->type_non_common.maxval))) | ||||
1637 | return false; | ||||
1638 | break; | ||||
1639 | |||||
1640 | case TYPEOF_TYPE: | ||||
1641 | if (!cp_tree_equal (TYPEOF_TYPE_EXPR (t1)(((tree_class_check (((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1641, __FUNCTION__, (TYPEOF_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1641, __FUNCTION__))->type_non_common.values)), TYPEOF_TYPE_EXPR (t2)(((tree_class_check (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1641, __FUNCTION__, (TYPEOF_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1641, __FUNCTION__))->type_non_common.values)))) | ||||
1642 | return false; | ||||
1643 | break; | ||||
1644 | |||||
1645 | default: | ||||
1646 | return false; | ||||
1647 | } | ||||
1648 | |||||
1649 | /* If we get here, we know that from a target independent POV the | ||||
1650 | types are the same. Make sure the target attributes are also | ||||
1651 | the same. */ | ||||
1652 | if (!comp_type_attributes (t1, t2)) | ||||
1653 | return false; | ||||
1654 | |||||
1655 | check_alias: | ||||
1656 | if (comparing_dependent_aliases) | ||||
1657 | { | ||||
1658 | /* Don't treat an alias template specialization with dependent | ||||
1659 | arguments as equivalent to its underlying type when used as a | ||||
1660 | template argument; we need them to be distinct so that we | ||||
1661 | substitute into the specialization arguments at instantiation | ||||
1662 | time. And aliases can't be equivalent without being ==, so | ||||
1663 | we don't need to look any deeper. */ | ||||
1664 | ++processing_template_declscope_chain->x_processing_template_decl; | ||||
1665 | tree dep1 = dependent_alias_template_spec_p (t1, nt_transparent); | ||||
1666 | tree dep2 = dependent_alias_template_spec_p (t2, nt_transparent); | ||||
1667 | --processing_template_declscope_chain->x_processing_template_decl; | ||||
1668 | if ((dep1 || dep2) && dep1 != dep2) | ||||
1669 | return false; | ||||
1670 | } | ||||
1671 | |||||
1672 | return true; | ||||
1673 | } | ||||
1674 | |||||
1675 | /* Return true if T1 and T2 are related as allowed by STRICT. STRICT | ||||
1676 | is a bitwise-or of the COMPARE_* flags. */ | ||||
1677 | |||||
1678 | bool | ||||
1679 | comptypes (tree t1, tree t2, int strict) | ||||
1680 | { | ||||
1681 | gcc_checking_assert (t1 && t2)((void)(!(t1 && t2) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1681, __FUNCTION__), 0 : 0)); | ||||
1682 | |||||
1683 | /* TYPE_ARGUMENT_PACKS are not really types. */ | ||||
1684 | gcc_checking_assert (TREE_CODE (t1) != TYPE_ARGUMENT_PACK((void)(!(((enum tree_code) (t1)->base.code) != TYPE_ARGUMENT_PACK && ((enum tree_code) (t2)->base.code) != TYPE_ARGUMENT_PACK ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1685, __FUNCTION__), 0 : 0)) | ||||
1685 | && TREE_CODE (t2) != TYPE_ARGUMENT_PACK)((void)(!(((enum tree_code) (t1)->base.code) != TYPE_ARGUMENT_PACK && ((enum tree_code) (t2)->base.code) != TYPE_ARGUMENT_PACK ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1685, __FUNCTION__), 0 : 0)); | ||||
1686 | |||||
1687 | if (t1 == t2) | ||||
1688 | return true; | ||||
1689 | |||||
1690 | /* Suppress errors caused by previously reported errors. */ | ||||
1691 | if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1692 | return false; | ||||
1693 | |||||
1694 | if (strict == COMPARE_STRICT0) | ||||
1695 | { | ||||
1696 | if (TYPE_STRUCTURAL_EQUALITY_P (t1)(((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1696, __FUNCTION__))->type_common.canonical) == (tree) __null ) || TYPE_STRUCTURAL_EQUALITY_P (t2)(((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1696, __FUNCTION__))->type_common.canonical) == (tree) __null )) | ||||
1697 | /* At least one of the types requires structural equality, so | ||||
1698 | perform a deep check. */ | ||||
1699 | return structural_comptypes (t1, t2, strict); | ||||
1700 | |||||
1701 | if (flag_checkingglobal_options.x_flag_checking && param_use_canonical_typesglobal_options.x_param_use_canonical_types) | ||||
1702 | { | ||||
1703 | bool result = structural_comptypes (t1, t2, strict); | ||||
1704 | |||||
1705 | if (result && TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1705, __FUNCTION__))->type_common.canonical) != TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1705, __FUNCTION__))->type_common.canonical)) | ||||
1706 | /* The two types are structurally equivalent, but their | ||||
1707 | canonical types were different. This is a failure of the | ||||
1708 | canonical type propagation code.*/ | ||||
1709 | internal_error | ||||
1710 | ("canonical types differ for identical types %qT and %qT", | ||||
1711 | t1, t2); | ||||
1712 | else if (!result && TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1712, __FUNCTION__))->type_common.canonical) == TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1712, __FUNCTION__))->type_common.canonical)) | ||||
1713 | /* Two types are structurally different, but the canonical | ||||
1714 | types are the same. This means we were over-eager in | ||||
1715 | assigning canonical types. */ | ||||
1716 | internal_error | ||||
1717 | ("same canonical type node for different types %qT and %qT", | ||||
1718 | t1, t2); | ||||
1719 | |||||
1720 | return result; | ||||
1721 | } | ||||
1722 | if (!flag_checkingglobal_options.x_flag_checking && param_use_canonical_typesglobal_options.x_param_use_canonical_types) | ||||
1723 | return TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1723, __FUNCTION__))->type_common.canonical) == TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1723, __FUNCTION__))->type_common.canonical); | ||||
1724 | else | ||||
1725 | return structural_comptypes (t1, t2, strict); | ||||
1726 | } | ||||
1727 | else if (strict == COMPARE_STRUCTURAL8) | ||||
1728 | return structural_comptypes (t1, t2, COMPARE_STRICT0); | ||||
1729 | else | ||||
1730 | return structural_comptypes (t1, t2, strict); | ||||
1731 | } | ||||
1732 | |||||
1733 | /* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring | ||||
1734 | top-level qualifiers. */ | ||||
1735 | |||||
1736 | bool | ||||
1737 | same_type_ignoring_top_level_qualifiers_p (tree type1, tree type2) | ||||
1738 | { | ||||
1739 | if (type1 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || type2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1740 | return false; | ||||
1741 | if (type1 == type2) | ||||
1742 | return true; | ||||
1743 | |||||
1744 | type1 = cp_build_qualified_type (type1, TYPE_UNQUALIFIED); | ||||
1745 | type2 = cp_build_qualified_type (type2, TYPE_UNQUALIFIED); | ||||
1746 | return same_type_p (type1, type2)comptypes ((type1), (type2), 0); | ||||
1747 | } | ||||
1748 | |||||
1749 | /* Returns nonzero iff TYPE1 and TYPE2 are similar, as per [conv.qual]. */ | ||||
1750 | |||||
1751 | bool | ||||
1752 | similar_type_p (tree type1, tree type2) | ||||
1753 | { | ||||
1754 | if (type1 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || type2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1755 | return false; | ||||
1756 | |||||
1757 | /* Informally, two types are similar if, ignoring top-level cv-qualification: | ||||
1758 | * they are the same type; or | ||||
1759 | * they are both pointers, and the pointed-to types are similar; or | ||||
1760 | * they are both pointers to member of the same class, and the types of | ||||
1761 | the pointed-to members are similar; or | ||||
1762 | * they are both arrays of the same size or both arrays of unknown bound, | ||||
1763 | and the array element types are similar. */ | ||||
1764 | |||||
1765 | if (same_type_ignoring_top_level_qualifiers_p (type1, type2)) | ||||
1766 | return true; | ||||
1767 | |||||
1768 | if ((TYPE_PTR_P (type1)(((enum tree_code) (type1)->base.code) == POINTER_TYPE) && TYPE_PTR_P (type2)(((enum tree_code) (type2)->base.code) == POINTER_TYPE)) | ||||
1769 | || (TYPE_PTRDATAMEM_P (type1)(((enum tree_code) (type1)->base.code) == OFFSET_TYPE) && TYPE_PTRDATAMEM_P (type2)(((enum tree_code) (type2)->base.code) == OFFSET_TYPE)) | ||||
1770 | || (TREE_CODE (type1)((enum tree_code) (type1)->base.code) == ARRAY_TYPE && TREE_CODE (type2)((enum tree_code) (type2)->base.code) == ARRAY_TYPE)) | ||||
1771 | return comp_ptr_ttypes_const (type1, type2, bounds_either); | ||||
1772 | |||||
1773 | return false; | ||||
1774 | } | ||||
1775 | |||||
1776 | /* Helper function for layout_compatible_type_p and | ||||
1777 | is_corresponding_member_aggr. Advance to next members (NULL if | ||||
1778 | no further ones) and return true if those members are still part of | ||||
1779 | the common initial sequence. */ | ||||
1780 | |||||
1781 | bool | ||||
1782 | next_common_initial_sequence (tree &memb1, tree &memb2) | ||||
1783 | { | ||||
1784 | while (memb1) | ||||
1785 | { | ||||
1786 | if (TREE_CODE (memb1)((enum tree_code) (memb1)->base.code) != FIELD_DECL | ||||
1787 | || (DECL_FIELD_IS_BASE (memb1)((contains_struct_check (((tree_check ((memb1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1787, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1787, __FUNCTION__))->decl_common.lang_flag_6) && is_empty_field (memb1))) | ||||
1788 | { | ||||
1789 | memb1 = DECL_CHAIN (memb1)(((contains_struct_check (((contains_struct_check ((memb1), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1789, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1789, __FUNCTION__))->common.chain)); | ||||
1790 | continue; | ||||
1791 | } | ||||
1792 | if (DECL_FIELD_IS_BASE (memb1)((contains_struct_check (((tree_check ((memb1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1792, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1792, __FUNCTION__))->decl_common.lang_flag_6)) | ||||
1793 | { | ||||
1794 | memb1 = TYPE_FIELDS (TREE_TYPE (memb1))((tree_check3 ((((contains_struct_check ((memb1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1794, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1794, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | ||||
1795 | continue; | ||||
1796 | } | ||||
1797 | break; | ||||
1798 | } | ||||
1799 | while (memb2) | ||||
1800 | { | ||||
1801 | if (TREE_CODE (memb2)((enum tree_code) (memb2)->base.code) != FIELD_DECL | ||||
1802 | || (DECL_FIELD_IS_BASE (memb2)((contains_struct_check (((tree_check ((memb2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1802, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1802, __FUNCTION__))->decl_common.lang_flag_6) && is_empty_field (memb2))) | ||||
1803 | { | ||||
1804 | memb2 = DECL_CHAIN (memb2)(((contains_struct_check (((contains_struct_check ((memb2), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1804, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1804, __FUNCTION__))->common.chain)); | ||||
1805 | continue; | ||||
1806 | } | ||||
1807 | if (DECL_FIELD_IS_BASE (memb2)((contains_struct_check (((tree_check ((memb2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1807, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1807, __FUNCTION__))->decl_common.lang_flag_6)) | ||||
1808 | { | ||||
1809 | memb2 = TYPE_FIELDS (TREE_TYPE (memb2))((tree_check3 ((((contains_struct_check ((memb2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1809, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1809, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | ||||
1810 | continue; | ||||
1811 | } | ||||
1812 | break; | ||||
1813 | } | ||||
1814 | if (memb1 == NULL_TREE(tree) __null && memb2 == NULL_TREE(tree) __null) | ||||
1815 | return true; | ||||
1816 | if (memb1 == NULL_TREE(tree) __null || memb2 == NULL_TREE(tree) __null) | ||||
1817 | return false; | ||||
1818 | if (DECL_BIT_FIELD_TYPE (memb1)((tree_check ((memb1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1818, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type )) | ||||
1819 | { | ||||
1820 | if (!DECL_BIT_FIELD_TYPE (memb2)((tree_check ((memb2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1820, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type )) | ||||
1821 | return false; | ||||
1822 | if (!layout_compatible_type_p (DECL_BIT_FIELD_TYPE (memb1)((tree_check ((memb1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1822, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type ), | ||||
1823 | DECL_BIT_FIELD_TYPE (memb2)((tree_check ((memb2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1823, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type ))) | ||||
1824 | return false; | ||||
1825 | if (TYPE_PRECISION (TREE_TYPE (memb1))((tree_class_check ((((contains_struct_check ((memb1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1825, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1825, __FUNCTION__))->type_common.precision) | ||||
1826 | != TYPE_PRECISION (TREE_TYPE (memb2))((tree_class_check ((((contains_struct_check ((memb2), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1826, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1826, __FUNCTION__))->type_common.precision)) | ||||
1827 | return false; | ||||
1828 | } | ||||
1829 | else if (DECL_BIT_FIELD_TYPE (memb2)((tree_check ((memb2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1829, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type )) | ||||
1830 | return false; | ||||
1831 | else if (!layout_compatible_type_p (TREE_TYPE (memb1)((contains_struct_check ((memb1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1831, __FUNCTION__))->typed.type), TREE_TYPE (memb2)((contains_struct_check ((memb2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1831, __FUNCTION__))->typed.type))) | ||||
1832 | return false; | ||||
1833 | if ((!lookup_attribute ("no_unique_address", DECL_ATTRIBUTES (memb1)((contains_struct_check ((memb1), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1833, __FUNCTION__))->decl_common.attributes))) | ||||
1834 | != !lookup_attribute ("no_unique_address", DECL_ATTRIBUTES (memb2)((contains_struct_check ((memb2), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1834, __FUNCTION__))->decl_common.attributes))) | ||||
1835 | return false; | ||||
1836 | if (DECL_ALIGN (memb1)(((contains_struct_check ((memb1), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1836, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((memb1), (TS_DECL_COMMON) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1836, __FUNCTION__))->decl_common.align) - 1) : 0) != DECL_ALIGN (memb2)(((contains_struct_check ((memb2), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1836, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((memb2), (TS_DECL_COMMON) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1836, __FUNCTION__))->decl_common.align) - 1) : 0)) | ||||
1837 | return false; | ||||
1838 | if (!tree_int_cst_equal (bit_position (memb1), bit_position (memb2))) | ||||
1839 | return false; | ||||
1840 | return true; | ||||
1841 | } | ||||
1842 | |||||
1843 | /* Return true if TYPE1 and TYPE2 are layout-compatible types. */ | ||||
1844 | |||||
1845 | bool | ||||
1846 | layout_compatible_type_p (tree type1, tree type2) | ||||
1847 | { | ||||
1848 | if (type1 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || type2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1849 | return false; | ||||
1850 | if (type1 == type2) | ||||
1851 | return true; | ||||
1852 | if (TREE_CODE (type1)((enum tree_code) (type1)->base.code) != TREE_CODE (type2)((enum tree_code) (type2)->base.code)) | ||||
1853 | return false; | ||||
1854 | |||||
1855 | type1 = cp_build_qualified_type (type1, TYPE_UNQUALIFIED); | ||||
1856 | type2 = cp_build_qualified_type (type2, TYPE_UNQUALIFIED); | ||||
1857 | |||||
1858 | if (TREE_CODE (type1)((enum tree_code) (type1)->base.code) == ENUMERAL_TYPE) | ||||
1859 | return (tree_int_cst_equal (TYPE_SIZE (type1)((tree_class_check ((type1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1859, __FUNCTION__))->type_common.size), TYPE_SIZE (type2)((tree_class_check ((type2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1859, __FUNCTION__))->type_common.size)) | ||||
1860 | && same_type_p (finish_underlying_type (type1),comptypes ((finish_underlying_type (type1)), (finish_underlying_type (type2)), 0) | ||||
1861 | finish_underlying_type (type2))comptypes ((finish_underlying_type (type1)), (finish_underlying_type (type2)), 0)); | ||||
1862 | |||||
1863 | if (CLASS_TYPE_P (type1)(((((enum tree_code) (type1)->base.code)) == RECORD_TYPE || (((enum tree_code) (type1)->base.code)) == UNION_TYPE) && ((tree_class_check ((type1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1863, __FUNCTION__))->type_common.lang_flag_5)) | ||||
1864 | && std_layout_type_p (type1) | ||||
1865 | && std_layout_type_p (type2) | ||||
1866 | && tree_int_cst_equal (TYPE_SIZE (type1)((tree_class_check ((type1), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1866, __FUNCTION__))->type_common.size), TYPE_SIZE (type2)((tree_class_check ((type2), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1866, __FUNCTION__))->type_common.size))) | ||||
1867 | { | ||||
1868 | tree field1 = TYPE_FIELDS (type1)((tree_check3 ((type1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1868, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | ||||
1869 | tree field2 = TYPE_FIELDS (type2)((tree_check3 ((type2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1869, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | ||||
1870 | if (TREE_CODE (type1)((enum tree_code) (type1)->base.code) == RECORD_TYPE) | ||||
1871 | { | ||||
1872 | while (1) | ||||
1873 | { | ||||
1874 | if (!next_common_initial_sequence (field1, field2)) | ||||
1875 | return false; | ||||
1876 | if (field1 == NULL_TREE(tree) __null) | ||||
1877 | return true; | ||||
1878 | field1 = DECL_CHAIN (field1)(((contains_struct_check (((contains_struct_check ((field1), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1878, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1878, __FUNCTION__))->common.chain)); | ||||
1879 | field2 = DECL_CHAIN (field2)(((contains_struct_check (((contains_struct_check ((field2), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1879, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1879, __FUNCTION__))->common.chain)); | ||||
1880 | } | ||||
1881 | } | ||||
1882 | /* Otherwise both types must be union types. | ||||
1883 | The standard says: | ||||
1884 | "Two standard-layout unions are layout-compatible if they have | ||||
1885 | the same number of non-static data members and corresponding | ||||
1886 | non-static data members (in any order) have layout-compatible | ||||
1887 | types." | ||||
1888 | but the code anticipates that bitfield vs. non-bitfield, | ||||
1889 | different bitfield widths or presence/absence of | ||||
1890 | [[no_unique_address]] should be checked as well. */ | ||||
1891 | auto_vec<tree, 16> vec; | ||||
1892 | unsigned int count = 0; | ||||
1893 | for (; field1; field1 = DECL_CHAIN (field1)(((contains_struct_check (((contains_struct_check ((field1), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1893, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1893, __FUNCTION__))->common.chain))) | ||||
1894 | if (TREE_CODE (field1)((enum tree_code) (field1)->base.code) == FIELD_DECL) | ||||
1895 | count++; | ||||
1896 | for (; field2; field2 = DECL_CHAIN (field2)(((contains_struct_check (((contains_struct_check ((field2), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1896, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1896, __FUNCTION__))->common.chain))) | ||||
1897 | if (TREE_CODE (field2)((enum tree_code) (field2)->base.code) == FIELD_DECL) | ||||
1898 | vec.safe_push (field2); | ||||
1899 | /* Discussions on core lean towards treating multiple union fields | ||||
1900 | of the same type as the same field, so this might need changing | ||||
1901 | in the future. */ | ||||
1902 | if (count != vec.length ()) | ||||
1903 | return false; | ||||
1904 | for (field1 = TYPE_FIELDS (type1)((tree_check3 ((type1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1904, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); field1; field1 = DECL_CHAIN (field1)(((contains_struct_check (((contains_struct_check ((field1), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1904, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1904, __FUNCTION__))->common.chain))) | ||||
1905 | { | ||||
1906 | if (TREE_CODE (field1)((enum tree_code) (field1)->base.code) != FIELD_DECL) | ||||
1907 | continue; | ||||
1908 | unsigned int j; | ||||
1909 | tree t1 = DECL_BIT_FIELD_TYPE (field1)((tree_check ((field1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1909, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type ); | ||||
1910 | if (t1 == NULL_TREE(tree) __null) | ||||
1911 | t1 = TREE_TYPE (field1)((contains_struct_check ((field1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1911, __FUNCTION__))->typed.type); | ||||
1912 | FOR_EACH_VEC_ELT (vec, j, field2)for (j = 0; (vec).iterate ((j), &(field2)); ++(j)) | ||||
1913 | { | ||||
1914 | tree t2 = DECL_BIT_FIELD_TYPE (field2)((tree_check ((field2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1914, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type ); | ||||
1915 | if (t2 == NULL_TREE(tree) __null) | ||||
1916 | t2 = TREE_TYPE (field2)((contains_struct_check ((field2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1916, __FUNCTION__))->typed.type); | ||||
1917 | if (DECL_BIT_FIELD_TYPE (field1)((tree_check ((field1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1917, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type )) | ||||
1918 | { | ||||
1919 | if (!DECL_BIT_FIELD_TYPE (field2)((tree_check ((field2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1919, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type )) | ||||
1920 | continue; | ||||
1921 | if (TYPE_PRECISION (TREE_TYPE (field1))((tree_class_check ((((contains_struct_check ((field1), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1921, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1921, __FUNCTION__))->type_common.precision) | ||||
1922 | != TYPE_PRECISION (TREE_TYPE (field2))((tree_class_check ((((contains_struct_check ((field2), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1922, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1922, __FUNCTION__))->type_common.precision)) | ||||
1923 | continue; | ||||
1924 | } | ||||
1925 | else if (DECL_BIT_FIELD_TYPE (field2)((tree_check ((field2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1925, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type )) | ||||
1926 | continue; | ||||
1927 | if (!layout_compatible_type_p (t1, t2)) | ||||
1928 | continue; | ||||
1929 | if ((!lookup_attribute ("no_unique_address", | ||||
1930 | DECL_ATTRIBUTES (field1)((contains_struct_check ((field1), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1930, __FUNCTION__))->decl_common.attributes))) | ||||
1931 | != !lookup_attribute ("no_unique_address", | ||||
1932 | DECL_ATTRIBUTES (field2)((contains_struct_check ((field2), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 1932, __FUNCTION__))->decl_common.attributes))) | ||||
1933 | continue; | ||||
1934 | break; | ||||
1935 | } | ||||
1936 | if (j == vec.length ()) | ||||
1937 | return false; | ||||
1938 | vec.unordered_remove (j); | ||||
1939 | } | ||||
1940 | return true; | ||||
1941 | } | ||||
1942 | |||||
1943 | return same_type_p (type1, type2)comptypes ((type1), (type2), 0); | ||||
1944 | } | ||||
1945 | |||||
1946 | /* Returns 1 if TYPE1 is at least as qualified as TYPE2. */ | ||||
1947 | |||||
1948 | bool | ||||
1949 | at_least_as_qualified_p (const_tree type1, const_tree type2) | ||||
1950 | { | ||||
1951 | int q1 = cp_type_quals (type1); | ||||
1952 | int q2 = cp_type_quals (type2); | ||||
1953 | |||||
1954 | /* All qualifiers for TYPE2 must also appear in TYPE1. */ | ||||
1955 | return (q1 & q2) == q2; | ||||
1956 | } | ||||
1957 | |||||
1958 | /* Returns 1 if TYPE1 is more cv-qualified than TYPE2, -1 if TYPE2 is | ||||
1959 | more cv-qualified that TYPE1, and 0 otherwise. */ | ||||
1960 | |||||
1961 | int | ||||
1962 | comp_cv_qualification (int q1, int q2) | ||||
1963 | { | ||||
1964 | if (q1 == q2) | ||||
1965 | return 0; | ||||
1966 | |||||
1967 | if ((q1 & q2) == q2) | ||||
1968 | return 1; | ||||
1969 | else if ((q1 & q2) == q1) | ||||
1970 | return -1; | ||||
1971 | |||||
1972 | return 0; | ||||
1973 | } | ||||
1974 | |||||
1975 | int | ||||
1976 | comp_cv_qualification (const_tree type1, const_tree type2) | ||||
1977 | { | ||||
1978 | int q1 = cp_type_quals (type1); | ||||
1979 | int q2 = cp_type_quals (type2); | ||||
1980 | return comp_cv_qualification (q1, q2); | ||||
1981 | } | ||||
1982 | |||||
1983 | /* Returns 1 if the cv-qualification signature of TYPE1 is a proper | ||||
1984 | subset of the cv-qualification signature of TYPE2, and the types | ||||
1985 | are similar. Returns -1 if the other way 'round, and 0 otherwise. */ | ||||
1986 | |||||
1987 | int | ||||
1988 | comp_cv_qual_signature (tree type1, tree type2) | ||||
1989 | { | ||||
1990 | if (comp_ptr_ttypes_real (type2, type1, -1)) | ||||
1991 | return 1; | ||||
1992 | else if (comp_ptr_ttypes_real (type1, type2, -1)) | ||||
1993 | return -1; | ||||
1994 | else | ||||
1995 | return 0; | ||||
1996 | } | ||||
1997 | |||||
1998 | /* Subroutines of `comptypes'. */ | ||||
1999 | |||||
2000 | /* Return true if two parameter type lists PARMS1 and PARMS2 are | ||||
2001 | equivalent in the sense that functions with those parameter types | ||||
2002 | can have equivalent types. The two lists must be equivalent, | ||||
2003 | element by element. */ | ||||
2004 | |||||
2005 | bool | ||||
2006 | compparms (const_tree parms1, const_tree parms2) | ||||
2007 | { | ||||
2008 | const_tree t1, t2; | ||||
2009 | |||||
2010 | /* An unspecified parmlist matches any specified parmlist | ||||
2011 | whose argument types don't need default promotions. */ | ||||
2012 | |||||
2013 | for (t1 = parms1, t2 = parms2; | ||||
2014 | t1 || t2; | ||||
2015 | t1 = TREE_CHAIN (t1)((contains_struct_check ((t1), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2015, __FUNCTION__))->common.chain), t2 = TREE_CHAIN (t2)((contains_struct_check ((t2), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2015, __FUNCTION__))->common.chain)) | ||||
2016 | { | ||||
2017 | /* If one parmlist is shorter than the other, | ||||
2018 | they fail to match. */ | ||||
2019 | if (!t1 || !t2) | ||||
2020 | return false; | ||||
2021 | if (!same_type_p (TREE_VALUE (t1), TREE_VALUE (t2))comptypes ((((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2021, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2021, __FUNCTION__, (TREE_LIST)))->list.value)), 0)) | ||||
2022 | return false; | ||||
2023 | } | ||||
2024 | return true; | ||||
2025 | } | ||||
2026 | |||||
2027 | |||||
2028 | /* Process a sizeof or alignof expression where the operand is a type. | ||||
2029 | STD_ALIGNOF indicates whether an alignof has C++11 (minimum alignment) | ||||
2030 | or GNU (preferred alignment) semantics; it is ignored if OP is | ||||
2031 | SIZEOF_EXPR. */ | ||||
2032 | |||||
2033 | tree | ||||
2034 | cxx_sizeof_or_alignof_type (location_t loc, tree type, enum tree_code op, | ||||
2035 | bool std_alignof, bool complain) | ||||
2036 | { | ||||
2037 | gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR)((void)(!(op == SIZEOF_EXPR || op == ALIGNOF_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2037, __FUNCTION__), 0 : 0)); | ||||
2038 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2039 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2040 | |||||
2041 | type = non_reference (type); | ||||
2042 | if (TREE_CODE (type)((enum tree_code) (type)->base.code) == METHOD_TYPE) | ||||
2043 | { | ||||
2044 | if (complain) | ||||
2045 | { | ||||
2046 | pedwarn (loc, OPT_Wpointer_arith, | ||||
2047 | "invalid application of %qs to a member function", | ||||
2048 | OVL_OP_INFO (false, op)(&ovl_op_info[(false) != 0][ovl_op_mapping[(op)]])->name); | ||||
2049 | return size_one_nodeglobal_trees[TI_SIZE_ONE]; | ||||
2050 | } | ||||
2051 | else | ||||
2052 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2053 | } | ||||
2054 | else if (VOID_TYPE_P (type)(((enum tree_code) (type)->base.code) == VOID_TYPE) && std_alignof) | ||||
2055 | { | ||||
2056 | if (complain) | ||||
2057 | error_at (loc, "invalid application of %qs to a void type", | ||||
2058 | OVL_OP_INFO (false, op)(&ovl_op_info[(false) != 0][ovl_op_mapping[(op)]])->name); | ||||
2059 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2060 | } | ||||
2061 | |||||
2062 | bool dependent_p = dependent_type_p (type); | ||||
2063 | if (!dependent_p) | ||||
2064 | complete_type (type); | ||||
2065 | if (dependent_p | ||||
2066 | /* VLA types will have a non-constant size. In the body of an | ||||
2067 | uninstantiated template, we don't need to try to compute the | ||||
2068 | value, because the sizeof expression is not an integral | ||||
2069 | constant expression in that case. And, if we do try to | ||||
2070 | compute the value, we'll likely end up with SAVE_EXPRs, which | ||||
2071 | the template substitution machinery does not expect to see. */ | ||||
2072 | || (processing_template_declscope_chain->x_processing_template_decl | ||||
2073 | && COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2073, __FUNCTION__))->type_common.size) != (tree) __null ) | ||||
2074 | && TREE_CODE (TYPE_SIZE (type))((enum tree_code) (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2074, __FUNCTION__))->type_common.size))->base.code) != INTEGER_CST)) | ||||
2075 | { | ||||
2076 | tree value = build_min (op, size_type_nodeglobal_trees[TI_SIZE_TYPE], type); | ||||
2077 | TREE_READONLY (value)((non_type_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2077, __FUNCTION__))->base.readonly_flag) = 1; | ||||
2078 | if (op == ALIGNOF_EXPR && std_alignof) | ||||
2079 | ALIGNOF_EXPR_STD_P (value)((tree_not_check2 (((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2079, __FUNCTION__, (ALIGNOF_EXPR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2079, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = true; | ||||
2080 | SET_EXPR_LOCATION (value, loc)(expr_check (((value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2080, __FUNCTION__))->exp.locus = (loc); | ||||
2081 | return value; | ||||
2082 | } | ||||
2083 | |||||
2084 | return c_sizeof_or_alignof_type (loc, complete_type (type), | ||||
2085 | op == SIZEOF_EXPR, std_alignof, | ||||
2086 | complain); | ||||
2087 | } | ||||
2088 | |||||
2089 | /* Return the size of the type, without producing any warnings for | ||||
2090 | types whose size cannot be taken. This routine should be used only | ||||
2091 | in some other routine that has already produced a diagnostic about | ||||
2092 | using the size of such a type. */ | ||||
2093 | tree | ||||
2094 | cxx_sizeof_nowarn (tree type) | ||||
2095 | { | ||||
2096 | if (TREE_CODE (type)((enum tree_code) (type)->base.code) == FUNCTION_TYPE | ||||
2097 | || VOID_TYPE_P (type)(((enum tree_code) (type)->base.code) == VOID_TYPE) | ||||
2098 | || TREE_CODE (type)((enum tree_code) (type)->base.code) == ERROR_MARK) | ||||
2099 | return size_one_nodeglobal_trees[TI_SIZE_ONE]; | ||||
2100 | else if (!COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2100, __FUNCTION__))->type_common.size) != (tree) __null )) | ||||
2101 | return size_zero_nodeglobal_trees[TI_SIZE_ZERO]; | ||||
2102 | else | ||||
2103 | return cxx_sizeof_or_alignof_type (input_location, type, | ||||
2104 | SIZEOF_EXPR, false, false); | ||||
2105 | } | ||||
2106 | |||||
2107 | /* Process a sizeof expression where the operand is an expression. */ | ||||
2108 | |||||
2109 | static tree | ||||
2110 | cxx_sizeof_expr (location_t loc, tree e, tsubst_flags_t complain) | ||||
2111 | { | ||||
2112 | if (e == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2113 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2114 | |||||
2115 | if (instantiation_dependent_uneval_expression_p (e)) | ||||
2116 | { | ||||
2117 | e = build_min (SIZEOF_EXPR, size_type_nodeglobal_trees[TI_SIZE_TYPE], e); | ||||
2118 | TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2118, __FUNCTION__))->base.side_effects_flag) = 0; | ||||
2119 | TREE_READONLY (e)((non_type_check ((e), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2119, __FUNCTION__))->base.readonly_flag) = 1; | ||||
2120 | SET_EXPR_LOCATION (e, loc)(expr_check (((e)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2120, __FUNCTION__))->exp.locus = (loc); | ||||
2121 | |||||
2122 | return e; | ||||
2123 | } | ||||
2124 | |||||
2125 | location_t e_loc = cp_expr_loc_or_loc (e, loc); | ||||
2126 | STRIP_ANY_LOCATION_WRAPPER (e)(e) = tree_strip_any_location_wrapper ((const_cast<union tree_node *> (((e))))); | ||||
2127 | |||||
2128 | /* To get the size of a static data member declared as an array of | ||||
2129 | unknown bound, we need to instantiate it. */ | ||||
2130 | if (VAR_P (e)(((enum tree_code) (e)->base.code) == VAR_DECL) | ||||
2131 | && VAR_HAD_UNKNOWN_BOUND (e)(((contains_struct_check (((tree_check ((e), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2131, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2131, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check ((e), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2131, __FUNCTION__))->decl_common.lang_specific)->u.base .unknown_bound_p : false) | ||||
2132 | && DECL_TEMPLATE_INSTANTIATION (e)((((contains_struct_check ((e), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2132, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) & 1)) | ||||
2133 | instantiate_decl (e, /*defer_ok*/true, /*expl_inst_mem*/false); | ||||
2134 | |||||
2135 | if (TREE_CODE (e)((enum tree_code) (e)->base.code) == PARM_DECL | ||||
2136 | && DECL_ARRAY_PARAMETER_P (e)((contains_struct_check (((tree_check ((e), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2136, __FUNCTION__, (PARM_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2136, __FUNCTION__))->decl_common.lang_flag_1) | ||||
2137 | && (complain & tf_warning)) | ||||
2138 | { | ||||
2139 | auto_diagnostic_group d; | ||||
2140 | if (warning_at (e_loc, OPT_Wsizeof_array_argument, | ||||
2141 | "%<sizeof%> on array function parameter %qE " | ||||
2142 | "will return size of %qT", e, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2142, __FUNCTION__))->typed.type))) | ||||
2143 | inform (DECL_SOURCE_LOCATION (e)((contains_struct_check ((e), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2143, __FUNCTION__))->decl_minimal.locus), "declared here"); | ||||
2144 | } | ||||
2145 | |||||
2146 | e = mark_type_use (e); | ||||
2147 | |||||
2148 | if (bitfield_p (e)) | ||||
2149 | { | ||||
2150 | if (complain & tf_error) | ||||
2151 | error_at (e_loc, | ||||
2152 | "invalid application of %<sizeof%> to a bit-field"); | ||||
2153 | else | ||||
2154 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2155 | e = char_type_nodeinteger_types[itk_char]; | ||||
2156 | } | ||||
2157 | else if (is_overloaded_fn (e)) | ||||
2158 | { | ||||
2159 | if (complain & tf_error) | ||||
2160 | permerror (e_loc, "ISO C++ forbids applying %<sizeof%> to " | ||||
2161 | "an expression of function type"); | ||||
2162 | else | ||||
2163 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2164 | e = char_type_nodeinteger_types[itk_char]; | ||||
2165 | } | ||||
2166 | else if (type_unknown_p (e)) | ||||
2167 | { | ||||
2168 | if (complain & tf_error) | ||||
2169 | cxx_incomplete_type_error (e_loc, e, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2169, __FUNCTION__))->typed.type)); | ||||
2170 | else | ||||
2171 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2172 | e = char_type_nodeinteger_types[itk_char]; | ||||
2173 | } | ||||
2174 | else | ||||
2175 | e = TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2175, __FUNCTION__))->typed.type); | ||||
2176 | |||||
2177 | return cxx_sizeof_or_alignof_type (loc, e, SIZEOF_EXPR, false, | ||||
2178 | complain & tf_error); | ||||
2179 | } | ||||
2180 | |||||
2181 | /* Implement the __alignof keyword: Return the minimum required | ||||
2182 | alignment of E, measured in bytes. For VAR_DECL's and | ||||
2183 | FIELD_DECL's return DECL_ALIGN (which can be set from an | ||||
2184 | "aligned" __attribute__ specification). STD_ALIGNOF acts | ||||
2185 | like in cxx_sizeof_or_alignof_type. */ | ||||
2186 | |||||
2187 | static tree | ||||
2188 | cxx_alignof_expr (location_t loc, tree e, bool std_alignof, | ||||
2189 | tsubst_flags_t complain) | ||||
2190 | { | ||||
2191 | tree t; | ||||
2192 | |||||
2193 | if (e == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2194 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2195 | |||||
2196 | if (processing_template_declscope_chain->x_processing_template_decl) | ||||
2197 | { | ||||
2198 | e = build_min (ALIGNOF_EXPR, size_type_nodeglobal_trees[TI_SIZE_TYPE], e); | ||||
2199 | TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2199, __FUNCTION__))->base.side_effects_flag) = 0; | ||||
2200 | TREE_READONLY (e)((non_type_check ((e), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2200, __FUNCTION__))->base.readonly_flag) = 1; | ||||
2201 | SET_EXPR_LOCATION (e, loc)(expr_check (((e)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2201, __FUNCTION__))->exp.locus = (loc); | ||||
2202 | ALIGNOF_EXPR_STD_P (e)((tree_not_check2 (((tree_check ((e), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2202, __FUNCTION__, (ALIGNOF_EXPR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2202, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = std_alignof; | ||||
2203 | |||||
2204 | return e; | ||||
2205 | } | ||||
2206 | |||||
2207 | location_t e_loc = cp_expr_loc_or_loc (e, loc); | ||||
2208 | STRIP_ANY_LOCATION_WRAPPER (e)(e) = tree_strip_any_location_wrapper ((const_cast<union tree_node *> (((e))))); | ||||
2209 | |||||
2210 | e = mark_type_use (e); | ||||
2211 | |||||
2212 | if (!verify_type_context (loc, TCTX_ALIGNOF, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2212, __FUNCTION__))->typed.type), | ||||
2213 | !(complain & tf_error))) | ||||
2214 | { | ||||
2215 | if (!(complain & tf_error)) | ||||
2216 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2217 | t = size_one_nodeglobal_trees[TI_SIZE_ONE]; | ||||
2218 | } | ||||
2219 | else if (VAR_P (e)(((enum tree_code) (e)->base.code) == VAR_DECL)) | ||||
2220 | t = size_int (DECL_ALIGN_UNIT (e))size_int_kind (((((contains_struct_check ((e), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2220, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((e), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2220, __FUNCTION__))->decl_common.align) - 1) : 0) / (8) ), stk_sizetype); | ||||
2221 | else if (bitfield_p (e)) | ||||
2222 | { | ||||
2223 | if (complain & tf_error) | ||||
2224 | error_at (e_loc, | ||||
2225 | "invalid application of %<__alignof%> to a bit-field"); | ||||
2226 | else | ||||
2227 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2228 | t = size_one_nodeglobal_trees[TI_SIZE_ONE]; | ||||
2229 | } | ||||
2230 | else if (TREE_CODE (e)((enum tree_code) (e)->base.code) == COMPONENT_REF | ||||
2231 | && TREE_CODE (TREE_OPERAND (e, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check ((e), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2231, __FUNCTION__))))))->base.code) == FIELD_DECL) | ||||
2232 | t = size_int (DECL_ALIGN_UNIT (TREE_OPERAND (e, 1)))size_int_kind (((((contains_struct_check (((*((const_cast< tree*> (tree_operand_check ((e), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2232, __FUNCTION__)))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2232, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check (((*((const_cast<tree*> (tree_operand_check ((e), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2232, __FUNCTION__)))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2232, __FUNCTION__))->decl_common.align) - 1) : 0) / (8) ), stk_sizetype); | ||||
2233 | else if (is_overloaded_fn (e)) | ||||
2234 | { | ||||
2235 | if (complain & tf_error) | ||||
2236 | permerror (e_loc, "ISO C++ forbids applying %<__alignof%> to " | ||||
2237 | "an expression of function type"); | ||||
2238 | else | ||||
2239 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2240 | if (TREE_CODE (e)((enum tree_code) (e)->base.code) == FUNCTION_DECL) | ||||
2241 | t = size_int (DECL_ALIGN_UNIT (e))size_int_kind (((((contains_struct_check ((e), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2241, __FUNCTION__))->decl_common.align) ? ((unsigned)1) << (((contains_struct_check ((e), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2241, __FUNCTION__))->decl_common.align) - 1) : 0) / (8) ), stk_sizetype); | ||||
2242 | else | ||||
2243 | t = size_one_nodeglobal_trees[TI_SIZE_ONE]; | ||||
2244 | } | ||||
2245 | else if (type_unknown_p (e)) | ||||
2246 | { | ||||
2247 | if (complain & tf_error) | ||||
2248 | cxx_incomplete_type_error (e_loc, e, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2248, __FUNCTION__))->typed.type)); | ||||
2249 | else | ||||
2250 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2251 | t = size_one_nodeglobal_trees[TI_SIZE_ONE]; | ||||
2252 | } | ||||
2253 | else | ||||
2254 | return cxx_sizeof_or_alignof_type (loc, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2254, __FUNCTION__))->typed.type), | ||||
2255 | ALIGNOF_EXPR, std_alignof, | ||||
2256 | complain & tf_error); | ||||
2257 | |||||
2258 | return fold_convert_loc (loc, size_type_nodeglobal_trees[TI_SIZE_TYPE], t); | ||||
2259 | } | ||||
2260 | |||||
2261 | /* Process a sizeof or alignof expression E with code OP where the operand | ||||
2262 | is an expression. STD_ALIGNOF acts like in cxx_sizeof_or_alignof_type. */ | ||||
2263 | |||||
2264 | tree | ||||
2265 | cxx_sizeof_or_alignof_expr (location_t loc, tree e, enum tree_code op, | ||||
2266 | bool std_alignof, bool complain) | ||||
2267 | { | ||||
2268 | gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR)((void)(!(op == SIZEOF_EXPR || op == ALIGNOF_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2268, __FUNCTION__), 0 : 0)); | ||||
2269 | if (op == SIZEOF_EXPR) | ||||
2270 | return cxx_sizeof_expr (loc, e, complain? tf_warning_or_error : tf_none); | ||||
2271 | else | ||||
2272 | return cxx_alignof_expr (loc, e, std_alignof, | ||||
2273 | complain? tf_warning_or_error : tf_none); | ||||
2274 | } | ||||
2275 | |||||
2276 | /* Build a representation of an expression 'alignas(E).' Return the | ||||
2277 | folded integer value of E if it is an integral constant expression | ||||
2278 | that resolves to a valid alignment. If E depends on a template | ||||
2279 | parameter, return a syntactic representation tree of kind | ||||
2280 | ALIGNOF_EXPR. Otherwise, return an error_mark_node if the | ||||
2281 | expression is ill formed, or NULL_TREE if E is NULL_TREE. */ | ||||
2282 | |||||
2283 | tree | ||||
2284 | cxx_alignas_expr (tree e) | ||||
2285 | { | ||||
2286 | if (e == NULL_TREE(tree) __null || e == error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
2287 | || (!TYPE_P (e)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (e)->base.code))] == tcc_type) && !require_potential_rvalue_constant_expression (e))) | ||||
2288 | return e; | ||||
2289 | |||||
2290 | if (TYPE_P (e)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (e)->base.code))] == tcc_type)) | ||||
2291 | /* [dcl.align]/3: | ||||
2292 | |||||
2293 | When the alignment-specifier is of the form | ||||
2294 | alignas(type-id), it shall have the same effect as | ||||
2295 | alignas(alignof(type-id)). */ | ||||
2296 | |||||
2297 | return cxx_sizeof_or_alignof_type (input_location, | ||||
2298 | e, ALIGNOF_EXPR, | ||||
2299 | /*std_alignof=*/true, | ||||
2300 | /*complain=*/true); | ||||
2301 | |||||
2302 | /* If we reach this point, it means the alignas expression if of | ||||
2303 | the form "alignas(assignment-expression)", so we should follow | ||||
2304 | what is stated by [dcl.align]/2. */ | ||||
2305 | |||||
2306 | if (value_dependent_expression_p (e)) | ||||
2307 | /* Leave value-dependent expression alone for now. */ | ||||
2308 | return e; | ||||
2309 | |||||
2310 | e = instantiate_non_dependent_expr (e); | ||||
2311 | e = mark_rvalue_use (e); | ||||
2312 | |||||
2313 | /* [dcl.align]/2 says: | ||||
2314 | |||||
2315 | the assignment-expression shall be an integral constant | ||||
2316 | expression. */ | ||||
2317 | |||||
2318 | if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (e))((((enum tree_code) (((contains_struct_check ((e), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2318, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE && !((tree_check ((((contains_struct_check ((e), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2318, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2318, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag) ) || (((enum tree_code) (((contains_struct_check ((e), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2318, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((e), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2318, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ))) | ||||
2319 | { | ||||
2320 | error ("%<alignas%> argument has non-integral type %qT", TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2320, __FUNCTION__))->typed.type)); | ||||
2321 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2322 | } | ||||
2323 | |||||
2324 | return cxx_constant_value (e); | ||||
2325 | } | ||||
2326 | |||||
2327 | |||||
2328 | /* EXPR is being used in a context that is not a function call. | ||||
2329 | Enforce: | ||||
2330 | |||||
2331 | [expr.ref] | ||||
2332 | |||||
2333 | The expression can be used only as the left-hand operand of a | ||||
2334 | member function call. | ||||
2335 | |||||
2336 | [expr.mptr.operator] | ||||
2337 | |||||
2338 | If the result of .* or ->* is a function, then that result can be | ||||
2339 | used only as the operand for the function call operator (). | ||||
2340 | |||||
2341 | by issuing an error message if appropriate. Returns true iff EXPR | ||||
2342 | violates these rules. */ | ||||
2343 | |||||
2344 | bool | ||||
2345 | invalid_nonstatic_memfn_p (location_t loc, tree expr, tsubst_flags_t complain) | ||||
2346 | { | ||||
2347 | if (expr == NULL_TREE(tree) __null) | ||||
2348 | return false; | ||||
2349 | /* Don't enforce this in MS mode. */ | ||||
2350 | if (flag_ms_extensionsglobal_options.x_flag_ms_extensions) | ||||
2351 | return false; | ||||
2352 | if (is_overloaded_fn (expr) && !really_overloaded_fn (expr)) | ||||
2353 | expr = get_first_fn (expr); | ||||
2354 | if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2354, __FUNCTION__))->typed.type) | ||||
2355 | && DECL_NONSTATIC_MEMBER_FUNCTION_P (expr)(((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2355, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) | ||||
2356 | { | ||||
2357 | if (complain & tf_error) | ||||
2358 | { | ||||
2359 | if (DECL_P (expr)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (expr)->base.code))] == tcc_declaration)) | ||||
2360 | { | ||||
2361 | error_at (loc, "invalid use of non-static member function %qD", | ||||
2362 | expr); | ||||
2363 | inform (DECL_SOURCE_LOCATION (expr)((contains_struct_check ((expr), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2363, __FUNCTION__))->decl_minimal.locus), "declared here"); | ||||
2364 | } | ||||
2365 | else | ||||
2366 | error_at (loc, "invalid use of non-static member function of " | ||||
2367 | "type %qT", TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2367, __FUNCTION__))->typed.type)); | ||||
2368 | } | ||||
2369 | return true; | ||||
2370 | } | ||||
2371 | return false; | ||||
2372 | } | ||||
2373 | |||||
2374 | /* If EXP is a reference to a bit-field, and the type of EXP does not | ||||
2375 | match the declared type of the bit-field, return the declared type | ||||
2376 | of the bit-field. Otherwise, return NULL_TREE. */ | ||||
2377 | |||||
2378 | tree | ||||
2379 | is_bitfield_expr_with_lowered_type (const_tree exp) | ||||
2380 | { | ||||
2381 | switch (TREE_CODE (exp)((enum tree_code) (exp)->base.code)) | ||||
2382 | { | ||||
2383 | case COND_EXPR: | ||||
2384 | if (!is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2384, __FUNCTION__))))) | ||||
2385 | ? TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2385, __FUNCTION__))))) | ||||
2386 | : TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2386, __FUNCTION__))))))) | ||||
2387 | return NULL_TREE(tree) __null; | ||||
2388 | return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 2)(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2388, __FUNCTION__)))))); | ||||
2389 | |||||
2390 | case COMPOUND_EXPR: | ||||
2391 | return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2391, __FUNCTION__)))))); | ||||
2392 | |||||
2393 | case MODIFY_EXPR: | ||||
2394 | case SAVE_EXPR: | ||||
2395 | case UNARY_PLUS_EXPR: | ||||
2396 | case PREDECREMENT_EXPR: | ||||
2397 | case PREINCREMENT_EXPR: | ||||
2398 | case POSTDECREMENT_EXPR: | ||||
2399 | case POSTINCREMENT_EXPR: | ||||
2400 | case NEGATE_EXPR: | ||||
2401 | case NON_LVALUE_EXPR: | ||||
2402 | case BIT_NOT_EXPR: | ||||
2403 | return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2403, __FUNCTION__)))))); | ||||
2404 | |||||
2405 | case COMPONENT_REF: | ||||
2406 | { | ||||
2407 | tree field; | ||||
2408 | |||||
2409 | field = TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2409, __FUNCTION__))))); | ||||
2410 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL || !DECL_BIT_FIELD_TYPE (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2410, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type )) | ||||
2411 | return NULL_TREE(tree) __null; | ||||
2412 | if (same_type_ignoring_top_level_qualifiers_p | ||||
2413 | (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2413, __FUNCTION__))->typed.type), DECL_BIT_FIELD_TYPE (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2413, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type ))) | ||||
2414 | return NULL_TREE(tree) __null; | ||||
2415 | return DECL_BIT_FIELD_TYPE (field)((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2415, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type ); | ||||
2416 | } | ||||
2417 | |||||
2418 | case VAR_DECL: | ||||
2419 | if (DECL_HAS_VALUE_EXPR_P (exp)((tree_check3 ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2419, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL)) ) ->decl_common.decl_flag_2)) | ||||
2420 | return is_bitfield_expr_with_lowered_type (DECL_VALUE_EXPR(decl_value_expr_lookup ((contains_struct_check (((const_cast <union tree_node *> (((exp))))), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2421, __FUNCTION__)))) | ||||
2421 | (CONST_CAST_TREE (exp))(decl_value_expr_lookup ((contains_struct_check (((const_cast <union tree_node *> (((exp))))), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2421, __FUNCTION__))))); | ||||
2422 | return NULL_TREE(tree) __null; | ||||
2423 | |||||
2424 | case VIEW_CONVERT_EXPR: | ||||
2425 | if (location_wrapper_p (exp)) | ||||
2426 | return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2426, __FUNCTION__)))))); | ||||
2427 | else | ||||
2428 | return NULL_TREE(tree) __null; | ||||
2429 | |||||
2430 | default: | ||||
2431 | return NULL_TREE(tree) __null; | ||||
2432 | } | ||||
2433 | } | ||||
2434 | |||||
2435 | /* Like is_bitfield_with_lowered_type, except that if EXP is not a | ||||
2436 | bitfield with a lowered type, the type of EXP is returned, rather | ||||
2437 | than NULL_TREE. */ | ||||
2438 | |||||
2439 | tree | ||||
2440 | unlowered_expr_type (const_tree exp) | ||||
2441 | { | ||||
2442 | tree type; | ||||
2443 | tree etype = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2443, __FUNCTION__))->typed.type); | ||||
2444 | |||||
2445 | type = is_bitfield_expr_with_lowered_type (exp); | ||||
2446 | if (type) | ||||
2447 | type = cp_build_qualified_type (type, cp_type_quals (etype)); | ||||
2448 | else | ||||
2449 | type = etype; | ||||
2450 | |||||
2451 | return type; | ||||
2452 | } | ||||
2453 | |||||
2454 | /* Perform the conversions in [expr] that apply when an lvalue appears | ||||
2455 | in an rvalue context: the lvalue-to-rvalue, array-to-pointer, and | ||||
2456 | function-to-pointer conversions. In addition, bitfield references are | ||||
2457 | converted to their declared types. Note that this function does not perform | ||||
2458 | the lvalue-to-rvalue conversion for class types. If you need that conversion | ||||
2459 | for class types, then you probably need to use force_rvalue. | ||||
2460 | |||||
2461 | Although the returned value is being used as an rvalue, this | ||||
2462 | function does not wrap the returned expression in a | ||||
2463 | NON_LVALUE_EXPR; the caller is expected to be mindful of the fact | ||||
2464 | that the return value is no longer an lvalue. */ | ||||
2465 | |||||
2466 | tree | ||||
2467 | decay_conversion (tree exp, | ||||
2468 | tsubst_flags_t complain, | ||||
2469 | bool reject_builtin /* = true */) | ||||
2470 | { | ||||
2471 | tree type; | ||||
2472 | enum tree_code code; | ||||
2473 | location_t loc = cp_expr_loc_or_input_loc (exp); | ||||
2474 | |||||
2475 | type = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2475, __FUNCTION__))->typed.type); | ||||
2476 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2477 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2478 | |||||
2479 | exp = resolve_nondeduced_context_or_error (exp, complain); | ||||
2480 | |||||
2481 | code = TREE_CODE (type)((enum tree_code) (type)->base.code); | ||||
2482 | |||||
2483 | if (error_operand_p (exp)) | ||||
2484 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2485 | |||||
2486 | if (NULLPTR_TYPE_P (type)(((enum tree_code) (type)->base.code) == NULLPTR_TYPE) && !TREE_SIDE_EFFECTS (exp)((non_type_check ((exp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2486, __FUNCTION__))->base.side_effects_flag)) | ||||
2487 | { | ||||
2488 | mark_rvalue_use (exp, loc, reject_builtin); | ||||
2489 | return nullptr_nodec_global_trees[CTI_NULLPTR]; | ||||
2490 | } | ||||
2491 | |||||
2492 | /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue. | ||||
2493 | Leave such NOP_EXPRs, since RHS is being used in non-lvalue context. */ | ||||
2494 | if (code == VOID_TYPE) | ||||
2495 | { | ||||
2496 | if (complain & tf_error) | ||||
2497 | error_at (loc, "void value not ignored as it ought to be"); | ||||
2498 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2499 | } | ||||
2500 | if (invalid_nonstatic_memfn_p (loc, exp, complain)) | ||||
2501 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2502 | if (code == FUNCTION_TYPE || is_overloaded_fn (exp)) | ||||
2503 | { | ||||
2504 | exp = mark_lvalue_use (exp); | ||||
2505 | if (reject_builtin && reject_gcc_builtin (exp, loc)) | ||||
2506 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2507 | return cp_build_addr_expr (exp, complain); | ||||
2508 | } | ||||
2509 | if (code == ARRAY_TYPE) | ||||
2510 | { | ||||
2511 | tree adr; | ||||
2512 | tree ptrtype; | ||||
2513 | |||||
2514 | exp = mark_lvalue_use (exp); | ||||
2515 | |||||
2516 | if (INDIRECT_REF_P (exp)(((enum tree_code) (exp)->base.code) == INDIRECT_REF)) | ||||
2517 | return build_nop (build_pointer_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2517, __FUNCTION__))->typed.type)), | ||||
2518 | TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2518, __FUNCTION__)))))); | ||||
2519 | |||||
2520 | if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == COMPOUND_EXPR) | ||||
2521 | { | ||||
2522 | tree op1 = decay_conversion (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2522, __FUNCTION__))))), complain); | ||||
2523 | if (op1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2524 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2525 | return build2 (COMPOUND_EXPR, TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2525, __FUNCTION__))->typed.type), | ||||
2526 | TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2526, __FUNCTION__))))), op1); | ||||
2527 | } | ||||
2528 | |||||
2529 | if (!obvalue_p (exp) | ||||
2530 | && ! (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == CONSTRUCTOR && TREE_STATIC (exp)((exp)->base.static_flag))) | ||||
2531 | { | ||||
2532 | if (complain & tf_error) | ||||
2533 | error_at (loc, "invalid use of non-lvalue array"); | ||||
2534 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2535 | } | ||||
2536 | |||||
2537 | /* Don't let an array compound literal decay to a pointer. It can | ||||
2538 | still be used to initialize an array or bind to a reference. */ | ||||
2539 | if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == TARGET_EXPR) | ||||
2540 | { | ||||
2541 | if (complain & tf_error) | ||||
2542 | error_at (loc, "taking address of temporary array"); | ||||
2543 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2544 | } | ||||
2545 | |||||
2546 | ptrtype = build_pointer_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2546, __FUNCTION__))->typed.type)); | ||||
2547 | |||||
2548 | if (VAR_P (exp)(((enum tree_code) (exp)->base.code) == VAR_DECL)) | ||||
2549 | { | ||||
2550 | if (!cxx_mark_addressable (exp)) | ||||
2551 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2552 | adr = build_nop (ptrtype, build_address (exp)); | ||||
2553 | return adr; | ||||
2554 | } | ||||
2555 | /* This way is better for a COMPONENT_REF since it can | ||||
2556 | simplify the offset for a component. */ | ||||
2557 | adr = cp_build_addr_expr (exp, complain); | ||||
2558 | return cp_convert (ptrtype, adr, complain); | ||||
2559 | } | ||||
2560 | |||||
2561 | /* Otherwise, it's the lvalue-to-rvalue conversion. */ | ||||
2562 | exp = mark_rvalue_use (exp, loc, reject_builtin); | ||||
2563 | |||||
2564 | /* If a bitfield is used in a context where integral promotion | ||||
2565 | applies, then the caller is expected to have used | ||||
2566 | default_conversion. That function promotes bitfields correctly | ||||
2567 | before calling this function. At this point, if we have a | ||||
2568 | bitfield referenced, we may assume that is not subject to | ||||
2569 | promotion, and that, therefore, the type of the resulting rvalue | ||||
2570 | is the declared type of the bitfield. */ | ||||
2571 | exp = convert_bitfield_to_declared_type (exp); | ||||
2572 | |||||
2573 | /* We do not call rvalue() here because we do not want to wrap EXP | ||||
2574 | in a NON_LVALUE_EXPR. */ | ||||
2575 | |||||
2576 | /* [basic.lval] | ||||
2577 | |||||
2578 | Non-class rvalues always have cv-unqualified types. */ | ||||
2579 | type = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2579, __FUNCTION__))->typed.type); | ||||
2580 | 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/typeck.cc" , 2580, __FUNCTION__))->type_common.lang_flag_5)) && cv_qualified_p (type)) | ||||
2581 | exp = build_nop (cv_unqualified (type), exp); | ||||
2582 | |||||
2583 | if (!complete_type_or_maybe_complain (type, exp, complain)) | ||||
2584 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2585 | |||||
2586 | return exp; | ||||
2587 | } | ||||
2588 | |||||
2589 | /* Perform preparatory conversions, as part of the "usual arithmetic | ||||
2590 | conversions". In particular, as per [expr]: | ||||
2591 | |||||
2592 | Whenever an lvalue expression appears as an operand of an | ||||
2593 | operator that expects the rvalue for that operand, the | ||||
2594 | lvalue-to-rvalue, array-to-pointer, or function-to-pointer | ||||
2595 | standard conversions are applied to convert the expression to an | ||||
2596 | rvalue. | ||||
2597 | |||||
2598 | In addition, we perform integral promotions here, as those are | ||||
2599 | applied to both operands to a binary operator before determining | ||||
2600 | what additional conversions should apply. */ | ||||
2601 | |||||
2602 | static tree | ||||
2603 | cp_default_conversion (tree exp, tsubst_flags_t complain) | ||||
2604 | { | ||||
2605 | /* Check for target-specific promotions. */ | ||||
2606 | tree promoted_type = targetm.promoted_type (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2606, __FUNCTION__))->typed.type)); | ||||
2607 | if (promoted_type) | ||||
2608 | exp = cp_convert (promoted_type, exp, complain); | ||||
2609 | /* Perform the integral promotions first so that bitfield | ||||
2610 | expressions (which may promote to "int", even if the bitfield is | ||||
2611 | declared "unsigned") are promoted correctly. */ | ||||
2612 | else if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (exp))((((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2612, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE && !((tree_check ((((contains_struct_check ((exp), ( TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2612, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2612, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag) ) || (((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2612, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2612, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ))) | ||||
2613 | exp = cp_perform_integral_promotions (exp, complain); | ||||
2614 | /* Perform the other conversions. */ | ||||
2615 | exp = decay_conversion (exp, complain); | ||||
2616 | |||||
2617 | return exp; | ||||
2618 | } | ||||
2619 | |||||
2620 | /* C version. */ | ||||
2621 | |||||
2622 | tree | ||||
2623 | default_conversion (tree exp) | ||||
2624 | { | ||||
2625 | return cp_default_conversion (exp, tf_warning_or_error); | ||||
2626 | } | ||||
2627 | |||||
2628 | /* EXPR is an expression with an integral or enumeration type. | ||||
2629 | Perform the integral promotions in [conv.prom], and return the | ||||
2630 | converted value. */ | ||||
2631 | |||||
2632 | tree | ||||
2633 | cp_perform_integral_promotions (tree expr, tsubst_flags_t complain) | ||||
2634 | { | ||||
2635 | tree type; | ||||
2636 | tree promoted_type; | ||||
2637 | |||||
2638 | expr = mark_rvalue_use (expr); | ||||
2639 | if (error_operand_p (expr)) | ||||
2640 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2641 | |||||
2642 | type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2642, __FUNCTION__))->typed.type); | ||||
2643 | |||||
2644 | /* [conv.prom] | ||||
2645 | |||||
2646 | A prvalue for an integral bit-field (11.3.9) can be converted to a prvalue | ||||
2647 | of type int if int can represent all the values of the bit-field; | ||||
2648 | otherwise, it can be converted to unsigned int if unsigned int can | ||||
2649 | represent all the values of the bit-field. If the bit-field is larger yet, | ||||
2650 | no integral promotion applies to it. If the bit-field has an enumerated | ||||
2651 | type, it is treated as any other value of that type for promotion | ||||
2652 | purposes. */ | ||||
2653 | tree bitfield_type = is_bitfield_expr_with_lowered_type (expr); | ||||
2654 | if (bitfield_type | ||||
2655 | && (TREE_CODE (bitfield_type)((enum tree_code) (bitfield_type)->base.code) == ENUMERAL_TYPE | ||||
2656 | || TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2656, __FUNCTION__))->type_common.precision) > TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2656, __FUNCTION__))->type_common.precision))) | ||||
2657 | type = bitfield_type; | ||||
2658 | |||||
2659 | gcc_assert (INTEGRAL_OR_ENUMERATION_TYPE_P (type))((void)(!((((enum tree_code) (type)->base.code) == ENUMERAL_TYPE || (((enum tree_code) (type)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (type)->base.code) == INTEGER_TYPE))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2659, __FUNCTION__), 0 : 0)); | ||||
2660 | /* Scoped enums don't promote. */ | ||||
2661 | if (SCOPED_ENUM_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE && ((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2661, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag) )) | ||||
2662 | return expr; | ||||
2663 | promoted_type = type_promotes_to (type); | ||||
2664 | if (type != promoted_type) | ||||
2665 | expr = cp_convert (promoted_type, expr, complain); | ||||
2666 | else if (bitfield_type && bitfield_type != type) | ||||
2667 | /* Prevent decay_conversion from converting to bitfield_type. */ | ||||
2668 | expr = build_nop (type, expr); | ||||
2669 | return expr; | ||||
2670 | } | ||||
2671 | |||||
2672 | /* C version. */ | ||||
2673 | |||||
2674 | tree | ||||
2675 | perform_integral_promotions (tree expr) | ||||
2676 | { | ||||
2677 | return cp_perform_integral_promotions (expr, tf_warning_or_error); | ||||
2678 | } | ||||
2679 | |||||
2680 | /* Returns nonzero iff exp is a STRING_CST or the result of applying | ||||
2681 | decay_conversion to one. */ | ||||
2682 | |||||
2683 | int | ||||
2684 | string_conv_p (const_tree totype, const_tree exp, int warn) | ||||
2685 | { | ||||
2686 | tree t; | ||||
2687 | |||||
2688 | if (!TYPE_PTR_P (totype)(((enum tree_code) (totype)->base.code) == POINTER_TYPE)) | ||||
2689 | return 0; | ||||
2690 | |||||
2691 | t = TREE_TYPE (totype)((contains_struct_check ((totype), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2691, __FUNCTION__))->typed.type); | ||||
2692 | if (!same_type_p (t, char_type_node)comptypes ((t), (integer_types[itk_char]), 0) | ||||
2693 | && !same_type_p (t, char8_type_node)comptypes ((t), (c_global_trees[CTI_CHAR8_TYPE]), 0) | ||||
2694 | && !same_type_p (t, char16_type_node)comptypes ((t), (c_global_trees[CTI_CHAR16_TYPE]), 0) | ||||
2695 | && !same_type_p (t, char32_type_node)comptypes ((t), (c_global_trees[CTI_CHAR32_TYPE]), 0) | ||||
2696 | && !same_type_p (t, wchar_type_node)comptypes ((t), (c_global_trees[CTI_WCHAR_TYPE]), 0)) | ||||
2697 | return 0; | ||||
2698 | |||||
2699 | location_t loc = EXPR_LOC_OR_LOC (exp, input_location)((((IS_ADHOC_LOC (((((exp)) && ((tree_code_type_tmpl < 0>::tree_code_type[(int) (((enum tree_code) ((exp))->base .code))]) >= tcc_reference && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) ((exp))-> base.code))]) <= tcc_expression)) ? (exp)->exp.locus : ( (location_t) 0)))) ? get_location_from_adhoc_loc (line_table, ((((exp)) && ((tree_code_type_tmpl <0>::tree_code_type [(int) (((enum tree_code) ((exp))->base.code))]) >= tcc_reference && (tree_code_type_tmpl <0>::tree_code_type[(int ) (((enum tree_code) ((exp))->base.code))]) <= tcc_expression )) ? (exp)->exp.locus : ((location_t) 0))) : (((((exp)) && ((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) ((exp))->base.code))]) >= tcc_reference && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) ((exp))->base.code))]) <= tcc_expression)) ? (exp)->exp.locus : ((location_t) 0)))) != ((location_t) 0 )) ? (exp)->exp.locus : (input_location)); | ||||
2700 | |||||
2701 | STRIP_ANY_LOCATION_WRAPPER (exp)(exp) = tree_strip_any_location_wrapper ((const_cast<union tree_node *> (((exp))))); | ||||
2702 | |||||
2703 | if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == STRING_CST) | ||||
2704 | { | ||||
2705 | /* Make sure that we don't try to convert between char and wide chars. */ | ||||
2706 | if (!same_type_p (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (exp))), t)comptypes ((((tree_class_check ((((contains_struct_check (((( contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2706, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2706, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2706, __FUNCTION__))->type_common.main_variant)), (t), 0 )) | ||||
2707 | return 0; | ||||
2708 | } | ||||
2709 | else | ||||
2710 | { | ||||
2711 | /* Is this a string constant which has decayed to 'const char *'? */ | ||||
2712 | t = build_pointer_type (cp_build_qualified_type (t, TYPE_QUAL_CONST)); | ||||
2713 | if (!same_type_p (TREE_TYPE (exp), t)comptypes ((((contains_struct_check ((exp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2713, __FUNCTION__))->typed.type)), (t), 0)) | ||||
2714 | return 0; | ||||
2715 | STRIP_NOPS (exp)(exp) = tree_strip_nop_conversions ((const_cast<union tree_node *> (((exp))))); | ||||
2716 | if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) != ADDR_EXPR | ||||
2717 | || TREE_CODE (TREE_OPERAND (exp, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check ((exp), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2717, __FUNCTION__))))))->base.code) != STRING_CST) | ||||
2718 | return 0; | ||||
2719 | } | ||||
2720 | if (warn) | ||||
2721 | { | ||||
2722 | if (cxx_dialect >= cxx11) | ||||
2723 | pedwarn (loc, OPT_Wwrite_strings, | ||||
2724 | "ISO C++ forbids converting a string constant to %qT", | ||||
2725 | totype); | ||||
2726 | else | ||||
2727 | warning_at (loc, OPT_Wwrite_strings, | ||||
2728 | "deprecated conversion from string constant to %qT", | ||||
2729 | totype); | ||||
2730 | } | ||||
2731 | |||||
2732 | return 1; | ||||
2733 | } | ||||
2734 | |||||
2735 | /* Given a COND_EXPR, MIN_EXPR, or MAX_EXPR in T, return it in a form that we | ||||
2736 | can, for example, use as an lvalue. This code used to be in | ||||
2737 | unary_complex_lvalue, but we needed it to deal with `a = (d == c) ? b : c' | ||||
2738 | expressions, where we're dealing with aggregates. But now it's again only | ||||
2739 | called from unary_complex_lvalue. The case (in particular) that led to | ||||
2740 | this was with CODE == ADDR_EXPR, since it's not an lvalue when we'd | ||||
2741 | get it there. */ | ||||
2742 | |||||
2743 | static tree | ||||
2744 | rationalize_conditional_expr (enum tree_code code, tree t, | ||||
2745 | tsubst_flags_t complain) | ||||
2746 | { | ||||
2747 | location_t loc = cp_expr_loc_or_input_loc (t); | ||||
2748 | |||||
2749 | /* For MIN_EXPR or MAX_EXPR, fold-const.cc has arranged things so that | ||||
2750 | the first operand is always the one to be used if both operands | ||||
2751 | are equal, so we know what conditional expression this used to be. */ | ||||
2752 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == MIN_EXPR || TREE_CODE (t)((enum tree_code) (t)->base.code) == MAX_EXPR) | ||||
2753 | { | ||||
2754 | tree op0 = TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2754, __FUNCTION__))))); | ||||
2755 | tree op1 = TREE_OPERAND (t, 1)(*((const_cast<tree*> (tree_operand_check ((t), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2755, __FUNCTION__))))); | ||||
2756 | |||||
2757 | /* The following code is incorrect if either operand side-effects. */ | ||||
2758 | gcc_assert (!TREE_SIDE_EFFECTS (op0)((void)(!(!((non_type_check ((op0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2758, __FUNCTION__))->base.side_effects_flag) && !((non_type_check ((op1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2759, __FUNCTION__))->base.side_effects_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2759, __FUNCTION__), 0 : 0)) | ||||
2759 | && !TREE_SIDE_EFFECTS (op1))((void)(!(!((non_type_check ((op0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2758, __FUNCTION__))->base.side_effects_flag) && !((non_type_check ((op1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2759, __FUNCTION__))->base.side_effects_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2759, __FUNCTION__), 0 : 0)); | ||||
2760 | return | ||||
2761 | build_conditional_expr (loc, | ||||
2762 | build_x_binary_op (loc, | ||||
2763 | (TREE_CODE (t)((enum tree_code) (t)->base.code) == MIN_EXPR | ||||
2764 | ? LE_EXPR : GE_EXPR), | ||||
2765 | op0, TREE_CODE (op0)((enum tree_code) (op0)->base.code), | ||||
2766 | op1, TREE_CODE (op1)((enum tree_code) (op1)->base.code), | ||||
2767 | NULL_TREE(tree) __null, | ||||
2768 | /*overload=*/NULL__null, | ||||
2769 | complain), | ||||
2770 | cp_build_unary_op (code, op0, false, complain), | ||||
2771 | cp_build_unary_op (code, op1, false, complain), | ||||
2772 | complain); | ||||
2773 | } | ||||
2774 | |||||
2775 | tree op1 = TREE_OPERAND (t, 1)(*((const_cast<tree*> (tree_operand_check ((t), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2775, __FUNCTION__))))); | ||||
2776 | if (TREE_CODE (op1)((enum tree_code) (op1)->base.code) != THROW_EXPR) | ||||
2777 | op1 = cp_build_unary_op (code, op1, false, complain); | ||||
2778 | tree op2 = TREE_OPERAND (t, 2)(*((const_cast<tree*> (tree_operand_check ((t), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2778, __FUNCTION__))))); | ||||
2779 | if (TREE_CODE (op2)((enum tree_code) (op2)->base.code) != THROW_EXPR) | ||||
2780 | op2 = cp_build_unary_op (code, op2, false, complain); | ||||
2781 | |||||
2782 | return | ||||
2783 | build_conditional_expr (loc, TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2783, __FUNCTION__))))), op1, op2, complain); | ||||
2784 | } | ||||
2785 | |||||
2786 | /* Given the TYPE of an anonymous union field inside T, return the | ||||
2787 | FIELD_DECL for the field. If not found return NULL_TREE. Because | ||||
2788 | anonymous unions can nest, we must also search all anonymous unions | ||||
2789 | that are directly reachable. */ | ||||
2790 | |||||
2791 | tree | ||||
2792 | lookup_anon_field (tree, tree type) | ||||
2793 | { | ||||
2794 | tree field; | ||||
2795 | |||||
2796 | type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2796, __FUNCTION__))->type_common.main_variant); | ||||
2797 | field = ANON_AGGR_TYPE_FIELD (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2797, __FUNCTION__))->type_with_lang_specific.lang_specific ))->typeinfo_var); | ||||
2798 | gcc_assert (field)((void)(!(field) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2798, __FUNCTION__), 0 : 0)); | ||||
2799 | return field; | ||||
2800 | } | ||||
2801 | |||||
2802 | /* Build an expression representing OBJECT.MEMBER. OBJECT is an | ||||
2803 | expression; MEMBER is a DECL or baselink. If ACCESS_PATH is | ||||
2804 | non-NULL, it indicates the path to the base used to name MEMBER. | ||||
2805 | If PRESERVE_REFERENCE is true, the expression returned will have | ||||
2806 | REFERENCE_TYPE if the MEMBER does. Otherwise, the expression | ||||
2807 | returned will have the type referred to by the reference. | ||||
2808 | |||||
2809 | This function does not perform access control; that is either done | ||||
2810 | earlier by the parser when the name of MEMBER is resolved to MEMBER | ||||
2811 | itself, or later when overload resolution selects one of the | ||||
2812 | functions indicated by MEMBER. */ | ||||
2813 | |||||
2814 | tree | ||||
2815 | build_class_member_access_expr (cp_expr object, tree member, | ||||
2816 | tree access_path, bool preserve_reference, | ||||
2817 | tsubst_flags_t complain) | ||||
2818 | { | ||||
2819 | tree object_type; | ||||
2820 | tree member_scope; | ||||
2821 | tree result = NULL_TREE(tree) __null; | ||||
2822 | tree using_decl = NULL_TREE(tree) __null; | ||||
2823 | |||||
2824 | if (error_operand_p (object) || error_operand_p (member)) | ||||
2825 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2826 | |||||
2827 | gcc_assert (DECL_P (member) || BASELINK_P (member))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int ) (((enum tree_code) (member)->base.code))] == tcc_declaration ) || (((enum tree_code) (member)->base.code) == BASELINK)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2827, __FUNCTION__), 0 : 0)); | ||||
2828 | |||||
2829 | /* [expr.ref] | ||||
2830 | |||||
2831 | The type of the first expression shall be "class object" (of a | ||||
2832 | complete type). */ | ||||
2833 | object_type = TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2833, __FUNCTION__))->typed.type); | ||||
2834 | if (!currently_open_class (object_type) | ||||
2835 | && !complete_type_or_maybe_complain (object_type, object, complain)) | ||||
2836 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2837 | if (!CLASS_TYPE_P (object_type)(((((enum tree_code) (object_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (object_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2837, __FUNCTION__))->type_common.lang_flag_5))) | ||||
2838 | { | ||||
2839 | if (complain & tf_error) | ||||
2840 | { | ||||
2841 | if (INDIRECT_TYPE_P (object_type)((((enum tree_code) (object_type)->base.code) == POINTER_TYPE ) || (((enum tree_code) (object_type)->base.code) == REFERENCE_TYPE )) | ||||
2842 | && CLASS_TYPE_P (TREE_TYPE (object_type))(((((enum tree_code) (((contains_struct_check ((object_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2842, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((object_type ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2842, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((object_type ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2842, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2842, __FUNCTION__))->type_common.lang_flag_5))) | ||||
2843 | error ("request for member %qD in %qE, which is of pointer " | ||||
2844 | "type %qT (maybe you meant to use %<->%> ?)", | ||||
2845 | member, object.get_value (), object_type); | ||||
2846 | else | ||||
2847 | error ("request for member %qD in %qE, which is of non-class " | ||||
2848 | "type %qT", member, object.get_value (), object_type); | ||||
2849 | } | ||||
2850 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2851 | } | ||||
2852 | |||||
2853 | /* The standard does not seem to actually say that MEMBER must be a | ||||
2854 | member of OBJECT_TYPE. However, that is clearly what is | ||||
2855 | intended. */ | ||||
2856 | if (DECL_P (member)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (member)->base.code))] == tcc_declaration)) | ||||
2857 | { | ||||
2858 | member_scope = DECL_CLASS_CONTEXT (member)((((contains_struct_check ((member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2858, __FUNCTION__))->decl_minimal.context) && ( tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (((contains_struct_check ((member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2858, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)) ? ((contains_struct_check ((member), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2858, __FUNCTION__))->decl_minimal.context) : (tree) __null ); | ||||
2859 | if (!mark_used (member, complain) && !(complain & tf_error)) | ||||
2860 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2861 | |||||
2862 | if (TREE_UNAVAILABLE (member)((member)->base.u.bits.unavailable_flag)) | ||||
2863 | error_unavailable_use (member, NULL_TREE(tree) __null); | ||||
2864 | else if (TREE_DEPRECATED (member)((member)->base.deprecated_flag)) | ||||
2865 | warn_deprecated_use (member, NULL_TREE(tree) __null); | ||||
2866 | } | ||||
2867 | else | ||||
2868 | member_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (member))((contains_struct_check (((tree_check (((((struct tree_baselink *) (tree_check ((member), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2868, __FUNCTION__, (BASELINK))))->access_binfo)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2868, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2868, __FUNCTION__))->typed.type); | ||||
2869 | /* If MEMBER is from an anonymous aggregate, MEMBER_SCOPE will | ||||
2870 | presently be the anonymous union. Go outwards until we find a | ||||
2871 | type related to OBJECT_TYPE. */ | ||||
2872 | while ((ANON_AGGR_TYPE_P (member_scope)((((((enum tree_code) (member_scope)->base.code)) == RECORD_TYPE || (((enum tree_code) (member_scope)->base.code)) == UNION_TYPE ) && ((tree_class_check ((member_scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2872, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((member_scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2872, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr) || UNSCOPED_ENUM_P (member_scope)(((enum tree_code) (member_scope)->base.code) == ENUMERAL_TYPE && !((tree_check ((member_scope), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2872, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag) )) | ||||
2873 | && !same_type_ignoring_top_level_qualifiers_p (member_scope, | ||||
2874 | object_type)) | ||||
2875 | member_scope = TYPE_CONTEXT (member_scope)((tree_class_check ((member_scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2875, __FUNCTION__))->type_common.context); | ||||
2876 | if (!member_scope || !DERIVED_FROM_P (member_scope, object_type)(lookup_base ((object_type), (member_scope), ba_any, __null, tf_none ) != (tree) __null)) | ||||
2877 | { | ||||
2878 | if (complain & tf_error) | ||||
2879 | { | ||||
2880 | if (TREE_CODE (member)((enum tree_code) (member)->base.code) == FIELD_DECL) | ||||
2881 | error ("invalid use of non-static data member %qE", member); | ||||
2882 | else | ||||
2883 | error ("%qD is not a member of %qT", member, object_type); | ||||
2884 | } | ||||
2885 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2886 | } | ||||
2887 | |||||
2888 | /* Transform `(a, b).x' into `(*(a, &b)).x', `(a ? b : c).x' into | ||||
2889 | `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only an lvalue | ||||
2890 | in the front end; only _DECLs and _REFs are lvalues in the back end. */ | ||||
2891 | if (tree temp = unary_complex_lvalue (ADDR_EXPR, object)) | ||||
2892 | { | ||||
2893 | temp = cp_build_fold_indirect_ref (temp); | ||||
2894 | if (!lvalue_p (object) && lvalue_p (temp)) | ||||
2895 | /* Preserve rvalueness. */ | ||||
2896 | temp = move (temp); | ||||
2897 | object = temp; | ||||
2898 | } | ||||
2899 | |||||
2900 | /* In [expr.ref], there is an explicit list of the valid choices for | ||||
2901 | MEMBER. We check for each of those cases here. */ | ||||
2902 | if (VAR_P (member)(((enum tree_code) (member)->base.code) == VAR_DECL)) | ||||
2903 | { | ||||
2904 | /* A static data member. */ | ||||
2905 | result = member; | ||||
2906 | mark_exp_read (object); | ||||
2907 | |||||
2908 | if (tree wrap = maybe_get_tls_wrapper_call (result)) | ||||
2909 | /* Replace an evaluated use of the thread_local variable with | ||||
2910 | a call to its wrapper. */ | ||||
2911 | result = wrap; | ||||
2912 | |||||
2913 | /* If OBJECT has side-effects, they are supposed to occur. */ | ||||
2914 | if (TREE_SIDE_EFFECTS (object)((non_type_check ((object), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2914, __FUNCTION__))->base.side_effects_flag)) | ||||
2915 | result = build2 (COMPOUND_EXPR, TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2915, __FUNCTION__))->typed.type), object, result); | ||||
2916 | } | ||||
2917 | else if (TREE_CODE (member)((enum tree_code) (member)->base.code) == FIELD_DECL) | ||||
2918 | { | ||||
2919 | /* A non-static data member. */ | ||||
2920 | bool null_object_p; | ||||
2921 | int type_quals; | ||||
2922 | tree member_type; | ||||
2923 | |||||
2924 | if (INDIRECT_REF_P (object)(((enum tree_code) (object)->base.code) == INDIRECT_REF)) | ||||
2925 | null_object_p = | ||||
2926 | integer_zerop (tree_strip_nop_conversions (TREE_OPERAND (object, 0)(*((const_cast<tree*> (tree_operand_check ((object), (0 ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2926, __FUNCTION__))))))); | ||||
2927 | else | ||||
2928 | null_object_p = false; | ||||
2929 | |||||
2930 | /* Convert OBJECT to the type of MEMBER. */ | ||||
2931 | if (!same_type_p (TYPE_MAIN_VARIANT (object_type),comptypes ((((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2931, __FUNCTION__))->type_common.main_variant)), (((tree_class_check ((member_scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2932, __FUNCTION__))->type_common.main_variant)), 0) | ||||
2932 | TYPE_MAIN_VARIANT (member_scope))comptypes ((((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2931, __FUNCTION__))->type_common.main_variant)), (((tree_class_check ((member_scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2932, __FUNCTION__))->type_common.main_variant)), 0)) | ||||
2933 | { | ||||
2934 | tree binfo; | ||||
2935 | base_kind kind; | ||||
2936 | |||||
2937 | /* We didn't complain above about a currently open class, but now we | ||||
2938 | must: we don't know how to refer to a base member before layout is | ||||
2939 | complete. But still don't complain in a template. */ | ||||
2940 | if (!cp_unevaluated_operand | ||||
2941 | && !dependent_type_p (object_type) | ||||
2942 | && !complete_type_or_maybe_complain (object_type, object, | ||||
2943 | complain)) | ||||
2944 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2945 | |||||
2946 | binfo = lookup_base (access_path ? access_path : object_type, | ||||
2947 | member_scope, ba_unique, &kind, complain); | ||||
2948 | if (binfo == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2949 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2950 | |||||
2951 | /* It is invalid to try to get to a virtual base of a | ||||
2952 | NULL object. The most common cause is invalid use of | ||||
2953 | offsetof macro. */ | ||||
2954 | if (null_object_p && kind == bk_via_virtual) | ||||
2955 | { | ||||
2956 | if (complain & tf_error) | ||||
2957 | { | ||||
2958 | error ("invalid access to non-static data member %qD in " | ||||
2959 | "virtual base of NULL object", member); | ||||
2960 | } | ||||
2961 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2962 | } | ||||
2963 | |||||
2964 | /* Convert to the base. */ | ||||
2965 | object = build_base_path (PLUS_EXPR, object, binfo, | ||||
2966 | /*nonnull=*/1, complain); | ||||
2967 | /* If we found the base successfully then we should be able | ||||
2968 | to convert to it successfully. */ | ||||
2969 | gcc_assert (object != error_mark_node)((void)(!(object != global_trees[TI_ERROR_MARK]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2969, __FUNCTION__), 0 : 0)); | ||||
2970 | } | ||||
2971 | |||||
2972 | /* If MEMBER is from an anonymous aggregate, we have converted | ||||
2973 | OBJECT so that it refers to the class containing the | ||||
2974 | anonymous union. Generate a reference to the anonymous union | ||||
2975 | itself, and recur to find MEMBER. */ | ||||
2976 | if (ANON_AGGR_TYPE_P (DECL_CONTEXT (member))((((((enum tree_code) (((contains_struct_check ((member), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2976, __FUNCTION__))->decl_minimal.context))->base.code )) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2976, __FUNCTION__))->decl_minimal.context))->base.code )) == UNION_TYPE) && ((tree_class_check ((((contains_struct_check ((member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2976, __FUNCTION__))->decl_minimal.context)), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2976, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((((contains_struct_check ((member), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2976, __FUNCTION__))->decl_minimal.context)), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2976, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr) | ||||
2977 | /* When this code is called from build_field_call, the | ||||
2978 | object already has the type of the anonymous union. | ||||
2979 | That is because the COMPONENT_REF was already | ||||
2980 | constructed, and was then disassembled before calling | ||||
2981 | build_field_call. After the function-call code is | ||||
2982 | cleaned up, this waste can be eliminated. */ | ||||
2983 | && (!same_type_ignoring_top_level_qualifiers_p | ||||
2984 | (TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2984, __FUNCTION__))->typed.type), DECL_CONTEXT (member)((contains_struct_check ((member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2984, __FUNCTION__))->decl_minimal.context)))) | ||||
2985 | { | ||||
2986 | tree anonymous_union; | ||||
2987 | |||||
2988 | anonymous_union = lookup_anon_field (TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2988, __FUNCTION__))->typed.type), | ||||
2989 | DECL_CONTEXT (member)((contains_struct_check ((member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2989, __FUNCTION__))->decl_minimal.context)); | ||||
2990 | object = build_class_member_access_expr (object, | ||||
2991 | anonymous_union, | ||||
2992 | /*access_path=*/NULL_TREE(tree) __null, | ||||
2993 | preserve_reference, | ||||
2994 | complain); | ||||
2995 | } | ||||
2996 | |||||
2997 | /* Compute the type of the field, as described in [expr.ref]. */ | ||||
2998 | type_quals = TYPE_UNQUALIFIED; | ||||
2999 | member_type = TREE_TYPE (member)((contains_struct_check ((member), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 2999, __FUNCTION__))->typed.type); | ||||
3000 | if (!TYPE_REF_P (member_type)(((enum tree_code) (member_type)->base.code) == REFERENCE_TYPE )) | ||||
3001 | { | ||||
3002 | type_quals = (cp_type_quals (member_type) | ||||
3003 | | cp_type_quals (object_type)); | ||||
3004 | |||||
3005 | /* A field is const (volatile) if the enclosing object, or the | ||||
3006 | field itself, is const (volatile). But, a mutable field is | ||||
3007 | not const, even within a const object. */ | ||||
3008 | if (DECL_MUTABLE_P (member)(((contains_struct_check (((tree_check ((member), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3008, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3008, __FUNCTION__))->decl_common.lang_flag_0))) | ||||
3009 | type_quals &= ~TYPE_QUAL_CONST; | ||||
3010 | member_type = cp_build_qualified_type (member_type, type_quals); | ||||
3011 | } | ||||
3012 | |||||
3013 | result = build3_loc (input_location, COMPONENT_REF, member_type, | ||||
3014 | object, member, NULL_TREE(tree) __null); | ||||
3015 | |||||
3016 | /* Mark the expression const or volatile, as appropriate. Even | ||||
3017 | though we've dealt with the type above, we still have to mark the | ||||
3018 | expression itself. */ | ||||
3019 | if (type_quals & TYPE_QUAL_CONST) | ||||
3020 | TREE_READONLY (result)((non_type_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3020, __FUNCTION__))->base.readonly_flag) = 1; | ||||
3021 | if (type_quals & TYPE_QUAL_VOLATILE) | ||||
3022 | TREE_THIS_VOLATILE (result)((result)->base.volatile_flag) = 1; | ||||
3023 | } | ||||
3024 | else if (BASELINK_P (member)(((enum tree_code) (member)->base.code) == BASELINK)) | ||||
3025 | { | ||||
3026 | /* The member is a (possibly overloaded) member function. */ | ||||
3027 | tree functions; | ||||
3028 | tree type; | ||||
3029 | |||||
3030 | /* If the MEMBER is exactly one static member function, then we | ||||
3031 | know the type of the expression. Otherwise, we must wait | ||||
3032 | until overload resolution has been performed. */ | ||||
3033 | functions = BASELINK_FUNCTIONS (member)(((struct tree_baselink*) (tree_check ((member), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3033, __FUNCTION__, (BASELINK))))->functions); | ||||
3034 | if (TREE_CODE (functions)((enum tree_code) (functions)->base.code) == FUNCTION_DECL | ||||
3035 | && DECL_STATIC_FUNCTION_P (functions)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (functions)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((functions), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3035, __FUNCTION__, (TEMPLATE_DECL))))))))->result : functions )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3035, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (functions)->base.code) == FUNCTION_DECL || (((enum tree_code) (functions)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((functions), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3035, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((functions ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3035, __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/typeck.cc" , 3035, __FUNCTION__); <->u.fn; })->static_function )) | ||||
3036 | type = TREE_TYPE (functions)((contains_struct_check ((functions), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3036, __FUNCTION__))->typed.type); | ||||
3037 | else | ||||
3038 | type = unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE]; | ||||
3039 | /* Note that we do not convert OBJECT to the BASELINK_BINFO | ||||
3040 | base. That will happen when the function is called. */ | ||||
3041 | result = build3_loc (input_location, COMPONENT_REF, type, object, member, | ||||
3042 | NULL_TREE(tree) __null); | ||||
3043 | } | ||||
3044 | else if (TREE_CODE (member)((enum tree_code) (member)->base.code) == CONST_DECL) | ||||
3045 | { | ||||
3046 | /* The member is an enumerator. */ | ||||
3047 | result = member; | ||||
3048 | /* If OBJECT has side-effects, they are supposed to occur. */ | ||||
3049 | if (TREE_SIDE_EFFECTS (object)((non_type_check ((object), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3049, __FUNCTION__))->base.side_effects_flag)) | ||||
3050 | result = build2 (COMPOUND_EXPR, TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3050, __FUNCTION__))->typed.type), | ||||
3051 | object, result); | ||||
3052 | } | ||||
3053 | else if ((using_decl = strip_using_decl (member)) != member) | ||||
3054 | result = build_class_member_access_expr (object, | ||||
3055 | using_decl, | ||||
3056 | access_path, preserve_reference, | ||||
3057 | complain); | ||||
3058 | else | ||||
3059 | { | ||||
3060 | if (complain & tf_error) | ||||
3061 | error ("invalid use of %qD", member); | ||||
3062 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3063 | } | ||||
3064 | |||||
3065 | if (!preserve_reference) | ||||
3066 | /* [expr.ref] | ||||
3067 | |||||
3068 | If E2 is declared to have type "reference to T", then ... the | ||||
3069 | type of E1.E2 is T. */ | ||||
3070 | result = convert_from_reference (result); | ||||
3071 | |||||
3072 | return result; | ||||
3073 | } | ||||
3074 | |||||
3075 | /* Return the destructor denoted by OBJECT.SCOPE::DTOR_NAME, or, if | ||||
3076 | SCOPE is NULL, by OBJECT.DTOR_NAME, where DTOR_NAME is ~type. */ | ||||
3077 | |||||
3078 | tree | ||||
3079 | lookup_destructor (tree object, tree scope, tree dtor_name, | ||||
3080 | tsubst_flags_t complain) | ||||
3081 | { | ||||
3082 | tree object_type = TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3082, __FUNCTION__))->typed.type); | ||||
3083 | tree dtor_type = TREE_OPERAND (dtor_name, 0)(*((const_cast<tree*> (tree_operand_check ((dtor_name), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3083, __FUNCTION__))))); | ||||
3084 | tree expr; | ||||
3085 | |||||
3086 | /* We've already complained about this destructor. */ | ||||
3087 | if (dtor_type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3088 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3089 | |||||
3090 | if (scope && !check_dtor_name (scope, dtor_type)) | ||||
3091 | { | ||||
3092 | if (complain & tf_error) | ||||
3093 | error ("qualified type %qT does not match destructor name ~%qT", | ||||
3094 | scope, dtor_type); | ||||
3095 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3096 | } | ||||
3097 | if (is_auto (dtor_type)) | ||||
3098 | dtor_type = object_type; | ||||
3099 | else if (identifier_p (dtor_type)) | ||||
3100 | { | ||||
3101 | /* In a template, names we can't find a match for are still accepted | ||||
3102 | destructor names, and we check them here. */ | ||||
3103 | if (check_dtor_name (object_type, dtor_type)) | ||||
3104 | dtor_type = object_type; | ||||
3105 | else | ||||
3106 | { | ||||
3107 | if (complain & tf_error) | ||||
3108 | error ("object type %qT does not match destructor name ~%qT", | ||||
3109 | object_type, dtor_type); | ||||
3110 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3111 | } | ||||
3112 | |||||
3113 | } | ||||
3114 | else if (!DERIVED_FROM_P (dtor_type, TYPE_MAIN_VARIANT (object_type))(lookup_base ((((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3114, __FUNCTION__))->type_common.main_variant)), (dtor_type ), ba_any, __null, tf_none) != (tree) __null)) | ||||
3115 | { | ||||
3116 | if (complain & tf_error) | ||||
3117 | error ("the type being destroyed is %qT, but the destructor " | ||||
3118 | "refers to %qT", TYPE_MAIN_VARIANT (object_type)((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3118, __FUNCTION__))->type_common.main_variant), dtor_type); | ||||
3119 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3120 | } | ||||
3121 | expr = lookup_member (dtor_type, complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER], | ||||
3122 | /*protect=*/1, /*want_type=*/false, | ||||
3123 | tf_warning_or_error); | ||||
3124 | if (!expr) | ||||
3125 | { | ||||
3126 | if (complain & tf_error) | ||||
3127 | cxx_incomplete_type_error (dtor_name, dtor_type); | ||||
3128 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3129 | } | ||||
3130 | expr = (adjust_result_of_qualified_name_lookup | ||||
3131 | (expr, dtor_type, object_type)); | ||||
3132 | if (scope == NULL_TREE(tree) __null) | ||||
3133 | /* We need to call adjust_result_of_qualified_name_lookup in case the | ||||
3134 | destructor names a base class, but we unset BASELINK_QUALIFIED_P so | ||||
3135 | that we still get virtual function binding. */ | ||||
3136 | BASELINK_QUALIFIED_P (expr)((tree_not_check2 (((tree_check ((expr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3136, __FUNCTION__, (BASELINK)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3136, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = false; | ||||
3137 | return expr; | ||||
3138 | } | ||||
3139 | |||||
3140 | /* An expression of the form "A::template B" has been resolved to | ||||
3141 | DECL. Issue a diagnostic if B is not a template or template | ||||
3142 | specialization. */ | ||||
3143 | |||||
3144 | void | ||||
3145 | check_template_keyword (tree decl) | ||||
3146 | { | ||||
3147 | /* The standard says: | ||||
3148 | |||||
3149 | [temp.names] | ||||
3150 | |||||
3151 | If a name prefixed by the keyword template is not a member | ||||
3152 | template, the program is ill-formed. | ||||
3153 | |||||
3154 | DR 228 removed the restriction that the template be a member | ||||
3155 | template. | ||||
3156 | |||||
3157 | DR 96, if accepted would add the further restriction that explicit | ||||
3158 | template arguments must be provided if the template keyword is | ||||
3159 | used, but, as of 2005-10-16, that DR is still in "drafting". If | ||||
3160 | this DR is accepted, then the semantic checks here can be | ||||
3161 | simplified, as the entity named must in fact be a template | ||||
3162 | specialization, rather than, as at present, a set of overloaded | ||||
3163 | functions containing at least one template function. */ | ||||
3164 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TEMPLATE_DECL | ||||
3165 | && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TEMPLATE_ID_EXPR) | ||||
3166 | { | ||||
3167 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) | ||||
3168 | { | ||||
3169 | if (DECL_USE_TEMPLATE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3169, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) | ||||
3170 | && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))(((((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 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3170, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))) | ||||
3171 | ; | ||||
3172 | else | ||||
3173 | permerror (input_location, "%qD is not a template", decl); | ||||
3174 | } | ||||
3175 | else if (!is_overloaded_fn (decl)) | ||||
3176 | permerror (input_location, "%qD is not a template", decl); | ||||
3177 | else | ||||
3178 | { | ||||
3179 | bool found = false; | ||||
3180 | |||||
3181 | for (lkp_iterator iter (MAYBE_BASELINK_FUNCTIONS (decl)((((enum tree_code) (decl)->base.code) == BASELINK) ? (((struct tree_baselink*) (tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3181, __FUNCTION__, (BASELINK))))->functions) : decl)); | ||||
3182 | !found && iter; ++iter) | ||||
3183 | { | ||||
3184 | tree fn = *iter; | ||||
3185 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL | ||||
3186 | || TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_ID_EXPR | ||||
3187 | || (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL | ||||
3188 | && DECL_USE_TEMPLATE (fn)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3188, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) | ||||
3189 | && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (fn))(((((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 ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((contains_struct_check ((template_info_decl_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3189, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)))) | ||||
3190 | found = true; | ||||
3191 | } | ||||
3192 | if (!found) | ||||
3193 | permerror (input_location, "%qD is not a template", decl); | ||||
3194 | } | ||||
3195 | } | ||||
3196 | } | ||||
3197 | |||||
3198 | /* Record that an access failure occurred on BASETYPE_PATH attempting | ||||
3199 | to access DECL, where DIAG_DECL should be used for diagnostics. */ | ||||
3200 | |||||
3201 | void | ||||
3202 | access_failure_info::record_access_failure (tree basetype_path, | ||||
3203 | tree decl, tree diag_decl) | ||||
3204 | { | ||||
3205 | m_was_inaccessible = true; | ||||
3206 | m_basetype_path = basetype_path; | ||||
3207 | m_decl = decl; | ||||
3208 | m_diag_decl = diag_decl; | ||||
3209 | } | ||||
3210 | |||||
3211 | /* If an access failure was recorded, then attempt to locate an | ||||
3212 | accessor function for the pertinent field. | ||||
3213 | Otherwise, return NULL_TREE. */ | ||||
3214 | |||||
3215 | tree | ||||
3216 | access_failure_info::get_any_accessor (bool const_p) const | ||||
3217 | { | ||||
3218 | if (!was_inaccessible_p ()) | ||||
3219 | return NULL_TREE(tree) __null; | ||||
3220 | |||||
3221 | tree accessor | ||||
3222 | = locate_field_accessor (m_basetype_path, m_diag_decl, const_p); | ||||
3223 | if (!accessor) | ||||
3224 | return NULL_TREE(tree) __null; | ||||
3225 | |||||
3226 | /* The accessor must itself be accessible for it to be a reasonable | ||||
3227 | suggestion. */ | ||||
3228 | if (!accessible_p (m_basetype_path, accessor, true)) | ||||
3229 | return NULL_TREE(tree) __null; | ||||
3230 | |||||
3231 | return accessor; | ||||
3232 | } | ||||
3233 | |||||
3234 | /* Add a fix-it hint to RICHLOC suggesting the use of ACCESSOR_DECL, by | ||||
3235 | replacing the primary location in RICHLOC with "accessor()". */ | ||||
3236 | |||||
3237 | void | ||||
3238 | access_failure_info::add_fixit_hint (rich_location *richloc, | ||||
3239 | tree accessor_decl) | ||||
3240 | { | ||||
3241 | pretty_printer pp; | ||||
3242 | pp_string (&pp, IDENTIFIER_POINTER (DECL_NAME (accessor_decl))((const char *) (tree_check ((((contains_struct_check ((accessor_decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3242, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3242, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str )); | ||||
3243 | pp_string (&pp, "()"); | ||||
3244 | richloc->add_fixit_replace (pp_formatted_text (&pp)); | ||||
3245 | } | ||||
3246 | |||||
3247 | /* If an access failure was recorded, then attempt to locate an | ||||
3248 | accessor function for the pertinent field, and if one is | ||||
3249 | available, add a note and fix-it hint suggesting using it. */ | ||||
3250 | |||||
3251 | void | ||||
3252 | access_failure_info::maybe_suggest_accessor (bool const_p) const | ||||
3253 | { | ||||
3254 | tree accessor = get_any_accessor (const_p); | ||||
3255 | if (accessor == NULL_TREE(tree) __null) | ||||
3256 | return; | ||||
3257 | rich_location richloc (line_table, input_location); | ||||
3258 | add_fixit_hint (&richloc, accessor); | ||||
3259 | inform (&richloc, "field %q#D can be accessed via %q#D", | ||||
3260 | m_diag_decl, accessor); | ||||
3261 | } | ||||
3262 | |||||
3263 | /* Subroutine of finish_class_member_access_expr. | ||||
3264 | Issue an error about NAME not being a member of ACCESS_PATH (or | ||||
3265 | OBJECT_TYPE), potentially providing a fix-it hint for misspelled | ||||
3266 | names. */ | ||||
3267 | |||||
3268 | static void | ||||
3269 | complain_about_unrecognized_member (tree access_path, tree name, | ||||
3270 | tree object_type) | ||||
3271 | { | ||||
3272 | /* Attempt to provide a hint about misspelled names. */ | ||||
3273 | tree guessed_id = lookup_member_fuzzy (access_path, name, | ||||
3274 | /*want_type=*/false); | ||||
3275 | if (guessed_id == NULL_TREE(tree) __null) | ||||
3276 | { | ||||
3277 | /* No hint. */ | ||||
3278 | error ("%q#T has no member named %qE", | ||||
3279 | TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO | ||||
3280 | ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3280, __FUNCTION__))->typed.type) : object_type, name); | ||||
3281 | return; | ||||
3282 | } | ||||
3283 | |||||
3284 | location_t bogus_component_loc = input_location; | ||||
3285 | gcc_rich_location rich_loc (bogus_component_loc); | ||||
3286 | |||||
3287 | /* Check that the guessed name is accessible along access_path. */ | ||||
3288 | access_failure_info afi; | ||||
3289 | lookup_member (access_path, guessed_id, /*protect=*/1, | ||||
3290 | /*want_type=*/false, /*complain=*/false, | ||||
3291 | &afi); | ||||
3292 | if (afi.was_inaccessible_p ()) | ||||
3293 | { | ||||
3294 | tree accessor = afi.get_any_accessor (TYPE_READONLY (object_type)((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3294, __FUNCTION__))->base.readonly_flag)); | ||||
3295 | if (accessor) | ||||
3296 | { | ||||
3297 | /* The guessed name isn't directly accessible, but can be accessed | ||||
3298 | via an accessor member function. */ | ||||
3299 | afi.add_fixit_hint (&rich_loc, accessor); | ||||
3300 | error_at (&rich_loc, | ||||
3301 | "%q#T has no member named %qE;" | ||||
3302 | " did you mean %q#D? (accessible via %q#D)", | ||||
3303 | TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO | ||||
3304 | ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3304, __FUNCTION__))->typed.type) : object_type, | ||||
3305 | name, afi.get_diag_decl (), accessor); | ||||
3306 | } | ||||
3307 | else | ||||
3308 | { | ||||
3309 | /* The guessed name isn't directly accessible, and no accessor | ||||
3310 | member function could be found. */ | ||||
3311 | error_at (&rich_loc, | ||||
3312 | "%q#T has no member named %qE;" | ||||
3313 | " did you mean %q#D? (not accessible from this context)", | ||||
3314 | TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO | ||||
3315 | ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3315, __FUNCTION__))->typed.type) : object_type, | ||||
3316 | name, afi.get_diag_decl ()); | ||||
3317 | complain_about_access (afi.get_decl (), afi.get_diag_decl (), | ||||
3318 | afi.get_diag_decl (), false, ak_none); | ||||
3319 | } | ||||
3320 | } | ||||
3321 | else | ||||
3322 | { | ||||
3323 | /* The guessed name is directly accessible; suggest it. */ | ||||
3324 | rich_loc.add_fixit_misspelled_id (bogus_component_loc, | ||||
3325 | guessed_id); | ||||
3326 | error_at (&rich_loc, | ||||
3327 | "%q#T has no member named %qE;" | ||||
3328 | " did you mean %qE?", | ||||
3329 | TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO | ||||
3330 | ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3330, __FUNCTION__))->typed.type) : object_type, | ||||
3331 | name, guessed_id); | ||||
3332 | } | ||||
3333 | } | ||||
3334 | |||||
3335 | /* This function is called by the parser to process a class member | ||||
3336 | access expression of the form OBJECT.NAME. NAME is a node used by | ||||
3337 | the parser to represent a name; it is not yet a DECL. It may, | ||||
3338 | however, be a BASELINK where the BASELINK_FUNCTIONS is a | ||||
3339 | TEMPLATE_ID_EXPR. Templates must be looked up by the parser, and | ||||
3340 | there is no reason to do the lookup twice, so the parser keeps the | ||||
3341 | BASELINK. TEMPLATE_P is true iff NAME was explicitly declared to | ||||
3342 | be a template via the use of the "A::template B" syntax. */ | ||||
3343 | |||||
3344 | tree | ||||
3345 | finish_class_member_access_expr (cp_expr object, tree name, bool template_p, | ||||
3346 | tsubst_flags_t complain) | ||||
3347 | { | ||||
3348 | tree expr; | ||||
3349 | tree object_type; | ||||
3350 | tree member; | ||||
3351 | tree access_path = NULL_TREE(tree) __null; | ||||
3352 | tree orig_object = object; | ||||
3353 | tree orig_name = name; | ||||
3354 | |||||
3355 | if (object == error_mark_nodeglobal_trees[TI_ERROR_MARK] || name == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3356 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3357 | |||||
3358 | /* If OBJECT is an ObjC class instance, we must obey ObjC access rules. */ | ||||
3359 | if (!objc_is_public (object, name)) | ||||
3360 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3361 | |||||
3362 | object_type = TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3362, __FUNCTION__))->typed.type); | ||||
3363 | |||||
3364 | if (processing_template_declscope_chain->x_processing_template_decl) | ||||
3365 | { | ||||
3366 | if (/* If OBJECT is dependent, so is OBJECT.NAME. */ | ||||
3367 | type_dependent_object_expression_p (object) | ||||
3368 | /* If NAME is "f<args>", where either 'f' or 'args' is | ||||
3369 | dependent, then the expression is dependent. */ | ||||
3370 | || (TREE_CODE (name)((enum tree_code) (name)->base.code) == TEMPLATE_ID_EXPR | ||||
3371 | && dependent_template_id_p (TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3371, __FUNCTION__))))), | ||||
3372 | TREE_OPERAND (name, 1)(*((const_cast<tree*> (tree_operand_check ((name), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3372, __FUNCTION__))))))) | ||||
3373 | /* If NAME is "T::X" where "T" is dependent, then the | ||||
3374 | expression is dependent. */ | ||||
3375 | || (TREE_CODE (name)((enum tree_code) (name)->base.code) == SCOPE_REF | ||||
3376 | && TYPE_P (TREE_OPERAND (name, 0))(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) ((*((const_cast<tree*> (tree_operand_check ((name), ( 0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3376, __FUNCTION__))))))->base.code))] == tcc_type) | ||||
3377 | && dependent_scope_p (TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3377, __FUNCTION__))))))) | ||||
3378 | /* If NAME is operator T where "T" is dependent, we can't | ||||
3379 | lookup until we instantiate the T. */ | ||||
3380 | || (TREE_CODE (name)((enum tree_code) (name)->base.code) == IDENTIFIER_NODE | ||||
3381 | && IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3381, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3381, __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/typeck.cc" , 3381, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3381, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((name) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3381, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3381, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) | ||||
3382 | && dependent_type_p (TREE_TYPE (name)((contains_struct_check ((name), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3382, __FUNCTION__))->typed.type)))) | ||||
3383 | { | ||||
3384 | dependent: | ||||
3385 | return build_min_nt_loc (UNKNOWN_LOCATION((location_t) 0), COMPONENT_REF, | ||||
3386 | orig_object, orig_name, NULL_TREE(tree) __null); | ||||
3387 | } | ||||
3388 | object = build_non_dependent_expr (object); | ||||
3389 | } | ||||
3390 | else if (c_dialect_objc ()((c_language & clk_objc) != 0) | ||||
3391 | && identifier_p (name) | ||||
3392 | && (expr = objc_maybe_build_component_ref (object, name))) | ||||
3393 | return expr; | ||||
3394 | |||||
3395 | /* [expr.ref] | ||||
3396 | |||||
3397 | The type of the first expression shall be "class object" (of a | ||||
3398 | complete type). */ | ||||
3399 | if (!currently_open_class (object_type) | ||||
3400 | && !complete_type_or_maybe_complain (object_type, object, complain)) | ||||
3401 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3402 | if (!CLASS_TYPE_P (object_type)(((((enum tree_code) (object_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (object_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3402, __FUNCTION__))->type_common.lang_flag_5))) | ||||
3403 | { | ||||
3404 | if (complain & tf_error) | ||||
3405 | { | ||||
3406 | if (INDIRECT_TYPE_P (object_type)((((enum tree_code) (object_type)->base.code) == POINTER_TYPE ) || (((enum tree_code) (object_type)->base.code) == REFERENCE_TYPE )) | ||||
3407 | && CLASS_TYPE_P (TREE_TYPE (object_type))(((((enum tree_code) (((contains_struct_check ((object_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3407, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((object_type ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3407, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((object_type ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3407, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3407, __FUNCTION__))->type_common.lang_flag_5))) | ||||
3408 | error ("request for member %qD in %qE, which is of pointer " | ||||
3409 | "type %qT (maybe you meant to use %<->%> ?)", | ||||
3410 | name, object.get_value (), object_type); | ||||
3411 | else | ||||
3412 | error ("request for member %qD in %qE, which is of non-class " | ||||
3413 | "type %qT", name, object.get_value (), object_type); | ||||
3414 | } | ||||
3415 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3416 | } | ||||
3417 | |||||
3418 | if (BASELINK_P (name)(((enum tree_code) (name)->base.code) == BASELINK)) | ||||
3419 | /* A member function that has already been looked up. */ | ||||
3420 | member = name; | ||||
3421 | else | ||||
3422 | { | ||||
3423 | bool is_template_id = false; | ||||
3424 | tree template_args = NULL_TREE(tree) __null; | ||||
3425 | tree scope = NULL_TREE(tree) __null; | ||||
3426 | |||||
3427 | access_path = object_type; | ||||
3428 | |||||
3429 | if (TREE_CODE (name)((enum tree_code) (name)->base.code) == SCOPE_REF) | ||||
3430 | { | ||||
3431 | /* A qualified name. The qualifying class or namespace `S' | ||||
3432 | has already been looked up; it is either a TYPE or a | ||||
3433 | NAMESPACE_DECL. */ | ||||
3434 | scope = TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3434, __FUNCTION__))))); | ||||
3435 | name = TREE_OPERAND (name, 1)(*((const_cast<tree*> (tree_operand_check ((name), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3435, __FUNCTION__))))); | ||||
3436 | |||||
3437 | /* If SCOPE is a namespace, then the qualified name does not | ||||
3438 | name a member of OBJECT_TYPE. */ | ||||
3439 | if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) == NAMESPACE_DECL) | ||||
3440 | { | ||||
3441 | if (complain & tf_error) | ||||
3442 | error ("%<%D::%D%> is not a member of %qT", | ||||
3443 | scope, name, object_type); | ||||
3444 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3445 | } | ||||
3446 | } | ||||
3447 | |||||
3448 | if (TREE_CODE (name)((enum tree_code) (name)->base.code) == TEMPLATE_ID_EXPR) | ||||
3449 | { | ||||
3450 | is_template_id = true; | ||||
3451 | template_args = TREE_OPERAND (name, 1)(*((const_cast<tree*> (tree_operand_check ((name), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3451, __FUNCTION__))))); | ||||
3452 | name = TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3452, __FUNCTION__))))); | ||||
3453 | |||||
3454 | if (!identifier_p (name)) | ||||
3455 | name = OVL_NAME (name)((contains_struct_check ((ovl_first (name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3455, __FUNCTION__))->decl_minimal.name); | ||||
3456 | } | ||||
3457 | |||||
3458 | if (scope) | ||||
3459 | { | ||||
3460 | if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) == ENUMERAL_TYPE) | ||||
3461 | { | ||||
3462 | gcc_assert (!is_template_id)((void)(!(!is_template_id) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3462, __FUNCTION__), 0 : 0)); | ||||
3463 | /* Looking up a member enumerator (c++/56793). */ | ||||
3464 | if (!TYPE_CLASS_SCOPE_P (scope)(((tree_class_check ((scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3464, __FUNCTION__))->type_common.context) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3464, __FUNCTION__))->type_common.context))->base.code ))] == tcc_type)) | ||||
3465 | || !DERIVED_FROM_P (TYPE_CONTEXT (scope), object_type)(lookup_base ((object_type), (((tree_class_check ((scope), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3465, __FUNCTION__))->type_common.context)), ba_any, __null , tf_none) != (tree) __null)) | ||||
3466 | { | ||||
3467 | if (complain & tf_error) | ||||
3468 | error ("%<%D::%D%> is not a member of %qT", | ||||
3469 | scope, name, object_type); | ||||
3470 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3471 | } | ||||
3472 | tree val = lookup_enumerator (scope, name); | ||||
3473 | if (!val) | ||||
3474 | { | ||||
3475 | if (complain & tf_error) | ||||
3476 | error ("%qD is not a member of %qD", | ||||
3477 | name, scope); | ||||
3478 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3479 | } | ||||
3480 | |||||
3481 | if (TREE_SIDE_EFFECTS (object)((non_type_check ((object), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3481, __FUNCTION__))->base.side_effects_flag)) | ||||
3482 | val = build2 (COMPOUND_EXPR, TREE_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3482, __FUNCTION__))->typed.type), object, val); | ||||
3483 | return val; | ||||
3484 | } | ||||
3485 | |||||
3486 | gcc_assert (CLASS_TYPE_P (scope))((void)(!((((((enum tree_code) (scope)->base.code)) == RECORD_TYPE || (((enum tree_code) (scope)->base.code)) == UNION_TYPE) && ((tree_class_check ((scope), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3486, __FUNCTION__))->type_common.lang_flag_5))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3486, __FUNCTION__), 0 : 0)); | ||||
3487 | gcc_assert (identifier_p (name) || TREE_CODE (name) == BIT_NOT_EXPR)((void)(!(identifier_p (name) || ((enum tree_code) (name)-> base.code) == BIT_NOT_EXPR) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3487, __FUNCTION__), 0 : 0)); | ||||
3488 | |||||
3489 | if (constructor_name_p (name, scope)) | ||||
3490 | { | ||||
3491 | if (complain & tf_error) | ||||
3492 | error ("cannot call constructor %<%T::%D%> directly", | ||||
3493 | scope, name); | ||||
3494 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3495 | } | ||||
3496 | |||||
3497 | /* Find the base of OBJECT_TYPE corresponding to SCOPE. */ | ||||
3498 | access_path = lookup_base (object_type, scope, ba_check, | ||||
3499 | NULL__null, complain); | ||||
3500 | if (access_path == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3501 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3502 | if (!access_path) | ||||
3503 | { | ||||
3504 | if (any_dependent_bases_p (object_type)) | ||||
3505 | goto dependent; | ||||
3506 | if (complain & tf_error) | ||||
3507 | error ("%qT is not a base of %qT", scope, object_type); | ||||
3508 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3509 | } | ||||
3510 | } | ||||
3511 | |||||
3512 | if (TREE_CODE (name)((enum tree_code) (name)->base.code) == BIT_NOT_EXPR) | ||||
3513 | { | ||||
3514 | if (dependent_type_p (object_type)) | ||||
3515 | /* The destructor isn't declared yet. */ | ||||
3516 | goto dependent; | ||||
3517 | member = lookup_destructor (object, scope, name, complain); | ||||
3518 | } | ||||
3519 | else | ||||
3520 | { | ||||
3521 | /* Look up the member. */ | ||||
3522 | access_failure_info afi; | ||||
3523 | if (processing_template_declscope_chain->x_processing_template_decl) | ||||
3524 | /* Even though this class member access expression is at this | ||||
3525 | point not dependent, the member itself may be dependent, and | ||||
3526 | we must not potentially push a access check for a dependent | ||||
3527 | member onto TI_DEFERRED_ACCESS_CHECKS. So don't check access | ||||
3528 | ahead of time here; we're going to redo this member lookup at | ||||
3529 | instantiation time anyway. */ | ||||
3530 | push_deferring_access_checks (dk_no_check); | ||||
3531 | member = lookup_member (access_path, name, /*protect=*/1, | ||||
3532 | /*want_type=*/false, complain, | ||||
3533 | &afi); | ||||
3534 | if (processing_template_declscope_chain->x_processing_template_decl) | ||||
3535 | pop_deferring_access_checks (); | ||||
3536 | afi.maybe_suggest_accessor (TYPE_READONLY (object_type)((tree_class_check ((object_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3536, __FUNCTION__))->base.readonly_flag)); | ||||
3537 | if (member == NULL_TREE(tree) __null) | ||||
3538 | { | ||||
3539 | if (dependent_type_p (object_type)) | ||||
3540 | /* Try again at instantiation time. */ | ||||
3541 | goto dependent; | ||||
3542 | if (complain & tf_error) | ||||
3543 | complain_about_unrecognized_member (access_path, name, | ||||
3544 | object_type); | ||||
3545 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3546 | } | ||||
3547 | if (member == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3548 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3549 | if (DECL_P (member)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (member)->base.code))] == tcc_declaration) | ||||
3550 | && any_dependent_type_attributes_p (DECL_ATTRIBUTES (member)((contains_struct_check ((member), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3550, __FUNCTION__))->decl_common.attributes))) | ||||
3551 | /* Dependent type attributes on the decl mean that the TREE_TYPE is | ||||
3552 | wrong, so don't use it. */ | ||||
3553 | goto dependent; | ||||
3554 | if (TREE_CODE (member)((enum tree_code) (member)->base.code) == USING_DECL && DECL_DEPENDENT_P (member)((contains_struct_check (((tree_check ((member), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3554, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3554, __FUNCTION__))->decl_common.lang_flag_0)) | ||||
3555 | goto dependent; | ||||
3556 | } | ||||
3557 | |||||
3558 | if (is_template_id) | ||||
3559 | { | ||||
3560 | tree templ = member; | ||||
3561 | |||||
3562 | if (BASELINK_P (templ)(((enum tree_code) (templ)->base.code) == BASELINK)) | ||||
3563 | member = lookup_template_function (templ, template_args); | ||||
3564 | else if (variable_template_p (templ)) | ||||
3565 | member = (lookup_and_finish_template_variable | ||||
3566 | (templ, template_args, complain)); | ||||
3567 | else | ||||
3568 | { | ||||
3569 | if (complain & tf_error) | ||||
3570 | error ("%qD is not a member template function", name); | ||||
3571 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3572 | } | ||||
3573 | } | ||||
3574 | } | ||||
3575 | |||||
3576 | if (TREE_UNAVAILABLE (member)((member)->base.u.bits.unavailable_flag)) | ||||
3577 | error_unavailable_use (member, NULL_TREE(tree) __null); | ||||
3578 | else if (TREE_DEPRECATED (member)((member)->base.deprecated_flag)) | ||||
3579 | warn_deprecated_use (member, NULL_TREE(tree) __null); | ||||
3580 | |||||
3581 | if (template_p) | ||||
3582 | check_template_keyword (member); | ||||
3583 | |||||
3584 | expr = build_class_member_access_expr (object, member, access_path, | ||||
3585 | /*preserve_reference=*/false, | ||||
3586 | complain); | ||||
3587 | if (processing_template_declscope_chain->x_processing_template_decl && expr != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3588 | { | ||||
3589 | if (BASELINK_P (member)(((enum tree_code) (member)->base.code) == BASELINK)) | ||||
3590 | { | ||||
3591 | if (TREE_CODE (orig_name)((enum tree_code) (orig_name)->base.code) == SCOPE_REF) | ||||
3592 | BASELINK_QUALIFIED_P (member)((tree_not_check2 (((tree_check ((member), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3592, __FUNCTION__, (BASELINK)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3592, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = 1; | ||||
3593 | orig_name = member; | ||||
3594 | } | ||||
3595 | return build_min_non_dep (COMPONENT_REF, expr, | ||||
3596 | orig_object, orig_name, | ||||
3597 | NULL_TREE(tree) __null); | ||||
3598 | } | ||||
3599 | |||||
3600 | return expr; | ||||
3601 | } | ||||
3602 | |||||
3603 | /* Build a COMPONENT_REF of OBJECT and MEMBER with the appropriate | ||||
3604 | type. */ | ||||
3605 | |||||
3606 | tree | ||||
3607 | build_simple_component_ref (tree object, tree member) | ||||
3608 | { | ||||
3609 | tree type = cp_build_qualified_type (TREE_TYPE (member)((contains_struct_check ((member), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3609, __FUNCTION__))->typed.type), | ||||
3610 | cp_type_quals (TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3610, __FUNCTION__))->typed.type))); | ||||
3611 | return build3_loc (input_location, | ||||
3612 | COMPONENT_REF, type, | ||||
3613 | object, member, NULL_TREE(tree) __null); | ||||
3614 | } | ||||
3615 | |||||
3616 | /* Return an expression for the MEMBER_NAME field in the internal | ||||
3617 | representation of PTRMEM, a pointer-to-member function. (Each | ||||
3618 | pointer-to-member function type gets its own RECORD_TYPE so it is | ||||
3619 | more convenient to access the fields by name than by FIELD_DECL.) | ||||
3620 | This routine converts the NAME to a FIELD_DECL and then creates the | ||||
3621 | node for the complete expression. */ | ||||
3622 | |||||
3623 | tree | ||||
3624 | build_ptrmemfunc_access_expr (tree ptrmem, tree member_name) | ||||
3625 | { | ||||
3626 | tree ptrmem_type; | ||||
3627 | tree member; | ||||
3628 | |||||
3629 | if (TREE_CODE (ptrmem)((enum tree_code) (ptrmem)->base.code) == CONSTRUCTOR) | ||||
3630 | { | ||||
3631 | for (auto &e: CONSTRUCTOR_ELTS (ptrmem)((tree_check ((ptrmem), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3631, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)) | ||||
3632 | if (e.index && DECL_P (e.index)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (e.index)->base.code))] == tcc_declaration) && DECL_NAME (e.index)((contains_struct_check ((e.index), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3632, __FUNCTION__))->decl_minimal.name) == member_name) | ||||
3633 | return e.value; | ||||
3634 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3634, __FUNCTION__)); | ||||
3635 | } | ||||
3636 | |||||
3637 | /* This code is a stripped down version of | ||||
3638 | build_class_member_access_expr. It does not work to use that | ||||
3639 | routine directly because it expects the object to be of class | ||||
3640 | type. */ | ||||
3641 | ptrmem_type = TREE_TYPE (ptrmem)((contains_struct_check ((ptrmem), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3641, __FUNCTION__))->typed.type); | ||||
3642 | gcc_assert (TYPE_PTRMEMFUNC_P (ptrmem_type))((void)(!((((enum tree_code) (ptrmem_type)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((ptrmem_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3642, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3642, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3642, __FUNCTION__), 0 : 0)); | ||||
3643 | for (member = TYPE_FIELDS (ptrmem_type)((tree_check3 ((ptrmem_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3643, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); member; | ||||
3644 | member = DECL_CHAIN (member)(((contains_struct_check (((contains_struct_check ((member), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3644, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3644, __FUNCTION__))->common.chain))) | ||||
3645 | if (DECL_NAME (member)((contains_struct_check ((member), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3645, __FUNCTION__))->decl_minimal.name) == member_name) | ||||
3646 | break; | ||||
3647 | return build_simple_component_ref (ptrmem, member); | ||||
3648 | } | ||||
3649 | |||||
3650 | /* Return a TREE_LIST of namespace-scope overloads for the given operator, | ||||
3651 | and for any other relevant operator. */ | ||||
3652 | |||||
3653 | static tree | ||||
3654 | op_unqualified_lookup (tree_code code, bool is_assign) | ||||
3655 | { | ||||
3656 | tree lookups = NULL_TREE(tree) __null; | ||||
3657 | |||||
3658 | if (cxx_dialect >= cxx20 && !is_assign) | ||||
3659 | { | ||||
3660 | if (code == NE_EXPR) | ||||
3661 | { | ||||
3662 | /* != can get rewritten in terms of ==. */ | ||||
3663 | tree fnname = ovl_op_identifier (false, EQ_EXPR); | ||||
3664 | if (tree fns = lookup_name (fnname, LOOK_where::BLOCK_NAMESPACE)) | ||||
3665 | lookups = tree_cons (fnname, fns, lookups); | ||||
3666 | } | ||||
3667 | else if (code == GT_EXPR || code == LE_EXPR | ||||
3668 | || code == LT_EXPR || code == GE_EXPR) | ||||
3669 | { | ||||
3670 | /* These can get rewritten in terms of <=>. */ | ||||
3671 | tree fnname = ovl_op_identifier (false, SPACESHIP_EXPR); | ||||
3672 | if (tree fns = lookup_name (fnname, LOOK_where::BLOCK_NAMESPACE)) | ||||
3673 | lookups = tree_cons (fnname, fns, lookups); | ||||
3674 | } | ||||
3675 | } | ||||
3676 | |||||
3677 | tree fnname = ovl_op_identifier (is_assign, code); | ||||
3678 | if (tree fns = lookup_name (fnname, LOOK_where::BLOCK_NAMESPACE)) | ||||
3679 | lookups = tree_cons (fnname, fns, lookups); | ||||
3680 | |||||
3681 | if (lookups) | ||||
3682 | return lookups; | ||||
3683 | else | ||||
3684 | return build_tree_list (NULL_TREE(tree) __null, NULL_TREE(tree) __null); | ||||
3685 | } | ||||
3686 | |||||
3687 | /* Create a DEPENDENT_OPERATOR_TYPE for a dependent operator expression of | ||||
3688 | the given operator. LOOKUPS, if non-NULL, is the result of phase 1 | ||||
3689 | name lookup for the given operator. */ | ||||
3690 | |||||
3691 | tree | ||||
3692 | build_dependent_operator_type (tree lookups, tree_code code, bool is_assign) | ||||
3693 | { | ||||
3694 | if (lookups) | ||||
3695 | /* We're partially instantiating a dependent operator expression, and | ||||
3696 | LOOKUPS is the result of phase 1 name lookup that we performed | ||||
3697 | earlier at template definition time, so just reuse the corresponding | ||||
3698 | DEPENDENT_OPERATOR_TYPE. */ | ||||
3699 | return TREE_TYPE (lookups)((contains_struct_check ((lookups), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3699, __FUNCTION__))->typed.type); | ||||
3700 | |||||
3701 | /* Otherwise we're processing a dependent operator expression at template | ||||
3702 | definition time, so perform phase 1 name lookup now. */ | ||||
3703 | lookups = op_unqualified_lookup (code, is_assign); | ||||
3704 | |||||
3705 | tree type = cxx_make_type (DEPENDENT_OPERATOR_TYPE); | ||||
3706 | DEPENDENT_OPERATOR_TYPE_SAVED_LOOKUPS (type)((tree_class_check (((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3706, __FUNCTION__, (DEPENDENT_OPERATOR_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3706, __FUNCTION__))->type_non_common.values) = lookups; | ||||
3707 | TREE_TYPE (lookups)((contains_struct_check ((lookups), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3707, __FUNCTION__))->typed.type) = type; | ||||
3708 | return type; | ||||
3709 | } | ||||
3710 | |||||
3711 | /* Given an expression PTR for a pointer, return an expression | ||||
3712 | for the value pointed to. | ||||
3713 | ERRORSTRING is the name of the operator to appear in error messages. | ||||
3714 | |||||
3715 | This function may need to overload OPERATOR_FNNAME. | ||||
3716 | Must also handle REFERENCE_TYPEs for C++. */ | ||||
3717 | |||||
3718 | tree | ||||
3719 | build_x_indirect_ref (location_t loc, tree expr, ref_operator errorstring, | ||||
3720 | tree lookups, tsubst_flags_t complain) | ||||
3721 | { | ||||
3722 | tree orig_expr = expr; | ||||
3723 | tree rval; | ||||
3724 | tree overload = NULL_TREE(tree) __null; | ||||
3725 | |||||
3726 | if (processing_template_declscope_chain->x_processing_template_decl) | ||||
3727 | { | ||||
3728 | /* Retain the type if we know the operand is a pointer. */ | ||||
3729 | if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3729, __FUNCTION__))->typed.type) && INDIRECT_TYPE_P (TREE_TYPE (expr))((((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3729, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE ) || (((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3729, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE ))) | ||||
3730 | { | ||||
3731 | if (expr == current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain ->x_current_class_ptr)) | ||||
3732 | || (TREE_CODE (expr)((enum tree_code) (expr)->base.code) == NOP_EXPR | ||||
3733 | && TREE_OPERAND (expr, 0)(*((const_cast<tree*> (tree_operand_check ((expr), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3733, __FUNCTION__))))) == current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain ->x_current_class_ptr)) | ||||
3734 | && (same_type_ignoring_top_level_qualifiers_p | ||||
3735 | (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3735, __FUNCTION__))->typed.type), TREE_TYPE (current_class_ptr)((contains_struct_check (((*((cfun + 0) && ((cfun + 0 )->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain->x_current_class_ptr))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3735, __FUNCTION__))->typed.type))))) | ||||
3736 | return current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ref : &scope_chain ->x_current_class_ref)); | ||||
3737 | return build_min (INDIRECT_REF, TREE_TYPE (TREE_TYPE (expr))((contains_struct_check ((((contains_struct_check ((expr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3737, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3737, __FUNCTION__))->typed.type), expr); | ||||
3738 | } | ||||
3739 | if (type_dependent_expression_p (expr)) | ||||
3740 | { | ||||
3741 | expr = build_min_nt_loc (loc, INDIRECT_REF, expr); | ||||
3742 | TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3742, __FUNCTION__))->typed.type) | ||||
3743 | = build_dependent_operator_type (lookups, INDIRECT_REF, false); | ||||
3744 | return expr; | ||||
3745 | } | ||||
3746 | expr = build_non_dependent_expr (expr); | ||||
3747 | } | ||||
3748 | |||||
3749 | rval = build_new_op (loc, INDIRECT_REF, LOOKUP_NORMAL((1 << 0)), expr, | ||||
3750 | NULL_TREE(tree) __null, NULL_TREE(tree) __null, lookups, | ||||
3751 | &overload, complain); | ||||
3752 | if (!rval) | ||||
3753 | rval = cp_build_indirect_ref (loc, expr, errorstring, complain); | ||||
3754 | |||||
3755 | if (processing_template_declscope_chain->x_processing_template_decl && rval != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3756 | { | ||||
3757 | if (overload != NULL_TREE(tree) __null) | ||||
3758 | return (build_min_non_dep_op_overload | ||||
3759 | (INDIRECT_REF, rval, overload, orig_expr)); | ||||
3760 | |||||
3761 | return build_min_non_dep (INDIRECT_REF, rval, orig_expr); | ||||
3762 | } | ||||
3763 | else | ||||
3764 | return rval; | ||||
3765 | } | ||||
3766 | |||||
3767 | /* Like c-family strict_aliasing_warning, but don't warn for dependent | ||||
3768 | types or expressions. */ | ||||
3769 | |||||
3770 | static bool | ||||
3771 | cp_strict_aliasing_warning (location_t loc, tree type, tree expr) | ||||
3772 | { | ||||
3773 | if (processing_template_declscope_chain->x_processing_template_decl) | ||||
3774 | { | ||||
3775 | tree e = expr; | ||||
3776 | STRIP_NOPS (e)(e) = tree_strip_nop_conversions ((const_cast<union tree_node *> (((e))))); | ||||
3777 | if (dependent_type_p (type) || type_dependent_expression_p (e)) | ||||
3778 | return false; | ||||
3779 | } | ||||
3780 | return strict_aliasing_warning (loc, type, expr); | ||||
3781 | } | ||||
3782 | |||||
3783 | /* The implementation of the above, and of indirection implied by other | ||||
3784 | constructs. If DO_FOLD is true, fold away INDIRECT_REF of ADDR_EXPR. */ | ||||
3785 | |||||
3786 | static tree | ||||
3787 | cp_build_indirect_ref_1 (location_t loc, tree ptr, ref_operator errorstring, | ||||
3788 | tsubst_flags_t complain, bool do_fold) | ||||
3789 | { | ||||
3790 | tree pointer, type; | ||||
3791 | |||||
3792 | /* RO_NULL should only be used with the folding entry points below, not | ||||
3793 | cp_build_indirect_ref. */ | ||||
3794 | gcc_checking_assert (errorstring != RO_NULL || do_fold)((void)(!(errorstring != RO_NULL || do_fold) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3794, __FUNCTION__), 0 : 0)); | ||||
3795 | |||||
3796 | if (ptr == current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain ->x_current_class_ptr)) | ||||
3797 | || (TREE_CODE (ptr)((enum tree_code) (ptr)->base.code) == NOP_EXPR | ||||
3798 | && TREE_OPERAND (ptr, 0)(*((const_cast<tree*> (tree_operand_check ((ptr), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3798, __FUNCTION__))))) == current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain ->x_current_class_ptr)) | ||||
3799 | && (same_type_ignoring_top_level_qualifiers_p | ||||
3800 | (TREE_TYPE (ptr)((contains_struct_check ((ptr), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3800, __FUNCTION__))->typed.type), TREE_TYPE (current_class_ptr)((contains_struct_check (((*((cfun + 0) && ((cfun + 0 )->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain->x_current_class_ptr))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3800, __FUNCTION__))->typed.type))))) | ||||
3801 | return current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ref : &scope_chain ->x_current_class_ref)); | ||||
3802 | |||||
3803 | pointer = (TYPE_REF_P (TREE_TYPE (ptr))(((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3803, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE ) | ||||
3804 | ? ptr : decay_conversion (ptr, complain)); | ||||
3805 | if (pointer == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3806 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3807 | |||||
3808 | type = TREE_TYPE (pointer)((contains_struct_check ((pointer), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3808, __FUNCTION__))->typed.type); | ||||
3809 | |||||
3810 | if (INDIRECT_TYPE_P (type)((((enum tree_code) (type)->base.code) == POINTER_TYPE) || (((enum tree_code) (type)->base.code) == REFERENCE_TYPE))) | ||||
3811 | { | ||||
3812 | /* [expr.unary.op] | ||||
3813 | |||||
3814 | If the type of the expression is "pointer to T," the type | ||||
3815 | of the result is "T." */ | ||||
3816 | tree t = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3816, __FUNCTION__))->typed.type); | ||||
3817 | |||||
3818 | if ((CONVERT_EXPR_P (ptr)((((enum tree_code) (ptr)->base.code)) == NOP_EXPR || (((enum tree_code) (ptr)->base.code)) == CONVERT_EXPR) | ||||
3819 | || TREE_CODE (ptr)((enum tree_code) (ptr)->base.code) == VIEW_CONVERT_EXPR) | ||||
3820 | && (!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/typeck.cc" , 3820, __FUNCTION__))->type_common.lang_flag_5)) || !CLASSTYPE_EMPTY_P (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3820, __FUNCTION__))->type_with_lang_specific.lang_specific ))->empty_p))) | ||||
3821 | { | ||||
3822 | /* If a warning is issued, mark it to avoid duplicates from | ||||
3823 | the backend. This only needs to be done at | ||||
3824 | warn_strict_aliasing > 2. */ | ||||
3825 | if (warn_strict_aliasingglobal_options.x_warn_strict_aliasing > 2 | ||||
3826 | && cp_strict_aliasing_warning (EXPR_LOCATION (ptr)((((ptr)) && ((tree_code_type_tmpl <0>::tree_code_type [(int) (((enum tree_code) ((ptr))->base.code))]) >= tcc_reference && (tree_code_type_tmpl <0>::tree_code_type[(int ) (((enum tree_code) ((ptr))->base.code))]) <= tcc_expression )) ? (ptr)->exp.locus : ((location_t) 0)), | ||||
3827 | type, TREE_OPERAND (ptr, 0)(*((const_cast<tree*> (tree_operand_check ((ptr), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3827, __FUNCTION__))))))) | ||||
3828 | suppress_warning (ptr, OPT_Wstrict_aliasing); | ||||
3829 | } | ||||
3830 | |||||
3831 | if (VOID_TYPE_P (t)(((enum tree_code) (t)->base.code) == VOID_TYPE)) | ||||
3832 | { | ||||
3833 | /* A pointer to incomplete type (other than cv void) can be | ||||
3834 | dereferenced [expr.unary.op]/1 */ | ||||
3835 | if (complain & tf_error) | ||||
3836 | error_at (loc, "%qT is not a pointer-to-object type", type); | ||||
3837 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3838 | } | ||||
3839 | else if (do_fold && TREE_CODE (pointer)((enum tree_code) (pointer)->base.code) == ADDR_EXPR | ||||
3840 | && same_type_p (t, TREE_TYPE (TREE_OPERAND (pointer, 0)))comptypes ((t), (((contains_struct_check (((*((const_cast< tree*> (tree_operand_check ((pointer), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3840, __FUNCTION__)))))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3840, __FUNCTION__))->typed.type)), 0)) | ||||
3841 | /* The POINTER was something like `&x'. We simplify `*&x' to | ||||
3842 | `x'. */ | ||||
3843 | return TREE_OPERAND (pointer, 0)(*((const_cast<tree*> (tree_operand_check ((pointer), ( 0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3843, __FUNCTION__))))); | ||||
3844 | else | ||||
3845 | { | ||||
3846 | tree ref = build1 (INDIRECT_REF, t, pointer); | ||||
3847 | |||||
3848 | /* We *must* set TREE_READONLY when dereferencing a pointer to const, | ||||
3849 | so that we get the proper error message if the result is used | ||||
3850 | to assign to. Also, &* is supposed to be a no-op. */ | ||||
3851 | TREE_READONLY (ref)((non_type_check ((ref), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3851, __FUNCTION__))->base.readonly_flag) = CP_TYPE_CONST_P (t)((cp_type_quals (t) & TYPE_QUAL_CONST) != 0); | ||||
3852 | TREE_THIS_VOLATILE (ref)((ref)->base.volatile_flag) = CP_TYPE_VOLATILE_P (t)((cp_type_quals (t) & TYPE_QUAL_VOLATILE) != 0); | ||||
3853 | TREE_SIDE_EFFECTS (ref)((non_type_check ((ref), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3853, __FUNCTION__))->base.side_effects_flag) | ||||
3854 | = (TREE_THIS_VOLATILE (ref)((ref)->base.volatile_flag) || TREE_SIDE_EFFECTS (pointer)((non_type_check ((pointer), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3854, __FUNCTION__))->base.side_effects_flag)); | ||||
3855 | return ref; | ||||
3856 | } | ||||
3857 | } | ||||
3858 | else if (!(complain & tf_error)) | ||||
3859 | /* Don't emit any errors; we'll just return ERROR_MARK_NODE later. */ | ||||
3860 | ; | ||||
3861 | /* `pointer' won't be an error_mark_node if we were given a | ||||
3862 | pointer to member, so it's cool to check for this here. */ | ||||
3863 | else if (TYPE_PTRMEM_P (type)((((enum tree_code) (type)->base.code) == OFFSET_TYPE) || ( ((enum tree_code) (type)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3863, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3863, __FUNCTION__))->type_common.lang_flag_2))))) | ||||
3864 | switch (errorstring) | ||||
3865 | { | ||||
3866 | case RO_ARRAY_INDEXING: | ||||
3867 | error_at (loc, | ||||
3868 | "invalid use of array indexing on pointer to member"); | ||||
3869 | break; | ||||
3870 | case RO_UNARY_STAR: | ||||
3871 | error_at (loc, "invalid use of unary %<*%> on pointer to member"); | ||||
3872 | break; | ||||
3873 | case RO_IMPLICIT_CONVERSION: | ||||
3874 | error_at (loc, "invalid use of implicit conversion on pointer " | ||||
3875 | "to member"); | ||||
3876 | break; | ||||
3877 | case RO_ARROW_STAR: | ||||
3878 | error_at (loc, "left hand operand of %<->*%> must be a pointer to " | ||||
3879 | "class, but is a pointer to member of type %qT", type); | ||||
3880 | break; | ||||
3881 | default: | ||||
3882 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3882, __FUNCTION__)); | ||||
3883 | } | ||||
3884 | else if (pointer != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3885 | invalid_indirection_error (loc, type, errorstring); | ||||
3886 | |||||
3887 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3888 | } | ||||
3889 | |||||
3890 | /* Entry point used by c-common, which expects folding. */ | ||||
3891 | |||||
3892 | tree | ||||
3893 | build_indirect_ref (location_t loc, tree ptr, ref_operator errorstring) | ||||
3894 | { | ||||
3895 | return cp_build_indirect_ref_1 (loc, ptr, errorstring, | ||||
3896 | tf_warning_or_error, true); | ||||
3897 | } | ||||
3898 | |||||
3899 | /* Entry point used by internal indirection needs that don't correspond to any | ||||
3900 | syntactic construct. */ | ||||
3901 | |||||
3902 | tree | ||||
3903 | cp_build_fold_indirect_ref (tree pointer) | ||||
3904 | { | ||||
3905 | return cp_build_indirect_ref_1 (input_location, pointer, RO_NULL, | ||||
3906 | tf_warning_or_error, true); | ||||
3907 | } | ||||
3908 | |||||
3909 | /* Entry point used by indirection needs that correspond to some syntactic | ||||
3910 | construct. */ | ||||
3911 | |||||
3912 | tree | ||||
3913 | cp_build_indirect_ref (location_t loc, tree ptr, ref_operator errorstring, | ||||
3914 | tsubst_flags_t complain) | ||||
3915 | { | ||||
3916 | return cp_build_indirect_ref_1 (loc, ptr, errorstring, complain, false); | ||||
3917 | } | ||||
3918 | |||||
3919 | /* This handles expressions of the form "a[i]", which denotes | ||||
3920 | an array reference. | ||||
3921 | |||||
3922 | This is logically equivalent in C to *(a+i), but we may do it differently. | ||||
3923 | If A is a variable or a member, we generate a primitive ARRAY_REF. | ||||
3924 | This avoids forcing the array out of registers, and can work on | ||||
3925 | arrays that are not lvalues (for example, members of structures returned | ||||
3926 | by functions). | ||||
3927 | |||||
3928 | If INDEX is of some user-defined type, it must be converted to | ||||
3929 | integer type. Otherwise, to make a compatible PLUS_EXPR, it | ||||
3930 | will inherit the type of the array, which will be some pointer type. | ||||
3931 | |||||
3932 | LOC is the location to use in building the array reference. */ | ||||
3933 | |||||
3934 | tree | ||||
3935 | cp_build_array_ref (location_t loc, tree array, tree idx, | ||||
3936 | tsubst_flags_t complain) | ||||
3937 | { | ||||
3938 | tree ret; | ||||
3939 | |||||
3940 | if (idx == 0) | ||||
3941 | { | ||||
3942 | if (complain & tf_error) | ||||
3943 | error_at (loc, "subscript missing in array reference"); | ||||
3944 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3945 | } | ||||
3946 | |||||
3947 | if (TREE_TYPE (array)((contains_struct_check ((array), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3947, __FUNCTION__))->typed.type) == error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
3948 | || TREE_TYPE (idx)((contains_struct_check ((idx), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3948, __FUNCTION__))->typed.type) == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3949 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3950 | |||||
3951 | /* If ARRAY is a COMPOUND_EXPR or COND_EXPR, move our reference | ||||
3952 | inside it. */ | ||||
3953 | switch (TREE_CODE (array)((enum tree_code) (array)->base.code)) | ||||
3954 | { | ||||
3955 | case COMPOUND_EXPR: | ||||
3956 | { | ||||
3957 | tree value = cp_build_array_ref (loc, TREE_OPERAND (array, 1)(*((const_cast<tree*> (tree_operand_check ((array), (1) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3957, __FUNCTION__))))), idx, | ||||
3958 | complain); | ||||
3959 | ret = build2 (COMPOUND_EXPR, TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3959, __FUNCTION__))->typed.type), | ||||
3960 | TREE_OPERAND (array, 0)(*((const_cast<tree*> (tree_operand_check ((array), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3960, __FUNCTION__))))), value); | ||||
3961 | SET_EXPR_LOCATION (ret, loc)(expr_check (((ret)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3961, __FUNCTION__))->exp.locus = (loc); | ||||
3962 | return ret; | ||||
3963 | } | ||||
3964 | |||||
3965 | case COND_EXPR: | ||||
3966 | ret = build_conditional_expr | ||||
3967 | (loc, TREE_OPERAND (array, 0)(*((const_cast<tree*> (tree_operand_check ((array), (0) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3967, __FUNCTION__))))), | ||||
3968 | cp_build_array_ref (loc, TREE_OPERAND (array, 1)(*((const_cast<tree*> (tree_operand_check ((array), (1) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3968, __FUNCTION__))))), idx, | ||||
3969 | complain), | ||||
3970 | cp_build_array_ref (loc, TREE_OPERAND (array, 2)(*((const_cast<tree*> (tree_operand_check ((array), (2) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3970, __FUNCTION__))))), idx, | ||||
3971 | complain), | ||||
3972 | complain); | ||||
3973 | protected_set_expr_location (ret, loc); | ||||
3974 | return ret; | ||||
3975 | |||||
3976 | default: | ||||
3977 | break; | ||||
3978 | } | ||||
3979 | |||||
3980 | bool non_lvalue = convert_vector_to_array_for_subscript (loc, &array, idx); | ||||
3981 | |||||
3982 | if (TREE_CODE (TREE_TYPE (array))((enum tree_code) (((contains_struct_check ((array), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3982, __FUNCTION__))->typed.type))->base.code) == ARRAY_TYPE) | ||||
3983 | { | ||||
3984 | tree rval, type; | ||||
3985 | |||||
3986 | warn_array_subscript_with_type_char (loc, idx); | ||||
3987 | |||||
3988 | if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (idx))((((enum tree_code) (((contains_struct_check ((idx), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3988, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE && !((tree_check ((((contains_struct_check ((idx), ( TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3988, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3988, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag) ) || (((enum tree_code) (((contains_struct_check ((idx), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3988, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((idx), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 3988, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ))) | ||||
3989 | { | ||||
3990 | if (complain & tf_error) | ||||
3991 | error_at (loc, "array subscript is not an integer"); | ||||
3992 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
3993 | } | ||||
3994 | |||||
3995 | /* Apply integral promotions *after* noticing character types. | ||||
3996 | (It is unclear why we do these promotions -- the standard | ||||
3997 | does not say that we should. In fact, the natural thing would | ||||
3998 | seem to be to convert IDX to ptrdiff_t; we're performing | ||||
3999 | pointer arithmetic.) */ | ||||
4000 | idx = cp_perform_integral_promotions (idx, complain); | ||||
4001 | |||||
4002 | idx = maybe_fold_non_dependent_expr (idx, complain); | ||||
4003 | |||||
4004 | /* An array that is indexed by a non-constant | ||||
4005 | cannot be stored in a register; we must be able to do | ||||
4006 | address arithmetic on its address. | ||||
4007 | Likewise an array of elements of variable size. */ | ||||
4008 | if (TREE_CODE (idx)((enum tree_code) (idx)->base.code) != INTEGER_CST | ||||
4009 | || (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (array)))(((tree_class_check ((((contains_struct_check ((((contains_struct_check ((array), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4009, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4009, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4009, __FUNCTION__))->type_common.size) != (tree) __null ) | ||||
4010 | && (TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))))((enum tree_code) (((tree_class_check ((((contains_struct_check ((((contains_struct_check ((array), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4010, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4010, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4010, __FUNCTION__))->type_common.size))->base.code) | ||||
4011 | != INTEGER_CST))) | ||||
4012 | { | ||||
4013 | if (!cxx_mark_addressable (array, true)) | ||||
4014 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4015 | } | ||||
4016 | |||||
4017 | /* An array that is indexed by a constant value which is not within | ||||
4018 | the array bounds cannot be stored in a register either; because we | ||||
4019 | would get a crash in store_bit_field/extract_bit_field when trying | ||||
4020 | to access a non-existent part of the register. */ | ||||
4021 | if (TREE_CODE (idx)((enum tree_code) (idx)->base.code) == INTEGER_CST | ||||
4022 | && TYPE_DOMAIN (TREE_TYPE (array))((tree_check ((((contains_struct_check ((array), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4022, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4022, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ) | ||||
4023 | && ! int_fits_type_p (idx, TYPE_DOMAIN (TREE_TYPE (array))((tree_check ((((contains_struct_check ((array), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4023, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4023, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ))) | ||||
4024 | { | ||||
4025 | if (!cxx_mark_addressable (array)) | ||||
4026 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4027 | } | ||||
4028 | |||||
4029 | /* Note in C++ it is valid to subscript a `register' array, since | ||||
4030 | it is valid to take the address of something with that | ||||
4031 | storage specification. */ | ||||
4032 | if (extra_warningsglobal_options.x_extra_warnings) | ||||
4033 | { | ||||
4034 | tree foo = array; | ||||
4035 | while (TREE_CODE (foo)((enum tree_code) (foo)->base.code) == COMPONENT_REF) | ||||
4036 | foo = TREE_OPERAND (foo, 0)(*((const_cast<tree*> (tree_operand_check ((foo), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4036, __FUNCTION__))))); | ||||
4037 | if (VAR_P (foo)(((enum tree_code) (foo)->base.code) == VAR_DECL) && DECL_REGISTER (foo)((contains_struct_check ((foo), (TS_DECL_WRTL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4037, __FUNCTION__))->decl_common.decl_flag_0) | ||||
4038 | && (complain & tf_warning)) | ||||
4039 | warning_at (loc, OPT_Wextra, | ||||
4040 | "subscripting array declared %<register%>"); | ||||
4041 | } | ||||
4042 | |||||
4043 | type = TREE_TYPE (TREE_TYPE (array))((contains_struct_check ((((contains_struct_check ((array), ( TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4043, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4043, __FUNCTION__))->typed.type); | ||||
4044 | rval = build4 (ARRAY_REF, type, array, idx, NULL_TREE(tree) __null, NULL_TREE(tree) __null); | ||||
4045 | /* Array ref is const/volatile if the array elements are | ||||
4046 | or if the array is.. */ | ||||
4047 | TREE_READONLY (rval)((non_type_check ((rval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4047, __FUNCTION__))->base.readonly_flag) | ||||
4048 | |= (CP_TYPE_CONST_P (type)((cp_type_quals (type) & TYPE_QUAL_CONST) != 0) | TREE_READONLY (array)((non_type_check ((array), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4048, __FUNCTION__))->base.readonly_flag)); | ||||
4049 | TREE_SIDE_EFFECTS (rval)((non_type_check ((rval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4049, __FUNCTION__))->base.side_effects_flag) | ||||
4050 | |= (CP_TYPE_VOLATILE_P (type)((cp_type_quals (type) & TYPE_QUAL_VOLATILE) != 0) | TREE_SIDE_EFFECTS (array)((non_type_check ((array), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4050, __FUNCTION__))->base.side_effects_flag)); | ||||
4051 | TREE_THIS_VOLATILE (rval)((rval)->base.volatile_flag) | ||||
4052 | |= (CP_TYPE_VOLATILE_P (type)((cp_type_quals (type) & TYPE_QUAL_VOLATILE) != 0) | TREE_THIS_VOLATILE (array)((array)->base.volatile_flag)); | ||||
4053 | ret = require_complete_type (rval, complain); | ||||
4054 | protected_set_expr_location (ret, loc); | ||||
4055 | if (non_lvalue) | ||||
4056 | ret = non_lvalue_loc (loc, ret); | ||||
4057 | return ret; | ||||
4058 | } | ||||
4059 | |||||
4060 | { | ||||
4061 | tree ar = cp_default_conversion (array, complain); | ||||
4062 | tree ind = cp_default_conversion (idx, complain); | ||||
4063 | tree first = NULL_TREE(tree) __null; | ||||
4064 | |||||
4065 | if (flag_strong_eval_orderglobal_options.x_flag_strong_eval_order == 2 && TREE_SIDE_EFFECTS (ind)((non_type_check ((ind), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4065, __FUNCTION__))->base.side_effects_flag)) | ||||
4066 | ar = first = save_expr (ar); | ||||
4067 | |||||
4068 | /* Put the integer in IND to simplify error checking. */ | ||||
4069 | if (TREE_CODE (TREE_TYPE (ar))((enum tree_code) (((contains_struct_check ((ar), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4069, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE) | ||||
4070 | std::swap (ar, ind); | ||||
4071 | |||||
4072 | if (ar == error_mark_nodeglobal_trees[TI_ERROR_MARK] || ind == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4073 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4074 | |||||
4075 | if (!TYPE_PTR_P (TREE_TYPE (ar))(((enum tree_code) (((contains_struct_check ((ar), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4075, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE )) | ||||
4076 | { | ||||
4077 | if (complain & tf_error) | ||||
4078 | error_at (loc, "subscripted value is neither array nor pointer"); | ||||
4079 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4080 | } | ||||
4081 | if (TREE_CODE (TREE_TYPE (ind))((enum tree_code) (((contains_struct_check ((ind), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4081, __FUNCTION__))->typed.type))->base.code) != INTEGER_TYPE) | ||||
4082 | { | ||||
4083 | if (complain & tf_error) | ||||
4084 | error_at (loc, "array subscript is not an integer"); | ||||
4085 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4086 | } | ||||
4087 | |||||
4088 | warn_array_subscript_with_type_char (loc, idx); | ||||
4089 | |||||
4090 | ret = cp_build_binary_op (input_location, PLUS_EXPR, ar, ind, complain); | ||||
4091 | if (first) | ||||
4092 | ret = build2_loc (loc, COMPOUND_EXPR, TREE_TYPE (ret)((contains_struct_check ((ret), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4092, __FUNCTION__))->typed.type), first, ret); | ||||
4093 | ret = cp_build_indirect_ref (loc, ret, RO_ARRAY_INDEXING, complain); | ||||
4094 | protected_set_expr_location (ret, loc); | ||||
4095 | if (non_lvalue) | ||||
4096 | ret = non_lvalue_loc (loc, ret); | ||||
4097 | return ret; | ||||
4098 | } | ||||
4099 | } | ||||
4100 | |||||
4101 | /* Entry point for Obj-C++. */ | ||||
4102 | |||||
4103 | tree | ||||
4104 | build_array_ref (location_t loc, tree array, tree idx) | ||||
4105 | { | ||||
4106 | return cp_build_array_ref (loc, array, idx, tf_warning_or_error); | ||||
4107 | } | ||||
4108 | |||||
4109 | /* Resolve a pointer to member function. INSTANCE is the object | ||||
4110 | instance to use, if the member points to a virtual member. | ||||
4111 | |||||
4112 | This used to avoid checking for virtual functions if basetype | ||||
4113 | has no virtual functions, according to an earlier ANSI draft. | ||||
4114 | With the final ISO C++ rules, such an optimization is | ||||
4115 | incorrect: A pointer to a derived member can be static_cast | ||||
4116 | to pointer-to-base-member, as long as the dynamic object | ||||
4117 | later has the right member. So now we only do this optimization | ||||
4118 | when we know the dynamic type of the object. */ | ||||
4119 | |||||
4120 | tree | ||||
4121 | get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function, | ||||
4122 | tsubst_flags_t complain) | ||||
4123 | { | ||||
4124 | if (TREE_CODE (function)((enum tree_code) (function)->base.code) == OFFSET_REF) | ||||
4125 | function = TREE_OPERAND (function, 1)(*((const_cast<tree*> (tree_operand_check ((function), ( 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4125, __FUNCTION__))))); | ||||
4126 | |||||
4127 | if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function))(((enum tree_code) (((contains_struct_check ((function), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4127, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4127, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4127, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4127, __FUNCTION__))->type_common.lang_flag_2)))) | ||||
4128 | { | ||||
4129 | tree idx, delta, e1, e2, e3, vtbl; | ||||
4130 | bool nonvirtual; | ||||
4131 | tree fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function))(cp_build_qualified_type (((contains_struct_check ((((tree_check3 ((((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4131, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4131, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4131, __FUNCTION__))->typed.type), cp_type_quals (((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4131, __FUNCTION__))->typed.type)))); | ||||
4132 | tree basetype = TYPE_METHOD_BASETYPE (TREE_TYPE (fntype))((tree_check2 ((((contains_struct_check ((fntype), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4132, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4132, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval); | ||||
4133 | |||||
4134 | tree instance_ptr = *instance_ptrptr; | ||||
4135 | tree instance_save_expr = 0; | ||||
4136 | if (instance_ptr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4137 | { | ||||
4138 | if (TREE_CODE (function)((enum tree_code) (function)->base.code) == PTRMEM_CST) | ||||
4139 | { | ||||
4140 | /* Extracting the function address from a pmf is only | ||||
4141 | allowed with -Wno-pmf-conversions. It only works for | ||||
4142 | pmf constants. */ | ||||
4143 | e1 = build_addr_func (PTRMEM_CST_MEMBER (function)(((ptrmem_cst_t)(tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4143, __FUNCTION__, (PTRMEM_CST))))->member), complain); | ||||
4144 | e1 = convert (fntype, e1); | ||||
4145 | return e1; | ||||
4146 | } | ||||
4147 | else | ||||
4148 | { | ||||
4149 | if (complain & tf_error) | ||||
4150 | error ("object missing in use of %qE", function); | ||||
4151 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4152 | } | ||||
4153 | } | ||||
4154 | |||||
4155 | /* True if we know that the dynamic type of the object doesn't have | ||||
4156 | virtual functions, so we can assume the PFN field is a pointer. */ | ||||
4157 | nonvirtual = (COMPLETE_TYPE_P (basetype)(((tree_class_check ((basetype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4157, __FUNCTION__))->type_common.size) != (tree) __null ) | ||||
4158 | && !TYPE_POLYMORPHIC_P (basetype)(((tree_not_check2 ((basetype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4158, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) | ||||
4159 | && resolves_to_fixed_type_p (instance_ptr, 0)); | ||||
4160 | |||||
4161 | /* If we don't really have an object (i.e. in an ill-formed | ||||
4162 | conversion from PMF to pointer), we can't resolve virtual | ||||
4163 | functions anyway. */ | ||||
4164 | if (!nonvirtual && is_dummy_object (instance_ptr)) | ||||
4165 | nonvirtual = true; | ||||
4166 | |||||
4167 | if (TREE_SIDE_EFFECTS (instance_ptr)((non_type_check ((instance_ptr), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4167, __FUNCTION__))->base.side_effects_flag)) | ||||
4168 | instance_ptr = instance_save_expr = save_expr (instance_ptr); | ||||
4169 | |||||
4170 | if (TREE_SIDE_EFFECTS (function)((non_type_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4170, __FUNCTION__))->base.side_effects_flag)) | ||||
4171 | function = save_expr (function); | ||||
4172 | |||||
4173 | /* Start by extracting all the information from the PMF itself. */ | ||||
4174 | e3 = pfn_from_ptrmemfunc (function); | ||||
4175 | delta = delta_from_ptrmemfunc (function); | ||||
4176 | idx = build1 (NOP_EXPR, vtable_index_typecp_global_trees[CPTI_VTABLE_INDEX_TYPE], e3); | ||||
4177 | switch (TARGET_PTRMEMFUNC_VBIT_LOCATIONptrmemfunc_vbit_in_pfn) | ||||
4178 | { | ||||
4179 | int flag_sanitize_save; | ||||
4180 | case ptrmemfunc_vbit_in_pfn: | ||||
4181 | e1 = cp_build_binary_op (input_location, | ||||
4182 | BIT_AND_EXPR, idx, integer_one_nodeglobal_trees[TI_INTEGER_ONE], | ||||
4183 | complain); | ||||
4184 | idx = cp_build_binary_op (input_location, | ||||
4185 | MINUS_EXPR, idx, integer_one_nodeglobal_trees[TI_INTEGER_ONE], | ||||
4186 | complain); | ||||
4187 | if (idx == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4188 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4189 | break; | ||||
4190 | |||||
4191 | case ptrmemfunc_vbit_in_delta: | ||||
4192 | e1 = cp_build_binary_op (input_location, | ||||
4193 | BIT_AND_EXPR, delta, integer_one_nodeglobal_trees[TI_INTEGER_ONE], | ||||
4194 | complain); | ||||
4195 | /* Don't instrument the RSHIFT_EXPR we're about to create because | ||||
4196 | we're going to use DELTA number of times, and that wouldn't play | ||||
4197 | well with SAVE_EXPRs therein. */ | ||||
4198 | flag_sanitize_save = flag_sanitizeglobal_options.x_flag_sanitize; | ||||
4199 | flag_sanitizeglobal_options.x_flag_sanitize = 0; | ||||
4200 | delta = cp_build_binary_op (input_location, | ||||
4201 | RSHIFT_EXPR, delta, integer_one_nodeglobal_trees[TI_INTEGER_ONE], | ||||
4202 | complain); | ||||
4203 | flag_sanitizeglobal_options.x_flag_sanitize = flag_sanitize_save; | ||||
4204 | if (delta == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4205 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4206 | break; | ||||
4207 | |||||
4208 | default: | ||||
4209 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4209, __FUNCTION__)); | ||||
4210 | } | ||||
4211 | |||||
4212 | if (e1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4213 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4214 | |||||
4215 | /* Convert down to the right base before using the instance. A | ||||
4216 | special case is that in a pointer to member of class C, C may | ||||
4217 | be incomplete. In that case, the function will of course be | ||||
4218 | a member of C, and no conversion is required. In fact, | ||||
4219 | lookup_base will fail in that case, because incomplete | ||||
4220 | classes do not have BINFOs. */ | ||||
4221 | if (!same_type_ignoring_top_level_qualifiers_p | ||||
4222 | (basetype, TREE_TYPE (TREE_TYPE (instance_ptr))((contains_struct_check ((((contains_struct_check ((instance_ptr ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4222, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4222, __FUNCTION__))->typed.type))) | ||||
4223 | { | ||||
4224 | basetype = lookup_base (TREE_TYPE (TREE_TYPE (instance_ptr))((contains_struct_check ((((contains_struct_check ((instance_ptr ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4224, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4224, __FUNCTION__))->typed.type), | ||||
4225 | basetype, ba_check, NULL__null, complain); | ||||
4226 | instance_ptr = build_base_path (PLUS_EXPR, instance_ptr, basetype, | ||||
4227 | 1, complain); | ||||
4228 | if (instance_ptr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4229 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4230 | } | ||||
4231 | /* ...and then the delta in the PMF. */ | ||||
4232 | instance_ptr = fold_build_pointer_plus (instance_ptr, delta)fold_build_pointer_plus_loc (((location_t) 0), instance_ptr, delta ); | ||||
4233 | |||||
4234 | /* Hand back the adjusted 'this' argument to our caller. */ | ||||
4235 | *instance_ptrptr = instance_ptr; | ||||
4236 | |||||
4237 | if (nonvirtual) | ||||
4238 | /* Now just return the pointer. */ | ||||
4239 | return e3; | ||||
4240 | |||||
4241 | /* Next extract the vtable pointer from the object. */ | ||||
4242 | vtbl = build1 (NOP_EXPR, build_pointer_type (vtbl_ptr_type_nodecp_global_trees[CPTI_VTBL_PTR_TYPE]), | ||||
4243 | instance_ptr); | ||||
4244 | vtbl = cp_build_fold_indirect_ref (vtbl); | ||||
4245 | if (vtbl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4246 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4247 | |||||
4248 | /* Finally, extract the function pointer from the vtable. */ | ||||
4249 | e2 = fold_build_pointer_plus_loc (input_location, vtbl, idx); | ||||
4250 | e2 = cp_build_fold_indirect_ref (e2); | ||||
4251 | if (e2 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4252 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4253 | TREE_CONSTANT (e2)((non_type_check ((e2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4253, __FUNCTION__))->base.constant_flag) = 1; | ||||
4254 | |||||
4255 | /* When using function descriptors, the address of the | ||||
4256 | vtable entry is treated as a function pointer. */ | ||||
4257 | if (TARGET_VTABLE_USES_DESCRIPTORS0) | ||||
4258 | e2 = build1 (NOP_EXPR, TREE_TYPE (e2)((contains_struct_check ((e2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4258, __FUNCTION__))->typed.type), | ||||
4259 | cp_build_addr_expr (e2, complain)); | ||||
4260 | |||||
4261 | e2 = fold_convert (TREE_TYPE (e3), e2)fold_convert_loc (((location_t) 0), ((contains_struct_check ( (e3), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4261, __FUNCTION__))->typed.type), e2); | ||||
4262 | e1 = build_conditional_expr (input_location, e1, e2, e3, complain); | ||||
4263 | if (e1 == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4264 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4265 | |||||
4266 | /* Make sure this doesn't get evaluated first inside one of the | ||||
4267 | branches of the COND_EXPR. */ | ||||
4268 | if (instance_save_expr) | ||||
4269 | e1 = build2 (COMPOUND_EXPR, TREE_TYPE (e1)((contains_struct_check ((e1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4269, __FUNCTION__))->typed.type), | ||||
4270 | instance_save_expr, e1); | ||||
4271 | |||||
4272 | function = e1; | ||||
4273 | } | ||||
4274 | return function; | ||||
4275 | } | ||||
4276 | |||||
4277 | /* Used by the C-common bits. */ | ||||
4278 | tree | ||||
4279 | build_function_call (location_t /*loc*/, | ||||
4280 | tree function, tree params) | ||||
4281 | { | ||||
4282 | return cp_build_function_call (function, params, tf_warning_or_error); | ||||
4283 | } | ||||
4284 | |||||
4285 | /* Used by the C-common bits. */ | ||||
4286 | tree | ||||
4287 | build_function_call_vec (location_t /*loc*/, vec<location_t> /*arg_loc*/, | ||||
4288 | tree function, vec<tree, va_gc> *params, | ||||
4289 | vec<tree, va_gc> * /*origtypes*/, tree orig_function) | ||||
4290 | { | ||||
4291 | vec<tree, va_gc> *orig_params = params; | ||||
4292 | tree ret = cp_build_function_call_vec (function, ¶ms, | ||||
4293 | tf_warning_or_error, orig_function); | ||||
4294 | |||||
4295 | /* cp_build_function_call_vec can reallocate PARAMS by adding | ||||
4296 | default arguments. That should never happen here. Verify | ||||
4297 | that. */ | ||||
4298 | gcc_assert (params == orig_params)((void)(!(params == orig_params) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4298, __FUNCTION__), 0 : 0)); | ||||
4299 | |||||
4300 | return ret; | ||||
4301 | } | ||||
4302 | |||||
4303 | /* Build a function call using a tree list of arguments. */ | ||||
4304 | |||||
4305 | static tree | ||||
4306 | cp_build_function_call (tree function, tree params, tsubst_flags_t complain) | ||||
4307 | { | ||||
4308 | tree ret; | ||||
4309 | |||||
4310 | releasing_vec vec; | ||||
4311 | for (; params != NULL_TREE(tree) __null; params = TREE_CHAIN (params)((contains_struct_check ((params), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4311, __FUNCTION__))->common.chain)) | ||||
4312 | vec_safe_push (vec, TREE_VALUE (params)((tree_check ((params), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4312, __FUNCTION__, (TREE_LIST)))->list.value)); | ||||
4313 | ret = cp_build_function_call_vec (function, &vec, complain); | ||||
4314 | return ret; | ||||
4315 | } | ||||
4316 | |||||
4317 | /* Build a function call using varargs. */ | ||||
4318 | |||||
4319 | tree | ||||
4320 | cp_build_function_call_nary (tree function, tsubst_flags_t complain, ...) | ||||
4321 | { | ||||
4322 | va_list args; | ||||
4323 | tree ret, t; | ||||
4324 | |||||
4325 | releasing_vec vec; | ||||
4326 | va_start (args, complain)__builtin_va_start(args, complain); | ||||
4327 | for (t = va_arg (args, tree)__builtin_va_arg(args, tree); t != NULL_TREE(tree) __null; t = va_arg (args, tree)__builtin_va_arg(args, tree)) | ||||
| |||||
4328 | vec_safe_push (vec, t); | ||||
4329 | va_end (args)__builtin_va_end(args); | ||||
4330 | ret = cp_build_function_call_vec (function, &vec, complain); | ||||
4331 | return ret; | ||||
4332 | } | ||||
4333 | |||||
4334 | /* Build a function call using a vector of arguments. | ||||
4335 | If FUNCTION is the result of resolving an overloaded target built-in, | ||||
4336 | ORIG_FNDECL is the original function decl, otherwise it is null. | ||||
4337 | PARAMS may be NULL if there are no parameters. This changes the | ||||
4338 | contents of PARAMS. */ | ||||
4339 | |||||
4340 | tree | ||||
4341 | cp_build_function_call_vec (tree function, vec<tree, va_gc> **params, | ||||
4342 | tsubst_flags_t complain, tree orig_fndecl) | ||||
4343 | { | ||||
4344 | tree fntype, fndecl; | ||||
4345 | int is_method; | ||||
4346 | tree original = function; | ||||
4347 | int nargs; | ||||
4348 | tree *argarray; | ||||
4349 | tree parm_types; | ||||
4350 | vec<tree, va_gc> *allocated = NULL__null; | ||||
4351 | tree ret; | ||||
4352 | |||||
4353 | /* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF | ||||
4354 | expressions, like those used for ObjC messenger dispatches. */ | ||||
4355 | if (params != NULL__null && !vec_safe_is_empty (*params)) | ||||
4356 | function = objc_rewrite_function_call (function, (**params)[0]); | ||||
4357 | |||||
4358 | /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue. | ||||
4359 | Strip such NOP_EXPRs, since FUNCTION is used in non-lvalue context. */ | ||||
4360 | if (TREE_CODE (function)((enum tree_code) (function)->base.code) == NOP_EXPR | ||||
4361 | && TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4361, __FUNCTION__))->typed.type) == TREE_TYPE (TREE_OPERAND (function, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check ((function), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4361, __FUNCTION__)))))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4361, __FUNCTION__))->typed.type)) | ||||
4362 | function = TREE_OPERAND (function, 0)(*((const_cast<tree*> (tree_operand_check ((function), ( 0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4362, __FUNCTION__))))); | ||||
4363 | |||||
4364 | if (TREE_CODE (function)((enum tree_code) (function)->base.code) == FUNCTION_DECL) | ||||
4365 | { | ||||
4366 | if (!mark_used (function, complain)) | ||||
4367 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4368 | fndecl = function; | ||||
4369 | |||||
4370 | /* Convert anything with function type to a pointer-to-function. */ | ||||
4371 | if (DECL_MAIN_P (function)((((((enum tree_code) (function)->base.code) == FUNCTION_DECL && !(((enum tree_code) (function)->base.code) == FUNCTION_DECL && ((contains_struct_check ((function), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __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/typeck.cc" , 4371, __FUNCTION__); <->u.fn; })->thunk_p)) && ((((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__))->decl_common.lang_specific)->u.base .language : (((enum tree_code) (function)->base.code) == FUNCTION_DECL ? lang_c : lang_cplusplus)) == lang_c)) && ((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__))->decl_minimal.name) != (tree) __null && ((tree_check ((((contains_struct_check ((function ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4371, __FUNCTION__, (IDENTIFIER_NODE))) == global_trees[TI_MAIN_IDENTIFIER ])) && flag_hosted)) | ||||
4372 | { | ||||
4373 | if (complain & tf_error) | ||||
4374 | pedwarn (input_location, OPT_Wpedantic, | ||||
4375 | "ISO C++ forbids calling %<::main%> from within program"); | ||||
4376 | else | ||||
4377 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4378 | } | ||||
4379 | function = build_addr_func (function, complain); | ||||
4380 | } | ||||
4381 | else | ||||
4382 | { | ||||
4383 | fndecl = NULL_TREE(tree) __null; | ||||
4384 | |||||
4385 | function = build_addr_func (function, complain); | ||||
4386 | } | ||||
4387 | |||||
4388 | if (function == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
4389 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4390 | |||||
4391 | fntype = TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4391, __FUNCTION__))->typed.type); | ||||
4392 | |||||
4393 | if (TYPE_PTRMEMFUNC_P (fntype)(((enum tree_code) (fntype)->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((fntype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4393, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4393, __FUNCTION__))->type_common.lang_flag_2)))) | ||||
4394 | { | ||||
4395 | if (complain & tf_error) | ||||
4396 | error ("must use %<.*%> or %<->*%> to call pointer-to-member " | ||||
4397 | "function in %<%E (...)%>, e.g. %<(... ->* %E) (...)%>", | ||||
4398 | original, original); | ||||
4399 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
4400 | } | ||||
4401 | |||||
4402 | is_method = (TYPE_PTR_P (fntype)(((enum tree_code) (fntype)->base.code) == POINTER_TYPE) | ||||
4403 | && TREE_CODE (TREE_TYPE (fntype))((enum tree_code) (((contains_struct_check ((fntype), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4403, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE); | ||||
4404 | |||||
4405 | if (!(TYPE_PTRFN_P (fntype)((((enum tree_code) (fntype)->base.code) == POINTER_TYPE) && ((enum tree_code) (((contains_struct_check ((fntype), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.cc" , 4405, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE ) | ||||
4406 | || is_method
|
11.2 | 'is_method' is 0 |
13.1 | 'params' is equal to NULL |
13.1 | 'params' is equal to NULL |
22.1 | 'nargs' is >= 0 |
22.1 | 'nargs' is >= 0 |
24 | Called C++ object pointer is null |