Bug Summary

File:build/gcc/cp/typeck.c
Warning:line 4024, column 14
Called C++ object pointer is null

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-unknown-linux-gnu -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name typeck.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -fno-split-dwarf-inlining -debugger-tuning=gdb -resource-dir /usr/lib64/clang/11.0.0 -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I cp -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/10/../../../../include/c++/10/backward -internal-isystem /usr/local/include -internal-isystem /usr/lib64/clang/11.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-error=format-diag -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -o /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2021-01-16-135054-17580-1/report-ZsaELo.plist -x c++ /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c

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

1/* Build expressions with type checking for C++ compiler.
2 Copyright (C) 1987-2021 Free Software Foundation, Inc.
3 Hacked by Michael Tiemann (tiemann@cygnus.com)
4
5This file is part of GCC.
6
7GCC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 3, or (at your option)
10any later version.
11
12GCC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GCC; see the file COPYING3. If not see
19<http://www.gnu.org/licenses/>. */
20
21
22/* 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
44static tree cp_build_addr_expr_strict (tree, tsubst_flags_t);
45static tree cp_build_function_call (tree, tree, tsubst_flags_t);
46static tree pfn_from_ptrmemfunc (tree);
47static tree delta_from_ptrmemfunc (tree);
48static tree convert_for_assignment (tree, tree, impl_conv_rhs, tree, int,
49 tsubst_flags_t, int);
50static tree cp_pointer_int_sum (location_t, enum tree_code, tree, tree,
51 tsubst_flags_t);
52static tree rationalize_conditional_expr (enum tree_code, tree,
53 tsubst_flags_t);
54static bool comp_ptr_ttypes_real (tree, tree, int);
55static bool comp_except_types (tree, tree, bool);
56static bool comp_array_types (const_tree, const_tree, compare_bounds_t, bool);
57static tree pointer_diff (location_t, tree, tree, tree, tsubst_flags_t, tree *);
58static tree get_delta_difference (tree, tree, bool, bool, tsubst_flags_t);
59static void casts_away_constness_r (tree *, tree *, tsubst_flags_t);
60static bool casts_away_constness (tree, tree, tsubst_flags_t);
61static bool maybe_warn_about_returning_address_of_local (tree, location_t = UNKNOWN_LOCATION((location_t) 0));
62static void error_args_num (location_t, tree, bool);
63static int convert_arguments (tree, vec<tree, va_gc> **, tree, int,
64 tsubst_flags_t);
65static bool is_std_move_p (tree);
66static 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
73tree
74require_complete_type_sfinae (tree value, tsubst_flags_t complain)
75{
76 tree type;
77
78 if (processing_template_declscope_chain->x_processing_template_decl || value == error_mark_nodeglobal_trees[TI_ERROR_MARK])
79 return value;
80
81 if (TREE_CODE (value)((enum tree_code) (value)->base.code) == OVERLOAD)
82 type = unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE];
83 else
84 type = TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 84, __FUNCTION__))->typed.type)
;
85
86 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
87 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
88
89 /* First, detect a valid value with a complete type. */
90 if (COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 90, __FUNCTION__))->type_common.size) != (tree) __null)
)
91 return value;
92
93 if (complete_type_or_maybe_complain (type, value, complain))
94 return value;
95 else
96 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
97}
98
99tree
100require_complete_type (tree value)
101{
102 return require_complete_type_sfinae (value, tf_warning_or_error);
103}
104
105/* Try to complete TYPE, if it is incomplete. For example, if TYPE is
106 a template instantiation, do the instantiation. Returns TYPE,
107 whether or not it could be completed, unless something goes
108 horribly wrong, in which case the error_mark_node is returned. */
109
110tree
111complete_type (tree type)
112{
113 if (type == NULL_TREE(tree) __null)
114 /* Rather than crash, we return something sure to cause an error
115 at some point. */
116 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
117
118 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK] || COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 118, __FUNCTION__))->type_common.size) != (tree) __null)
)
119 ;
120 else if (TREE_CODE (type)((enum tree_code) (type)->base.code) == ARRAY_TYPE)
121 {
122 tree t = complete_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 122, __FUNCTION__))->typed.type)
);
123 unsigned int needs_constructing, has_nontrivial_dtor;
124 if (COMPLETE_TYPE_P (t)(((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 124, __FUNCTION__))->type_common.size) != (tree) __null)
&& !dependent_type_p (type))
125 layout_type (type);
126 needs_constructing
127 = TYPE_NEEDS_CONSTRUCTING (TYPE_MAIN_VARIANT (t))((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 127, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 127, __FUNCTION__))->type_common.needs_constructing_flag
)
;
128 has_nontrivial_dtor
129 = TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TYPE_MAIN_VARIANT (t))(((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 129, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 129, __FUNCTION__))->type_common.lang_flag_4))
;
130 for (t = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 130, __FUNCTION__))->type_common.main_variant)
; t; t = TYPE_NEXT_VARIANT (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 130, __FUNCTION__))->type_common.next_variant)
)
131 {
132 TYPE_NEEDS_CONSTRUCTING (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 132, __FUNCTION__))->type_common.needs_constructing_flag
)
= needs_constructing;
133 TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t)(((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 133, __FUNCTION__))->type_common.lang_flag_4))
= has_nontrivial_dtor;
134 }
135 }
136 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 136, __FUNCTION__))->type_common.lang_flag_5))
&& CLASSTYPE_TEMPLATE_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 136, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) & 1)
)
137 instantiate_class_template (TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 137, __FUNCTION__))->type_common.main_variant)
);
138
139 return type;
140}
141
142/* Like complete_type, but issue an error if the TYPE cannot be completed.
143 VALUE is used for informative diagnostics.
144 Returns NULL_TREE if the type cannot be made complete. */
145
146tree
147complete_type_or_maybe_complain (tree type, tree value, tsubst_flags_t complain)
148{
149 type = complete_type (type);
150 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
151 /* We already issued an error. */
152 return NULL_TREE(tree) __null;
153 else if (!COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 153, __FUNCTION__))->type_common.size) != (tree) __null)
)
154 {
155 if (complain & tf_error)
156 cxx_incomplete_type_diagnostic (value, type, DK_ERROR);
157 note_failed_type_completion_for_satisfaction (type);
158 return NULL_TREE(tree) __null;
159 }
160 else
161 return type;
162}
163
164tree
165complete_type_or_else (tree type, tree value)
166{
167 return complete_type_or_maybe_complain (type, value, tf_warning_or_error);
168}
169
170
171/* Return the common type of two parameter lists.
172 We assume that comptypes has already been done and returned 1;
173 if that isn't so, this may crash.
174
175 As an optimization, free the space we allocate if the parameter
176 lists are already common. */
177
178static tree
179commonparms (tree p1, tree p2)
180{
181 tree oldargs = p1, newargs, n;
182 int i, len;
183 int any_change = 0;
184
185 len = list_length (p1);
186 newargs = tree_last (p1);
187
188 if (newargs == void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
189 i = 1;
190 else
191 {
192 i = 0;
193 newargs = 0;
194 }
195
196 for (; i < len; i++)
197 newargs = tree_cons (NULL_TREE(tree) __null, NULL_TREE(tree) __null, newargs);
198
199 n = newargs;
200
201 for (i = 0; p1;
202 p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 202, __FUNCTION__))->common.chain)
, p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 202, __FUNCTION__))->common.chain)
, n = TREE_CHAIN (n)((contains_struct_check ((n), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 202, __FUNCTION__))->common.chain)
, i++)
203 {
204 if (TREE_PURPOSE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 204, __FUNCTION__, (TREE_LIST)))->list.purpose)
&& !TREE_PURPOSE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 204, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
205 {
206 TREE_PURPOSE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 206, __FUNCTION__, (TREE_LIST)))->list.purpose)
= TREE_PURPOSE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 206, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
207 any_change = 1;
208 }
209 else if (! TREE_PURPOSE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 209, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
210 {
211 if (TREE_PURPOSE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 211, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
212 {
213 TREE_PURPOSE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 213, __FUNCTION__, (TREE_LIST)))->list.purpose)
= TREE_PURPOSE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 213, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
214 any_change = 1;
215 }
216 }
217 else
218 {
219 if (simple_cst_equal (TREE_PURPOSE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 219, __FUNCTION__, (TREE_LIST)))->list.purpose)
, TREE_PURPOSE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 219, __FUNCTION__, (TREE_LIST)))->list.purpose)
) != 1)
220 any_change = 1;
221 TREE_PURPOSE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 221, __FUNCTION__, (TREE_LIST)))->list.purpose)
= TREE_PURPOSE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 221, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
222 }
223 if (TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 223, __FUNCTION__, (TREE_LIST)))->list.value)
!= TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 223, __FUNCTION__, (TREE_LIST)))->list.value)
)
224 {
225 any_change = 1;
226 TREE_VALUE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 226, __FUNCTION__, (TREE_LIST)))->list.value)
= merge_types (TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 226, __FUNCTION__, (TREE_LIST)))->list.value)
, TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 226, __FUNCTION__, (TREE_LIST)))->list.value)
);
227 }
228 else
229 TREE_VALUE (n)((tree_check ((n), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 229, __FUNCTION__, (TREE_LIST)))->list.value)
= TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 229, __FUNCTION__, (TREE_LIST)))->list.value)
;
230 }
231 if (! any_change)
232 return oldargs;
233
234 return newargs;
235}
236
237/* Given a type, perhaps copied for a typedef,
238 find the "original" version of it. */
239static tree
240original_type (tree t)
241{
242 int quals = cp_type_quals (t);
243 while (t != error_mark_nodeglobal_trees[TI_ERROR_MARK]
244 && TYPE_NAME (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 244, __FUNCTION__))->type_common.name)
!= NULL_TREE(tree) __null)
245 {
246 tree x = TYPE_NAME (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 246, __FUNCTION__))->type_common.name)
;
247 if (TREE_CODE (x)((enum tree_code) (x)->base.code) != TYPE_DECL)
248 break;
249 x = DECL_ORIGINAL_TYPE (x)((tree_check ((x), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 249, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
)
;
250 if (x == NULL_TREE(tree) __null)
251 break;
252 t = x;
253 }
254 return cp_build_qualified_type (t, quals)cp_build_qualified_type_real ((t), (quals), tf_warning_or_error
)
;
255}
256
257/* Return the common type for two arithmetic types T1 and T2 under the
258 usual arithmetic conversions. The default conversions have already
259 been applied, and enumerated types converted to their compatible
260 integer types. */
261
262static tree
263cp_common_type (tree t1, tree t2)
264{
265 enum tree_code code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code);
266 enum tree_code code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code);
267 tree attributes;
268 int i;
269
270
271 /* In what follows, we slightly generalize the rules given in [expr] so
272 as to deal with `long long' and `complex'. First, merge the
273 attributes. */
274 attributes = (*targetm.merge_type_attributes) (t1, t2);
275
276 if (SCOPED_ENUM_P (t1)(((enum tree_code) (t1)->base.code) == ENUMERAL_TYPE &&
((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 276, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
|| SCOPED_ENUM_P (t2)(((enum tree_code) (t2)->base.code) == ENUMERAL_TYPE &&
((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 276, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
)
277 {
278 if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 278, __FUNCTION__))->type_common.main_variant)
== TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 278, __FUNCTION__))->type_common.main_variant)
)
279 return build_type_attribute_variant (t1, attributes);
280 else
281 return NULL_TREE(tree) __null;
282 }
283
284 /* FIXME: Attributes. */
285 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 287, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 287, __FUNCTION__), 0 : 0))
286 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 287, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 287, __FUNCTION__), 0 : 0))
287 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 287, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 287, __FUNCTION__), 0 : 0))
;
288 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 290, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 290, __FUNCTION__), 0 : 0))
289 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 290, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 290, __FUNCTION__), 0 : 0))
290 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 290, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 290, __FUNCTION__), 0 : 0))
;
291
292 /* If one type is complex, form the common type of the non-complex
293 components, then make that complex. Use T1 or T2 if it is the
294 required type. */
295 if (code1 == COMPLEX_TYPE || code2 == COMPLEX_TYPE)
296 {
297 tree subtype1 = code1 == COMPLEX_TYPE ? TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 297, __FUNCTION__))->typed.type)
: t1;
298 tree subtype2 = code2 == COMPLEX_TYPE ? TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 298, __FUNCTION__))->typed.type)
: t2;
299 tree subtype
300 = type_after_usual_arithmetic_conversions (subtype1, subtype2);
301
302 if (code1 == COMPLEX_TYPE && TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 302, __FUNCTION__))->typed.type)
== subtype)
303 return build_type_attribute_variant (t1, attributes);
304 else if (code2 == COMPLEX_TYPE && TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 304, __FUNCTION__))->typed.type)
== subtype)
305 return build_type_attribute_variant (t2, attributes);
306 else
307 return build_type_attribute_variant (build_complex_type (subtype),
308 attributes);
309 }
310
311 if (code1 == VECTOR_TYPE)
312 {
313 /* When we get here we should have two vectors of the same size.
314 Just prefer the unsigned one if present. */
315 if (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 315, __FUNCTION__))->base.u.bits.unsigned_flag)
)
316 return build_type_attribute_variant (t1, attributes);
317 else
318 return build_type_attribute_variant (t2, attributes);
319 }
320
321 /* If only one is real, use it as the result. */
322 if (code1 == REAL_TYPE && code2 != REAL_TYPE)
323 return build_type_attribute_variant (t1, attributes);
324 if (code2 == REAL_TYPE && code1 != REAL_TYPE)
325 return build_type_attribute_variant (t2, attributes);
326
327 /* Both real or both integers; use the one with greater precision. */
328 if (TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 328, __FUNCTION__))->type_common.precision)
> TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 328, __FUNCTION__))->type_common.precision)
)
329 return build_type_attribute_variant (t1, attributes);
330 else if (TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 330, __FUNCTION__))->type_common.precision)
> TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 330, __FUNCTION__))->type_common.precision)
)
331 return build_type_attribute_variant (t2, attributes);
332
333 /* The types are the same; no need to do anything fancy. */
334 if (TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 334, __FUNCTION__))->type_common.main_variant)
== TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 334, __FUNCTION__))->type_common.main_variant)
)
335 return build_type_attribute_variant (t1, attributes);
336
337 if (code1 != REAL_TYPE)
338 {
339 /* If one is unsigned long long, then convert the other to unsigned
340 long long. */
341 if (same_type_p (TYPE_MAIN_VARIANT (t1), long_long_unsigned_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 341, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_unsigned_long_long]), 0)
342 || same_type_p (TYPE_MAIN_VARIANT (t2), long_long_unsigned_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 342, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_unsigned_long_long]), 0)
)
343 return build_type_attribute_variant (long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long],
344 attributes);
345 /* If one is a long long, and the other is an unsigned long, and
346 long long can represent all the values of an unsigned long, then
347 convert to a long long. Otherwise, convert to an unsigned long
348 long. Otherwise, if either operand is long long, convert the
349 other to long long.
350
351 Since we're here, we know the TYPE_PRECISION is the same;
352 therefore converting to long long cannot represent all the values
353 of an unsigned long, so we choose unsigned long long in that
354 case. */
355 if (same_type_p (TYPE_MAIN_VARIANT (t1), long_long_integer_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 355, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_long_long]), 0)
356 || same_type_p (TYPE_MAIN_VARIANT (t2), long_long_integer_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 356, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_long_long]), 0)
)
357 {
358 tree t = ((TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 358, __FUNCTION__))->base.u.bits.unsigned_flag)
|| TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 358, __FUNCTION__))->base.u.bits.unsigned_flag)
)
359 ? long_long_unsigned_type_nodeinteger_types[itk_unsigned_long_long]
360 : long_long_integer_type_nodeinteger_types[itk_long_long]);
361 return build_type_attribute_variant (t, attributes);
362 }
363
364 /* Go through the same procedure, but for longs. */
365 if (same_type_p (TYPE_MAIN_VARIANT (t1), long_unsigned_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 365, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_unsigned_long]), 0)
366 || same_type_p (TYPE_MAIN_VARIANT (t2), long_unsigned_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 366, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_unsigned_long]), 0)
)
367 return build_type_attribute_variant (long_unsigned_type_nodeinteger_types[itk_unsigned_long],
368 attributes);
369 if (same_type_p (TYPE_MAIN_VARIANT (t1), long_integer_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 369, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_long]), 0)
370 || same_type_p (TYPE_MAIN_VARIANT (t2), long_integer_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 370, __FUNCTION__))->type_common.main_variant)), (integer_types
[itk_long]), 0)
)
371 {
372 tree t = ((TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 372, __FUNCTION__))->base.u.bits.unsigned_flag)
|| TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 372, __FUNCTION__))->base.u.bits.unsigned_flag)
)
373 ? long_unsigned_type_nodeinteger_types[itk_unsigned_long] : long_integer_type_nodeinteger_types[itk_long]);
374 return build_type_attribute_variant (t, attributes);
375 }
376
377 /* For __intN types, either the type is __int128 (and is lower
378 priority than the types checked above, but higher than other
379 128-bit types) or it's known to not be the same size as other
380 types (enforced in toplev.c). Prefer the unsigned type. */
381 for (i = 0; i < NUM_INT_N_ENTS1; i ++)
382 {
383 if (int_n_enabled_p [i]
384 && (same_type_p (TYPE_MAIN_VARIANT (t1), int_n_trees[i].signed_type)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 384, __FUNCTION__))->type_common.main_variant)), (int_n_trees
[i].signed_type), 0)
385 || same_type_p (TYPE_MAIN_VARIANT (t2), int_n_trees[i].signed_type)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 385, __FUNCTION__))->type_common.main_variant)), (int_n_trees
[i].signed_type), 0)
386 || same_type_p (TYPE_MAIN_VARIANT (t1), int_n_trees[i].unsigned_type)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 386, __FUNCTION__))->type_common.main_variant)), (int_n_trees
[i].unsigned_type), 0)
387 || same_type_p (TYPE_MAIN_VARIANT (t2), int_n_trees[i].unsigned_type)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 387, __FUNCTION__))->type_common.main_variant)), (int_n_trees
[i].unsigned_type), 0)
))
388 {
389 tree t = ((TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 389, __FUNCTION__))->base.u.bits.unsigned_flag)
|| TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 389, __FUNCTION__))->base.u.bits.unsigned_flag)
)
390 ? int_n_trees[i].unsigned_type
391 : int_n_trees[i].signed_type);
392 return build_type_attribute_variant (t, attributes);
393 }
394 }
395
396 /* Otherwise prefer the unsigned one. */
397 if (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 397, __FUNCTION__))->base.u.bits.unsigned_flag)
)
398 return build_type_attribute_variant (t1, attributes);
399 else
400 return build_type_attribute_variant (t2, attributes);
401 }
402 else
403 {
404 if (same_type_p (TYPE_MAIN_VARIANT (t1), long_double_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 404, __FUNCTION__))->type_common.main_variant)), (global_trees
[TI_LONG_DOUBLE_TYPE]), 0)
405 || same_type_p (TYPE_MAIN_VARIANT (t2), long_double_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 405, __FUNCTION__))->type_common.main_variant)), (global_trees
[TI_LONG_DOUBLE_TYPE]), 0)
)
406 return build_type_attribute_variant (long_double_type_nodeglobal_trees[TI_LONG_DOUBLE_TYPE],
407 attributes);
408 if (same_type_p (TYPE_MAIN_VARIANT (t1), double_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 408, __FUNCTION__))->type_common.main_variant)), (global_trees
[TI_DOUBLE_TYPE]), 0)
409 || same_type_p (TYPE_MAIN_VARIANT (t2), double_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 409, __FUNCTION__))->type_common.main_variant)), (global_trees
[TI_DOUBLE_TYPE]), 0)
)
410 return build_type_attribute_variant (double_type_nodeglobal_trees[TI_DOUBLE_TYPE],
411 attributes);
412 if (same_type_p (TYPE_MAIN_VARIANT (t1), float_type_node)comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 412, __FUNCTION__))->type_common.main_variant)), (global_trees
[TI_FLOAT_TYPE]), 0)
413 || same_type_p (TYPE_MAIN_VARIANT (t2), float_type_node)comptypes ((((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 413, __FUNCTION__))->type_common.main_variant)), (global_trees
[TI_FLOAT_TYPE]), 0)
)
414 return build_type_attribute_variant (float_type_nodeglobal_trees[TI_FLOAT_TYPE],
415 attributes);
416
417 /* Two floating-point types whose TYPE_MAIN_VARIANTs are none of
418 the standard C++ floating-point types. Logic earlier in this
419 function has already eliminated the possibility that
420 TYPE_PRECISION (t2) != TYPE_PRECISION (t1), so there's no
421 compelling reason to choose one or the other. */
422 return build_type_attribute_variant (t1, attributes);
423 }
424}
425
426/* T1 and T2 are arithmetic or enumeration types. Return the type
427 that will result from the "usual arithmetic conversions" on T1 and
428 T2 as described in [expr]. */
429
430tree
431type_after_usual_arithmetic_conversions (tree t1, tree t2)
432{
433 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 435, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 435, __FUNCTION__), 0 : 0))
434 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 435, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 435, __FUNCTION__), 0 : 0))
435 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 435, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 435, __FUNCTION__), 0 : 0))
;
436 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 438, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 438, __FUNCTION__), 0 : 0))
437 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 438, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 438, __FUNCTION__), 0 : 0))
438 || 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 438, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag))
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 438, __FUNCTION__), 0 : 0))
;
439
440 /* Perform the integral promotions. We do not promote real types here. */
441 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))
442 && 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))
)
443 {
444 t1 = type_promotes_to (t1);
445 t2 = type_promotes_to (t2);
446 }
447
448 return cp_common_type (t1, t2);
449}
450
451static void
452composite_pointer_error (const op_location_t &location,
453 diagnostic_t kind, tree t1, tree t2,
454 composite_pointer_operation operation)
455{
456 switch (operation)
457 {
458 case CPO_COMPARISON:
459 emit_diagnostic (kind, location, 0,
460 "comparison between "
461 "distinct pointer types %qT and %qT lacks a cast",
462 t1, t2);
463 break;
464 case CPO_CONVERSION:
465 emit_diagnostic (kind, location, 0,
466 "conversion between "
467 "distinct pointer types %qT and %qT lacks a cast",
468 t1, t2);
469 break;
470 case CPO_CONDITIONAL_EXPR:
471 emit_diagnostic (kind, location, 0,
472 "conditional expression between "
473 "distinct pointer types %qT and %qT lacks a cast",
474 t1, t2);
475 break;
476 default:
477 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 477, __FUNCTION__))
;
478 }
479}
480
481/* Subroutine of composite_pointer_type to implement the recursive
482 case. See that function for documentation of the parameters. And ADD_CONST
483 is used to track adding "const" where needed. */
484
485static tree
486composite_pointer_type_r (const op_location_t &location,
487 tree t1, tree t2, bool *add_const,
488 composite_pointer_operation operation,
489 tsubst_flags_t complain)
490{
491 tree pointee1;
492 tree pointee2;
493 tree result_type;
494 tree attributes;
495
496 /* Determine the types pointed to by T1 and T2. */
497 if (TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE))
498 {
499 pointee1 = TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 499, __FUNCTION__))->typed.type)
;
500 pointee2 = TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 500, __FUNCTION__))->typed.type)
;
501 }
502 else
503 {
504 pointee1 = TYPE_PTRMEM_POINTED_TO_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 504, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type_real ((((contains_struct_check ((
((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 504, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 504, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 504, __FUNCTION__))->typed.type))
;
505 pointee2 = TYPE_PTRMEM_POINTED_TO_TYPE (t2)((((enum tree_code) (t2)->base.code) == OFFSET_TYPE) ? ((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 505, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type_real ((((contains_struct_check ((
((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 505, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 505, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 505, __FUNCTION__))->typed.type))
;
506 }
507
508 /* [expr.type]
509
510 If T1 and T2 are similar types, the result is the cv-combined type of
511 T1 and T2. */
512 if (same_type_ignoring_top_level_qualifiers_p (pointee1, pointee2))
513 result_type = pointee1;
514 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))
515 || (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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 515, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 515, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 515, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 515, __FUNCTION__))->type_common.lang_flag_2))))
))
516 {
517 result_type = composite_pointer_type_r (location, pointee1, pointee2,
518 add_const, operation, complain);
519 if (result_type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
520 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
521 }
522 else
523 {
524 if (complain & tf_error)
525 composite_pointer_error (location, DK_PERMERROR,
526 t1, t2, operation);
527 else
528 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
529 result_type = void_type_nodeglobal_trees[TI_VOID_TYPE];
530 }
531 const int q1 = cp_type_quals (pointee1);
532 const int q2 = cp_type_quals (pointee2);
533 const int quals = q1 | q2;
534 result_type = cp_build_qualified_type (result_type,cp_build_qualified_type_real ((result_type), ((quals | (*add_const
? TYPE_QUAL_CONST : TYPE_UNQUALIFIED))), tf_warning_or_error
)
535 (quals | (*add_constcp_build_qualified_type_real ((result_type), ((quals | (*add_const
? TYPE_QUAL_CONST : TYPE_UNQUALIFIED))), tf_warning_or_error
)
536 ? TYPE_QUAL_CONSTcp_build_qualified_type_real ((result_type), ((quals | (*add_const
? TYPE_QUAL_CONST : TYPE_UNQUALIFIED))), tf_warning_or_error
)
537 : TYPE_UNQUALIFIED)))cp_build_qualified_type_real ((result_type), ((quals | (*add_const
? TYPE_QUAL_CONST : TYPE_UNQUALIFIED))), tf_warning_or_error
)
;
538 /* The cv-combined type can add "const" as per [conv.qual]/3.3 (except for
539 the TLQ). The reason is that both T1 and T2 can then be converted to the
540 cv-combined type of T1 and T2. */
541 if (quals != q1 || quals != q2)
542 *add_const = true;
543 /* If the original types were pointers to members, so is the
544 result. */
545 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 545, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 545, __FUNCTION__))->type_common.lang_flag_2))))
)
546 {
547 if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), 0)
548 TYPE_PTRMEM_CLASS_TYPE (t2))comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 547, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 548, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), 0)
)
549 {
550 if (complain & tf_error)
551 composite_pointer_error (location, DK_PERMERROR,
552 t1, t2, operation);
553 else
554 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
555 }
556 result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((tree_check
((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 556, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 556, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 556, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 556, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 556, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
,
557 result_type);
558 }
559 else
560 result_type = build_pointer_type (result_type);
561
562 /* Merge the attributes. */
563 attributes = (*targetm.merge_type_attributes) (t1, t2);
564 return build_type_attribute_variant (result_type, attributes);
565}
566
567/* Return the composite pointer type (see [expr.type]) for T1 and T2.
568 ARG1 and ARG2 are the values with those types. The OPERATION is to
569 describe the operation between the pointer types,
570 in case an error occurs.
571
572 This routine also implements the computation of a common type for
573 pointers-to-members as per [expr.eq]. */
574
575tree
576composite_pointer_type (const op_location_t &location,
577 tree t1, tree t2, tree arg1, tree arg2,
578 composite_pointer_operation operation,
579 tsubst_flags_t complain)
580{
581 tree class1;
582 tree class2;
583
584 /* [expr.type]
585
586 If one operand is a null pointer constant, the composite pointer
587 type is the type of the other operand. */
588 if (null_ptr_cst_p (arg1))
589 return t2;
590 if (null_ptr_cst_p (arg2))
591 return t1;
592
593 /* We have:
594
595 [expr.type]
596
597 If one of the operands has type "pointer to cv1 void", then
598 the other has type "pointer to cv2 T", and the composite pointer
599 type is "pointer to cv12 void", where cv12 is the union of cv1
600 and cv2.
601
602 If either type is a pointer to void, make sure it is T1. */
603 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)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 603, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
604 std::swap (t1, t2);
605
606 /* Now, if T1 is a pointer to void, merge the qualifiers. */
607 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)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 607, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
)
608 {
609 tree attributes;
610 tree result_type;
611
612 if (TYPE_PTRFN_P (t2)((((enum tree_code) (t2)->base.code) == POINTER_TYPE) &&
((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 612, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
)
)
613 {
614 if (complain & tf_error)
615 {
616 switch (operation)
617 {
618 case CPO_COMPARISON:
619 pedwarn (location, OPT_Wpedantic,
620 "ISO C++ forbids comparison between pointer "
621 "of type %<void *%> and pointer-to-function");
622 break;
623 case CPO_CONVERSION:
624 pedwarn (location, OPT_Wpedantic,
625 "ISO C++ forbids conversion between pointer "
626 "of type %<void *%> and pointer-to-function");
627 break;
628 case CPO_CONDITIONAL_EXPR:
629 pedwarn (location, OPT_Wpedantic,
630 "ISO C++ forbids conditional expression between "
631 "pointer of type %<void *%> and "
632 "pointer-to-function");
633 break;
634 default:
635 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 635, __FUNCTION__))
;
636 }
637 }
638 else
639 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
640 }
641 result_type
642 = cp_build_qualified_type (void_type_node,cp_build_qualified_type_real ((global_trees[TI_VOID_TYPE]), (
(cp_type_quals (((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 643, __FUNCTION__))->typed.type)) | cp_type_quals (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 644, __FUNCTION__))->typed.type)))), tf_warning_or_error
)
643 (cp_type_quals (TREE_TYPE (t1))cp_build_qualified_type_real ((global_trees[TI_VOID_TYPE]), (
(cp_type_quals (((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 643, __FUNCTION__))->typed.type)) | cp_type_quals (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 644, __FUNCTION__))->typed.type)))), tf_warning_or_error
)
644 | cp_type_quals (TREE_TYPE (t2))))cp_build_qualified_type_real ((global_trees[TI_VOID_TYPE]), (
(cp_type_quals (((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 643, __FUNCTION__))->typed.type)) | cp_type_quals (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 644, __FUNCTION__))->typed.type)))), tf_warning_or_error
)
;
645 result_type = build_pointer_type (result_type);
646 /* Merge the attributes. */
647 attributes = (*targetm.merge_type_attributes) (t1, t2);
648 return build_type_attribute_variant (result_type, attributes);
649 }
650
651 if (c_dialect_objc ()((c_language & clk_objc) != 0) && TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE)
652 && TYPE_PTR_P (t2)(((enum tree_code) (t2)->base.code) == POINTER_TYPE))
653 {
654 if (objc_have_common_type (t1, t2, -3, NULL_TREE(tree) __null))
655 return objc_common_type (t1, t2);
656 }
657
658 /* if T1 or T2 is "pointer to noexcept function" and the other type is
659 "pointer to function", where the function types are otherwise the same,
660 "pointer to function" */
661 if (fnptr_conv_p (t1, t2))
662 return t1;
663 if (fnptr_conv_p (t2, t1))
664 return t2;
665
666 /* [expr.eq] permits the application of a pointer conversion to
667 bring the pointers to a common type. */
668 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)
669 && CLASS_TYPE_P (TREE_TYPE (t1))(((((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 669, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((t1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 669, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((t1
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 669, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 669, __FUNCTION__))->type_common.lang_flag_5))
670 && CLASS_TYPE_P (TREE_TYPE (t2))(((((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 670, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((t2), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 670, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((t2
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 670, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 670, __FUNCTION__))->type_common.lang_flag_5))
671 && !same_type_ignoring_top_level_qualifiers_p (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 671, __FUNCTION__))->typed.type)
,
672 TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 672, __FUNCTION__))->typed.type)
))
673 {
674 class1 = TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 674, __FUNCTION__))->typed.type)
;
675 class2 = TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 675, __FUNCTION__))->typed.type)
;
676
677 if (DERIVED_FROM_P (class1, class2)(lookup_base ((class2), (class1), ba_any, __null, tf_none) !=
(tree) __null)
)
678 t2 = (build_pointer_type
679 (cp_build_qualified_type (class1, cp_type_quals (class2))cp_build_qualified_type_real ((class1), (cp_type_quals (class2
)), tf_warning_or_error)
));
680 else if (DERIVED_FROM_P (class2, class1)(lookup_base ((class1), (class2), ba_any, __null, tf_none) !=
(tree) __null)
)
681 t1 = (build_pointer_type
682 (cp_build_qualified_type (class2, cp_type_quals (class1))cp_build_qualified_type_real ((class2), (cp_type_quals (class1
)), tf_warning_or_error)
));
683 else
684 {
685 if (complain & tf_error)
686 composite_pointer_error (location, DK_ERROR, t1, t2, operation);
687 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
688 }
689 }
690 /* [expr.eq] permits the application of a pointer-to-member
691 conversion to change the class type of one of the types. */
692 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 692, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 692, __FUNCTION__))->type_common.lang_flag_2))))
693 && !same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), 0)
694 TYPE_PTRMEM_CLASS_TYPE (t2))comptypes ((((((enum tree_code) (t1)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 693, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), (((((enum tree_code) (t2)->base.code) == OFFSET_TYPE
) ? ((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 694, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))), 0)
)
695 {
696 class1 = TYPE_PTRMEM_CLASS_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((tree_check
((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 696, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 696, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 696, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 696, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 696, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
;
697 class2 = TYPE_PTRMEM_CLASS_TYPE (t2)((((enum tree_code) (t2)->base.code) == OFFSET_TYPE) ? ((tree_check
((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 697, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 697, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 697, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 697, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 697, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
;
698
699 if (DERIVED_FROM_P (class1, class2)(lookup_base ((class2), (class1), ba_any, __null, tf_none) !=
(tree) __null)
)
700 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 700, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type_real ((((contains_struct_check ((
((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 700, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 700, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 700, __FUNCTION__))->typed.type))
);
701 else if (DERIVED_FROM_P (class2, class1)(lookup_base ((class1), (class2), ba_any, __null, tf_none) !=
(tree) __null)
)
702 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 702, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type_real ((((contains_struct_check ((
((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 702, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 702, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 702, __FUNCTION__))->typed.type))
);
703 else
704 {
705 if (complain & tf_error)
706 switch (operation)
707 {
708 case CPO_COMPARISON:
709 error_at (location, "comparison between distinct "
710 "pointer-to-member types %qT and %qT lacks a cast",
711 t1, t2);
712 break;
713 case CPO_CONVERSION:
714 error_at (location, "conversion between distinct "
715 "pointer-to-member types %qT and %qT lacks a cast",
716 t1, t2);
717 break;
718 case CPO_CONDITIONAL_EXPR:
719 error_at (location, "conditional expression between distinct "
720 "pointer-to-member types %qT and %qT lacks a cast",
721 t1, t2);
722 break;
723 default:
724 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 724, __FUNCTION__))
;
725 }
726 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
727 }
728 }
729
730 bool add_const = false;
731 return composite_pointer_type_r (location, t1, t2, &add_const, operation,
732 complain);
733}
734
735/* Return the merged type of two types.
736 We assume that comptypes has already been done and returned 1;
737 if that isn't so, this may crash.
738
739 This just combines attributes and default arguments; any other
740 differences would cause the two types to compare unalike. */
741
742tree
743merge_types (tree t1, tree t2)
744{
745 enum tree_code code1;
746 enum tree_code code2;
747 tree attributes;
748
749 /* Save time if the two types are the same. */
750 if (t1 == t2)
751 return t1;
752 if (original_type (t1) == original_type (t2))
753 return t1;
754
755 /* If one type is nonsense, use the other. */
756 if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
757 return t2;
758 if (t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
759 return t1;
760
761 /* Handle merging an auto redeclaration with a previous deduced
762 return type. */
763 if (is_auto (t1))
764 return t2;
765
766 /* Merge the attributes. */
767 attributes = (*targetm.merge_type_attributes) (t1, t2);
768
769 if (TYPE_PTRMEMFUNC_P (t1)(((enum tree_code) (t1)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 769, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 769, __FUNCTION__))->type_common.lang_flag_2)))
)
770 t1 = TYPE_PTRMEMFUNC_FN_TYPE (t1)(cp_build_qualified_type_real ((((contains_struct_check ((((tree_check3
((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 770, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 770, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))
;
771 if (TYPE_PTRMEMFUNC_P (t2)(((enum tree_code) (t2)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 771, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 771, __FUNCTION__))->type_common.lang_flag_2)))
)
772 t2 = TYPE_PTRMEMFUNC_FN_TYPE (t2)(cp_build_qualified_type_real ((((contains_struct_check ((((tree_check3
((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 772, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 772, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))
;
773
774 code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code);
775 code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code);
776 if (code1 != code2)
777 {
778 gcc_assert (code1 == TYPENAME_TYPE || code2 == TYPENAME_TYPE)((void)(!(code1 == TYPENAME_TYPE || code2 == TYPENAME_TYPE) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 778, __FUNCTION__), 0 : 0))
;
779 if (code1 == TYPENAME_TYPE)
780 {
781 t1 = resolve_typename_type (t1, /*only_current_p=*/true);
782 code1 = TREE_CODE (t1)((enum tree_code) (t1)->base.code);
783 }
784 else
785 {
786 t2 = resolve_typename_type (t2, /*only_current_p=*/true);
787 code2 = TREE_CODE (t2)((enum tree_code) (t2)->base.code);
788 }
789 }
790
791 switch (code1)
792 {
793 case POINTER_TYPE:
794 case REFERENCE_TYPE:
795 /* For two pointers, do this recursively on the target type. */
796 {
797 tree target = merge_types (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 797, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 797, __FUNCTION__))->typed.type)
);
798 int quals = cp_type_quals (t1);
799
800 if (code1 == POINTER_TYPE)
801 {
802 t1 = build_pointer_type (target);
803 if (TREE_CODE (target)((enum tree_code) (target)->base.code) == METHOD_TYPE)
804 t1 = build_ptrmemfunc_type (t1);
805 }
806 else
807 t1 = cp_build_reference_type (target, TYPE_REF_IS_RVALUE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 807, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag
)
);
808 t1 = build_type_attribute_variant (t1, attributes);
809 t1 = cp_build_qualified_type (t1, quals)cp_build_qualified_type_real ((t1), (quals), tf_warning_or_error
)
;
810
811 return t1;
812 }
813
814 case OFFSET_TYPE:
815 {
816 int quals;
817 tree pointee;
818 quals = cp_type_quals (t1);
819 pointee = merge_types (TYPE_PTRMEM_POINTED_TO_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((contains_struct_check
((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 819, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type_real ((((contains_struct_check ((
((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 819, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 819, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 819, __FUNCTION__))->typed.type))
,
820 TYPE_PTRMEM_POINTED_TO_TYPE (t2)((((enum tree_code) (t2)->base.code) == OFFSET_TYPE) ? ((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 820, __FUNCTION__))->typed.type) : ((contains_struct_check
(((cp_build_qualified_type_real ((((contains_struct_check ((
((tree_check3 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 820, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 820, __FUNCTION__))->typed.type)), (cp_type_quals (t2)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 820, __FUNCTION__))->typed.type))
);
821 t1 = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1)((((enum tree_code) (t1)->base.code) == OFFSET_TYPE) ? ((tree_check
((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 821, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 821, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 821, __FUNCTION__))->typed.type)), (cp_type_quals (t1)),
tf_warning_or_error))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 821, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 821, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
,
822 pointee);
823 t1 = cp_build_qualified_type (t1, quals)cp_build_qualified_type_real ((t1), (quals), tf_warning_or_error
)
;
824 break;
825 }
826
827 case ARRAY_TYPE:
828 {
829 tree elt = merge_types (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 829, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 829, __FUNCTION__))->typed.type)
);
830 /* Save space: see if the result is identical to one of the args. */
831 if (elt == TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 831, __FUNCTION__))->typed.type)
&& TYPE_DOMAIN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 831, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
)
832 return build_type_attribute_variant (t1, attributes);
833 if (elt == TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 833, __FUNCTION__))->typed.type)
&& TYPE_DOMAIN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 833, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
)
834 return build_type_attribute_variant (t2, attributes);
835 /* Merge the element types, and have a size if either arg has one. */
836 t1 = build_cplus_array_type
837 (elt, TYPE_DOMAIN (TYPE_DOMAIN (t1) ? t1 : t2)((tree_check ((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 837, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
) ? t1 : t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 837, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
);
838 break;
839 }
840
841 case FUNCTION_TYPE:
842 /* Function types: prefer the one that specified arg types.
843 If both do, merge the arg types. Also merge the return types. */
844 {
845 tree valtype = merge_types (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 845, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 845, __FUNCTION__))->typed.type)
);
846 tree p1 = TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 846, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
847 tree p2 = TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 847, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
848 tree parms;
849
850 /* Save space: see if the result is identical to one of the args. */
851 if (valtype == TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 851, __FUNCTION__))->typed.type)
&& ! p2)
852 return cp_build_type_attribute_variant (t1, attributes);
853 if (valtype == TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 853, __FUNCTION__))->typed.type)
&& ! p1)
854 return cp_build_type_attribute_variant (t2, attributes);
855
856 /* Simple way if one arg fails to specify argument types. */
857 if (p1 == NULL_TREE(tree) __null || TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 857, __FUNCTION__, (TREE_LIST)))->list.value)
== void_type_nodeglobal_trees[TI_VOID_TYPE])
858 parms = p2;
859 else if (p2 == NULL_TREE(tree) __null || TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 859, __FUNCTION__, (TREE_LIST)))->list.value)
== void_type_nodeglobal_trees[TI_VOID_TYPE])
860 parms = p1;
861 else
862 parms = commonparms (p1, p2);
863
864 cp_cv_quals quals = type_memfn_quals (t1);
865 cp_ref_qualifier rqual = type_memfn_rqual (t1);
866 gcc_assert (quals == type_memfn_quals (t2))((void)(!(quals == type_memfn_quals (t2)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 866, __FUNCTION__), 0 : 0))
;
867 gcc_assert (rqual == type_memfn_rqual (t2))((void)(!(rqual == type_memfn_rqual (t2)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 867, __FUNCTION__), 0 : 0))
;
868
869 tree rval = build_function_type (valtype, parms);
870 rval = apply_memfn_quals (rval, quals);
871 tree raises = merge_exception_specifiers (TYPE_RAISES_EXCEPTIONS (t1)((tree_class_check (((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 871, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 871, __FUNCTION__))->type_non_common.lang_1)
,
872 TYPE_RAISES_EXCEPTIONS (t2)((tree_class_check (((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 872, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 872, __FUNCTION__))->type_non_common.lang_1)
);
873 bool late_return_type_p = TYPE_HAS_LATE_RETURN_TYPE (t1)(((tree_class_check (((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 873, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 873, __FUNCTION__))->type_common.lang_flag_2))
;
874 t1 = build_cp_fntype_variant (rval, rqual, raises, late_return_type_p);
875 break;
876 }
877
878 case METHOD_TYPE:
879 {
880 /* Get this value the long way, since TYPE_METHOD_BASETYPE
881 is just the main variant of this. */
882 tree basetype = class_of_this_parm (t2);
883 tree raises = merge_exception_specifiers (TYPE_RAISES_EXCEPTIONS (t1)((tree_class_check (((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 883, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 883, __FUNCTION__))->type_non_common.lang_1)
,
884 TYPE_RAISES_EXCEPTIONS (t2)((tree_class_check (((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 884, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 884, __FUNCTION__))->type_non_common.lang_1)
);
885 cp_ref_qualifier rqual = type_memfn_rqual (t1);
886 tree t3;
887 bool late_return_type_1_p = TYPE_HAS_LATE_RETURN_TYPE (t1)(((tree_class_check (((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 887, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 887, __FUNCTION__))->type_common.lang_flag_2))
;
888
889 /* If this was a member function type, get back to the
890 original type of type member function (i.e., without
891 the class instance variable up front. */
892 t1 = build_function_type (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 892, __FUNCTION__))->typed.type)
,
893 TREE_CHAIN (TYPE_ARG_TYPES (t1))((contains_struct_check ((((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 893, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 893, __FUNCTION__))->common.chain)
);
894 t2 = build_function_type (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 894, __FUNCTION__))->typed.type)
,
895 TREE_CHAIN (TYPE_ARG_TYPES (t2))((contains_struct_check ((((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 895, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 895, __FUNCTION__))->common.chain)
);
896 t3 = merge_types (t1, t2);
897 t3 = build_method_type_directly (basetype, TREE_TYPE (t3)((contains_struct_check ((t3), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 897, __FUNCTION__))->typed.type)
,
898 TYPE_ARG_TYPES (t3)((tree_check2 ((t3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 898, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
);
899 t1 = build_cp_fntype_variant (t3, rqual, raises, late_return_type_1_p);
900 break;
901 }
902
903 case TYPENAME_TYPE:
904 /* There is no need to merge attributes into a TYPENAME_TYPE.
905 When the type is instantiated it will have whatever
906 attributes result from the instantiation. */
907 return t1;
908
909 default:;
910 if (attribute_list_equal (TYPE_ATTRIBUTES (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 910, __FUNCTION__))->type_common.attributes)
, attributes))
911 return t1;
912 else if (attribute_list_equal (TYPE_ATTRIBUTES (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 912, __FUNCTION__))->type_common.attributes)
, attributes))
913 return t2;
914 break;
915 }
916
917 return cp_build_type_attribute_variant (t1, attributes);
918}
919
920/* Return the ARRAY_TYPE type without its domain. */
921
922tree
923strip_array_domain (tree type)
924{
925 tree t2;
926 gcc_assert (TREE_CODE (type) == ARRAY_TYPE)((void)(!(((enum tree_code) (type)->base.code) == ARRAY_TYPE
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 926, __FUNCTION__), 0 : 0))
;
927 if (TYPE_DOMAIN (type)((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 927, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
== NULL_TREE(tree) __null)
928 return type;
929 t2 = build_cplus_array_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 929, __FUNCTION__))->typed.type)
, NULL_TREE(tree) __null);
930 return cp_build_type_attribute_variant (t2, TYPE_ATTRIBUTES (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 930, __FUNCTION__))->type_common.attributes)
);
931}
932
933/* Wrapper around cp_common_type that is used by c-common.c and other
934 front end optimizations that remove promotions.
935
936 Return the common type for two arithmetic types T1 and T2 under the
937 usual arithmetic conversions. The default conversions have already
938 been applied, and enumerated types converted to their compatible
939 integer types. */
940
941tree
942common_type (tree t1, tree t2)
943{
944 /* If one type is nonsense, use the other */
945 if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
946 return t2;
947 if (t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
948 return t1;
949
950 return cp_common_type (t1, t2);
951}
952
953/* Return the common type of two pointer types T1 and T2. This is the
954 type for the result of most arithmetic operations if the operands
955 have the given two types.
956
957 We assume that comp_target_types has already been done and returned
958 nonzero; if that isn't so, this may crash. */
959
960tree
961common_pointer_type (tree t1, tree t2)
962{
963 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__))->type_common.lang_flag_2))) &&
(((enum tree_code) (t2)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__))->type_common.lang_flag_2))))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__), 0 : 0))
964 || (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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__))->type_common.lang_flag_2))) &&
(((enum tree_code) (t2)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__))->type_common.lang_flag_2))))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__), 0 : 0))
965 || (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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__))->type_common.lang_flag_2))) &&
(((enum tree_code) (t2)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__))->type_common.lang_flag_2))))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 965, __FUNCTION__), 0 : 0))
;
966
967 return composite_pointer_type (input_location, t1, t2,
968 error_mark_nodeglobal_trees[TI_ERROR_MARK], error_mark_nodeglobal_trees[TI_ERROR_MARK],
969 CPO_CONVERSION, tf_warning_or_error);
970}
971
972/* Compare two exception specifier types for exactness or subsetness, if
973 allowed. Returns false for mismatch, true for match (same, or
974 derived and !exact).
975
976 [except.spec] "If a class X ... objects of class X or any class publicly
977 and unambiguously derived from X. Similarly, if a pointer type Y * ...
978 exceptions of type Y * or that are pointers to any type publicly and
979 unambiguously derived from Y. Otherwise a function only allows exceptions
980 that have the same type ..."
981 This does not mention cv qualifiers and is different to what throw
982 [except.throw] and catch [except.catch] will do. They will ignore the
983 top level cv qualifiers, and allow qualifiers in the pointer to class
984 example.
985
986 We implement the letter of the standard. */
987
988static bool
989comp_except_types (tree a, tree b, bool exact)
990{
991 if (same_type_p (a, b)comptypes ((a), (b), 0))
992 return true;
993 else if (!exact)
994 {
995 if (cp_type_quals (a) || cp_type_quals (b))
996 return false;
997
998 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))
999 {
1000 a = TREE_TYPE (a)((contains_struct_check ((a), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1000, __FUNCTION__))->typed.type)
;
1001 b = TREE_TYPE (b)((contains_struct_check ((b), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1001, __FUNCTION__))->typed.type)
;
1002 if (cp_type_quals (a) || cp_type_quals (b))
1003 return false;
1004 }
1005
1006 if (TREE_CODE (a)((enum tree_code) (a)->base.code) != RECORD_TYPE
1007 || TREE_CODE (b)((enum tree_code) (b)->base.code) != RECORD_TYPE)
1008 return false;
1009
1010 if (publicly_uniquely_derived_p (a, b))
1011 return true;
1012 }
1013 return false;
1014}
1015
1016/* Return true if TYPE1 and TYPE2 are equivalent exception specifiers.
1017 If EXACT is ce_derived, T2 can be stricter than T1 (according to 15.4/5).
1018 If EXACT is ce_type, the C++17 type compatibility rules apply.
1019 If EXACT is ce_normal, the compatibility rules in 15.4/3 apply.
1020 If EXACT is ce_exact, the specs must be exactly the same. Exception lists
1021 are unordered, but we've already filtered out duplicates. Most lists will
1022 be in order, we should try to make use of that. */
1023
1024bool
1025comp_except_specs (const_tree t1, const_tree t2, int exact)
1026{
1027 const_tree probe;
1028 const_tree base;
1029 int length = 0;
1030
1031 if (t1 == t2)
1032 return true;
1033
1034 /* First handle noexcept. */
1035 if (exact < ce_exact)
1036 {
1037 if (exact == ce_type
1038 && (canonical_eh_spec (CONST_CAST_TREE (t1)(const_cast<union tree_node *> (((t1)))))
1039 == canonical_eh_spec (CONST_CAST_TREE (t2)(const_cast<union tree_node *> (((t2)))))))
1040 return true;
1041
1042 /* noexcept(false) is compatible with no exception-specification,
1043 and less strict than any spec. */
1044 if (t1 == noexcept_false_speccp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC])
1045 return t2 == NULL_TREE(tree) __null || exact == ce_derived;
1046 /* Even a derived noexcept(false) is compatible with no
1047 exception-specification. */
1048 if (t2 == noexcept_false_speccp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC])
1049 return t1 == NULL_TREE(tree) __null;
1050
1051 /* Otherwise, if we aren't looking for an exact match, noexcept is
1052 equivalent to throw(). */
1053 if (t1 == noexcept_true_speccp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC])
1054 t1 = empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC];
1055 if (t2 == noexcept_true_speccp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC])
1056 t2 = empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC];
1057 }
1058
1059 /* If any noexcept is left, it is only comparable to itself;
1060 either we're looking for an exact match or we're redeclaring a
1061 template with dependent noexcept. */
1062 if ((t1 && TREE_PURPOSE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1062, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
1063 || (t2 && TREE_PURPOSE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1063, __FUNCTION__, (TREE_LIST)))->list.purpose)
))
1064 return (t1 && t2
1065 && cp_tree_equal (TREE_PURPOSE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1065, __FUNCTION__, (TREE_LIST)))->list.purpose)
, TREE_PURPOSE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1065, __FUNCTION__, (TREE_LIST)))->list.purpose)
));
1066
1067 if (t1 == NULL_TREE(tree) __null) /* T1 is ... */
1068 return t2 == NULL_TREE(tree) __null || exact == ce_derived;
1069 if (!TREE_VALUE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1069, __FUNCTION__, (TREE_LIST)))->list.value)
) /* t1 is EMPTY */
1070 return t2 != NULL_TREE(tree) __null && !TREE_VALUE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1070, __FUNCTION__, (TREE_LIST)))->list.value)
;
1071 if (t2 == NULL_TREE(tree) __null) /* T2 is ... */
1072 return false;
1073 if (TREE_VALUE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1073, __FUNCTION__, (TREE_LIST)))->list.value)
&& !TREE_VALUE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1073, __FUNCTION__, (TREE_LIST)))->list.value)
) /* T2 is EMPTY, T1 is not */
1074 return exact == ce_derived;
1075
1076 /* Neither set is ... or EMPTY, make sure each part of T2 is in T1.
1077 Count how many we find, to determine exactness. For exact matching and
1078 ordered T1, T2, this is an O(n) operation, otherwise its worst case is
1079 O(nm). */
1080 for (base = t1; t2 != NULL_TREE(tree) __null; t2 = TREE_CHAIN (t2)((contains_struct_check ((t2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1080, __FUNCTION__))->common.chain)
)
1081 {
1082 for (probe = base; probe != NULL_TREE(tree) __null; probe = TREE_CHAIN (probe)((contains_struct_check ((probe), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1082, __FUNCTION__))->common.chain)
)
1083 {
1084 tree a = TREE_VALUE (probe)((tree_check ((probe), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1084, __FUNCTION__, (TREE_LIST)))->list.value)
;
1085 tree b = TREE_VALUE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1085, __FUNCTION__, (TREE_LIST)))->list.value)
;
1086
1087 if (comp_except_types (a, b, exact))
1088 {
1089 if (probe == base && exact > ce_derived)
1090 base = TREE_CHAIN (probe)((contains_struct_check ((probe), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1090, __FUNCTION__))->common.chain)
;
1091 length++;
1092 break;
1093 }
1094 }
1095 if (probe == NULL_TREE(tree) __null)
1096 return false;
1097 }
1098 return exact == ce_derived || base == NULL_TREE(tree) __null || length == list_length (t1);
1099}
1100
1101/* Compare the array types T1 and T2. CB says how we should behave when
1102 comparing array bounds: bounds_none doesn't allow dimensionless arrays,
1103 bounds_either says than any array can be [], bounds_first means that
1104 onlt T1 can be an array with unknown bounds. STRICT is true if
1105 qualifiers must match when comparing the types of the array elements. */
1106
1107static bool
1108comp_array_types (const_tree t1, const_tree t2, compare_bounds_t cb,
1109 bool strict)
1110{
1111 tree d1;
1112 tree d2;
1113 tree max1, max2;
1114
1115 if (t1 == t2)
1116 return true;
1117
1118 /* The type of the array elements must be the same. */
1119 if (strict
1120 ? !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1120, __FUNCTION__))->typed.type)), (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1120, __FUNCTION__))->typed.type)), 0)
1121 : !similar_type_p (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1121, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1121, __FUNCTION__))->typed.type)
))
1122 return false;
1123
1124 d1 = TYPE_DOMAIN (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1124, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
;
1125 d2 = TYPE_DOMAIN (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1125, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
;
1126
1127 if (d1 == d2)
1128 return true;
1129
1130 /* If one of the arrays is dimensionless, and the other has a
1131 dimension, they are of different types. However, it is valid to
1132 write:
1133
1134 extern int a[];
1135 int a[3];
1136
1137 by [basic.link]:
1138
1139 declarations for an array object can specify
1140 array types that differ by the presence or absence of a major
1141 array bound (_dcl.array_). */
1142 if (!d1 && d2)
1143 return cb >= bounds_either;
1144 else if (d1 && !d2)
1145 return cb == bounds_either;
1146
1147 /* Check that the dimensions are the same. */
1148
1149 if (!cp_tree_equal (TYPE_MIN_VALUE (d1)((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1149, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
, TYPE_MIN_VALUE (d2)((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1149, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.minval
)
))
1150 return false;
1151 max1 = TYPE_MAX_VALUE (d1)((tree_check5 ((d1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1151, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
1152 max2 = TYPE_MAX_VALUE (d2)((tree_check5 ((d2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1152, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE
), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval
)
;
1153
1154 if (!cp_tree_equal (max1, max2))
1155 return false;
1156
1157 return true;
1158}
1159
1160/* Compare the relative position of T1 and T2 into their respective
1161 template parameter list.
1162 T1 and T2 must be template parameter types.
1163 Return TRUE if T1 and T2 have the same position, FALSE otherwise. */
1164
1165static bool
1166comp_template_parms_position (tree t1, tree t2)
1167{
1168 tree index1, index2;
1169 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1173, __FUNCTION__), 0 : 0))
1170 && 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1173, __FUNCTION__), 0 : 0))
1171 && (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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1173, __FUNCTION__), 0 : 0))
1172 || 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1173, __FUNCTION__), 0 : 0))
1173 || 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1173, __FUNCTION__), 0 : 0))
;
1174
1175 index1 = TEMPLATE_TYPE_PARM_INDEX (TYPE_MAIN_VARIANT (t1))(((tree_class_check (((tree_check3 (((((tree_class_check ((t1
), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1175, __FUNCTION__))->type_common.main_variant))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1175, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1175, __FUNCTION__))->type_non_common.values))
;
1176 index2 = TEMPLATE_TYPE_PARM_INDEX (TYPE_MAIN_VARIANT (t2))(((tree_class_check (((tree_check3 (((((tree_class_check ((t2
), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1176, __FUNCTION__))->type_common.main_variant))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1176, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1176, __FUNCTION__))->type_non_common.values))
;
1177
1178 /* Then compare their relative position. */
1179 if (TEMPLATE_PARM_IDX (index1)(((template_parm_index*)(tree_check ((index1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1179, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)
!= TEMPLATE_PARM_IDX (index2)(((template_parm_index*)(tree_check ((index2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1179, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)
1180 || TEMPLATE_PARM_LEVEL (index1)(((template_parm_index*)(tree_check ((index1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1180, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)
!= TEMPLATE_PARM_LEVEL (index2)(((template_parm_index*)(tree_check ((index2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1180, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)
1181 || (TEMPLATE_PARM_PARAMETER_PACK (index1)(((tree_not_check2 (((tree_check ((index1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1181, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1181, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
1182 != TEMPLATE_PARM_PARAMETER_PACK (index2)(((tree_not_check2 (((tree_check ((index2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1182, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1182, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
))
1183 return false;
1184
1185 /* In C++14 we can end up comparing 'auto' to a normal template
1186 parameter. Don't confuse them. */
1187 if (cxx_dialect >= cxx14 && (is_auto (t1) || is_auto (t2)))
1188 return TYPE_IDENTIFIER (t1)(((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((t1), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name))
== TYPE_IDENTIFIER (t2)(((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((t2), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1188, __FUNCTION__))->type_common.name))
;
1189
1190 return true;
1191}
1192
1193/* Heuristic check if two parameter types can be considered ABI-equivalent. */
1194
1195static bool
1196cxx_safe_arg_type_equiv_p (tree t1, tree t2)
1197{
1198 t1 = TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1198, __FUNCTION__))->type_common.main_variant)
;
1199 t2 = TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1199, __FUNCTION__))->type_common.main_variant)
;
1200
1201 if (TYPE_PTR_P (t1)(((enum tree_code) (t1)->base.code) == POINTER_TYPE)
1202 && TYPE_PTR_P (t2)(((enum tree_code) (t2)->base.code) == POINTER_TYPE))
1203 return true;
1204
1205 /* The signedness of the parameter matters only when an integral
1206 type smaller than int is promoted to int, otherwise only the
1207 precision of the parameter matters.
1208 This check should make sure that the callee does not see
1209 undefined values in argument registers. */
1210 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)
1211 && 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)
1212 && TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1212, __FUNCTION__))->type_common.precision)
== TYPE_PRECISION (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1212, __FUNCTION__))->type_common.precision)
1213 && (TYPE_UNSIGNED (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1213, __FUNCTION__))->base.u.bits.unsigned_flag)
== TYPE_UNSIGNED (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1213, __FUNCTION__))->base.u.bits.unsigned_flag)
1214 || !targetm.calls.promote_prototypes (NULL_TREE(tree) __null)
1215 || TYPE_PRECISION (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1215, __FUNCTION__))->type_common.precision)
>= TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1215, __FUNCTION__))->type_common.precision)
))
1216 return true;
1217
1218 return same_type_p (t1, t2)comptypes ((t1), (t2), 0);
1219}
1220
1221/* Check if a type cast between two function types can be considered safe. */
1222
1223static bool
1224cxx_safe_function_type_cast_p (tree t1, tree t2)
1225{
1226 if (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1226, __FUNCTION__))->typed.type)
== void_type_nodeglobal_trees[TI_VOID_TYPE] &&
1227 TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1227, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
== void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
1228 return true;
1229
1230 if (TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1230, __FUNCTION__))->typed.type)
== void_type_nodeglobal_trees[TI_VOID_TYPE] &&
1231 TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1231, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
== void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
1232 return true;
1233
1234 if (!cxx_safe_arg_type_equiv_p (TREE_TYPE (t1)((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1234, __FUNCTION__))->typed.type)
, TREE_TYPE (t2)((contains_struct_check ((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1234, __FUNCTION__))->typed.type)
))
1235 return false;
1236
1237 for (t1 = TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1237, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
, t2 = TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1237, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1238 t1 && t2;
1239 t1 = TREE_CHAIN (t1)((contains_struct_check ((t1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1239, __FUNCTION__))->common.chain)
, t2 = TREE_CHAIN (t2)((contains_struct_check ((t2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1239, __FUNCTION__))->common.chain)
)
1240 if (!cxx_safe_arg_type_equiv_p (TREE_VALUE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1240, __FUNCTION__, (TREE_LIST)))->list.value)
, TREE_VALUE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1240, __FUNCTION__, (TREE_LIST)))->list.value)
))
1241 return false;
1242
1243 return true;
1244}
1245
1246/* Subroutine in comptypes. */
1247
1248static bool
1249structural_comptypes (tree t1, tree t2, int strict)
1250{
1251 /* Both should be types that are not obviously the same. */
1252 gcc_checking_assert (t1 != t2 && TYPE_P (t1) && TYPE_P (t2))((void)(!(t1 != t2 && (tree_code_type[(int) (((enum tree_code
) (t1)->base.code))] == tcc_type) && (tree_code_type
[(int) (((enum tree_code) (t2)->base.code))] == tcc_type))
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1252, __FUNCTION__), 0 : 0))
;
1253
1254 if (!comparing_specializations)
1255 {
1256 /* TYPENAME_TYPEs should be resolved if the qualifying scope is the
1257 current instantiation. */
1258 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == TYPENAME_TYPE)
1259 t1 = resolve_typename_type (t1, /*only_current_p=*/true);
1260
1261 if (TREE_CODE (t2)((enum tree_code) (t2)->base.code) == TYPENAME_TYPE)
1262 t2 = resolve_typename_type (t2, /*only_current_p=*/true);
1263 }
1264
1265 if (TYPE_PTRMEMFUNC_P (t1)(((enum tree_code) (t1)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1265, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1265, __FUNCTION__))->type_common.lang_flag_2)))
)
1266 t1 = TYPE_PTRMEMFUNC_FN_TYPE (t1)(cp_build_qualified_type_real ((((contains_struct_check ((((tree_check3
((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1266, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1266, __FUNCTION__))->typed.type)), (cp_type_quals (t1))
, tf_warning_or_error))
;
1267 if (TYPE_PTRMEMFUNC_P (t2)(((enum tree_code) (t2)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1267, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1267, __FUNCTION__))->type_common.lang_flag_2)))
)
1268 t2 = TYPE_PTRMEMFUNC_FN_TYPE (t2)(cp_build_qualified_type_real ((((contains_struct_check ((((tree_check3
((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1268, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1268, __FUNCTION__))->typed.type)), (cp_type_quals (t2))
, tf_warning_or_error))
;
1269
1270 /* Different classes of types can't be compatible. */
1271 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != TREE_CODE (t2)((enum tree_code) (t2)->base.code))
1272 return false;
1273
1274 /* Qualifiers must match. For array types, we will check when we
1275 recur on the array element types. */
1276 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != ARRAY_TYPE
1277 && cp_type_quals (t1) != cp_type_quals (t2))
1278 return false;
1279 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == FUNCTION_TYPE
1280 && type_memfn_quals (t1) != type_memfn_quals (t2))
1281 return false;
1282 /* Need to check this before TYPE_MAIN_VARIANT.
1283 FIXME function qualifiers should really change the main variant. */
1284 if (FUNC_OR_METHOD_TYPE_P (t1)(((enum tree_code) (t1)->base.code) == FUNCTION_TYPE || ((
enum tree_code) (t1)->base.code) == METHOD_TYPE)
)
1285 {
1286 if (type_memfn_rqual (t1) != type_memfn_rqual (t2))
1287 return false;
1288 if (flag_noexcept_type
1289 && !comp_except_specs (TYPE_RAISES_EXCEPTIONS (t1)((tree_class_check (((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1289, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1289, __FUNCTION__))->type_non_common.lang_1)
,
1290 TYPE_RAISES_EXCEPTIONS (t2)((tree_class_check (((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1290, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1290, __FUNCTION__))->type_non_common.lang_1)
,
1291 ce_type))
1292 return false;
1293 }
1294
1295 /* Allow for two different type nodes which have essentially the same
1296 definition. Note that we already checked for equality of the type
1297 qualifiers (just above). */
1298 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) != ARRAY_TYPE
1299 && TYPE_MAIN_VARIANT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1299, __FUNCTION__))->type_common.main_variant)
== TYPE_MAIN_VARIANT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1299, __FUNCTION__))->type_common.main_variant)
)
1300 goto check_alias;
1301
1302 /* Compare the types. Return false on known not-same. Break on not
1303 known. Never return true from this switch -- you'll break
1304 specialization comparison. */
1305 switch (TREE_CODE (t1)((enum tree_code) (t1)->base.code))
1306 {
1307 case VOID_TYPE:
1308 case BOOLEAN_TYPE:
1309 /* All void and bool types are the same. */
1310 break;
1311
1312 case OPAQUE_TYPE:
1313 case INTEGER_TYPE:
1314 case FIXED_POINT_TYPE:
1315 case REAL_TYPE:
1316 /* With these nodes, we can't determine type equivalence by
1317 looking at what is stored in the nodes themselves, because
1318 two nodes might have different TYPE_MAIN_VARIANTs but still
1319 represent the same type. For example, wchar_t and int could
1320 have the same properties (TYPE_PRECISION, TYPE_MIN_VALUE,
1321 TYPE_MAX_VALUE, etc.), but have different TYPE_MAIN_VARIANTs
1322 and are distinct types. On the other hand, int and the
1323 following typedef
1324
1325 typedef int INT __attribute((may_alias));
1326
1327 have identical properties, different TYPE_MAIN_VARIANTs, but
1328 represent the same type. The canonical type system keeps
1329 track of equivalence in this case, so we fall back on it. */
1330 if (TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1330, __FUNCTION__))->type_common.canonical)
!= TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1330, __FUNCTION__))->type_common.canonical)
)
1331 return false;
1332
1333 /* We don't need or want the attribute comparison. */
1334 goto check_alias;
1335
1336 case TEMPLATE_TEMPLATE_PARM:
1337 case BOUND_TEMPLATE_TEMPLATE_PARM:
1338 if (!comp_template_parms_position (t1, t2))
1339 return false;
1340 if (!comp_template_parms
1341 (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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1341, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1341, __FUNCTION__, (TEMPLATE_INFO))))->tmpl) : ((tree_class_check
((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1341, __FUNCTION__))->type_common.name))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1341, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1342 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1342, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1342, __FUNCTION__, (TEMPLATE_INFO))))->tmpl) : ((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1342, __FUNCTION__))->type_common.name))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1342, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
))
1343 return false;
1344 if (TREE_CODE (t1)((enum tree_code) (t1)->base.code) == TEMPLATE_TEMPLATE_PARM)
1345 break;
1346 /* Don't check inheritance. */
1347 strict = COMPARE_STRICT0;
1348 /* Fall through. */
1349
1350 case RECORD_TYPE:
1351 case UNION_TYPE:
1352 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1352, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1352, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)
1353 && (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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1353, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1353, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1353, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1353, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)
1354 || TREE_CODE (t1)((enum tree_code) (t1)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM)
1355 && 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1355, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1355, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1355, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1355, __FUNCTION__, (TEMPLATE_INFO))))->args)
))
1356 break;
1357
1358 if ((strict & COMPARE_BASE1) && DERIVED_FROM_P (t1, t2)(lookup_base ((t2), (t1), ba_any, __null, tf_none) != (tree) __null
)
)
1359 break;
1360 else if ((strict & COMPARE_DERIVED2) && DERIVED_FROM_P (t2, t1)(lookup_base ((t1), (t2), ba_any, __null, tf_none) != (tree) __null
)
)
1361 break;
1362
1363 return false;
1364
1365 case OFFSET_TYPE:
1366 if (!comptypes (TYPE_OFFSET_BASETYPE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1366, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
)
, TYPE_OFFSET_BASETYPE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1366, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
)
,
1367 strict & ~COMPARE_REDECLARATION4))
1368 return false;
1369 if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1369, __FUNCTION__))->typed.type)), (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1369, __FUNCTION__))->typed.type)), 0)
)
1370 return false;
1371 break;
1372
1373 case REFERENCE_TYPE:
1374 if (TYPE_REF_IS_RVALUE (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1374, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag
)
!= TYPE_REF_IS_RVALUE (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1374, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag
)
)
1375 return false;
1376 /* fall through to checks for pointer types */
1377 gcc_fallthrough ();
1378
1379 case POINTER_TYPE:
1380 if (TYPE_MODE (t1)((((enum tree_code) ((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1380, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1380, __FUNCTION__)))->base.code) == VECTOR_TYPE) ? vector_type_mode
(t2) : (t2)->type_common.mode)
1381 || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1381, __FUNCTION__))->typed.type)), (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1381, __FUNCTION__))->typed.type)), 0)
)
1382 return false;
1383 break;
1384
1385 case METHOD_TYPE:
1386 case FUNCTION_TYPE:
1387 /* Exception specs and memfn_rquals were checked above. */
1388 if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1388, __FUNCTION__))->typed.type)), (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1388, __FUNCTION__))->typed.type)), 0)
)
1389 return false;
1390 if (!compparms (TYPE_ARG_TYPES (t1)((tree_check2 ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1390, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
, TYPE_ARG_TYPES (t2)((tree_check2 ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1390, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
))
1391 return false;
1392 break;
1393
1394 case ARRAY_TYPE:
1395 /* Target types must match incl. qualifiers. */
1396 if (!comp_array_types (t1, t2, ((strict & COMPARE_REDECLARATION4)
1397 ? bounds_either : bounds_none),
1398 /*strict=*/true))
1399 return false;
1400 break;
1401
1402 case TEMPLATE_TYPE_PARM:
1403 /* If T1 and T2 don't have the same relative position in their
1404 template parameters set, they can't be equal. */
1405 if (!comp_template_parms_position (t1, t2))
1406 return false;
1407 /* If T1 and T2 don't represent the same class template deduction,
1408 they aren't equal. */
1409 if (CLASS_PLACEHOLDER_TEMPLATE (t1)(((contains_struct_check ((((tree_class_check (((tree_check (
(t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1409, __FUNCTION__, (TEMPLATE_TYPE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1409, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1409, __FUNCTION__))->decl_common.initial))
1410 != CLASS_PLACEHOLDER_TEMPLATE (t2)(((contains_struct_check ((((tree_class_check (((tree_check (
(t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1410, __FUNCTION__, (TEMPLATE_TYPE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1410, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1410, __FUNCTION__))->decl_common.initial))
)
1411 return false;
1412 /* Constrained 'auto's are distinct from parms that don't have the same
1413 constraints. */
1414 if (!equivalent_placeholder_constraints (t1, t2))
1415 return false;
1416 break;
1417
1418 case TYPENAME_TYPE:
1419 if (!cp_tree_equal (TYPENAME_TYPE_FULLNAME (t1)(((tree_class_check (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1419, __FUNCTION__, (TYPENAME_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1419, __FUNCTION__))->type_non_common.values))
,
1420 TYPENAME_TYPE_FULLNAME (t2)(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1420, __FUNCTION__, (TYPENAME_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1420, __FUNCTION__))->type_non_common.values))
))
1421 return false;
1422 /* Qualifiers don't matter on scopes. */
1423 if (!same_type_ignoring_top_level_qualifiers_p (TYPE_CONTEXT (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1423, __FUNCTION__))->type_common.context)
,
1424 TYPE_CONTEXT (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1424, __FUNCTION__))->type_common.context)
))
1425 return false;
1426 break;
1427
1428 case UNBOUND_CLASS_TEMPLATE:
1429 if (!cp_tree_equal (TYPE_IDENTIFIER (t1)(((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((t1), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name))
, TYPE_IDENTIFIER (t2)(((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((t2), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name))->base.code))
] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1429, __FUNCTION__))->type_common.name))
))
1430 return false;
1431 if (!same_type_p (TYPE_CONTEXT (t1), TYPE_CONTEXT (t2))comptypes ((((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1431, __FUNCTION__))->type_common.context)), (((tree_class_check
((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1431, __FUNCTION__))->type_common.context)), 0)
)
1432 return false;
1433 break;
1434
1435 case COMPLEX_TYPE:
1436 if (!same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1436, __FUNCTION__))->typed.type)), (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1436, __FUNCTION__))->typed.type)), 0)
)
1437 return false;
1438 break;
1439
1440 case VECTOR_TYPE:
1441 if (gnu_vector_type_p (t1) != gnu_vector_type_p (t2)
1442 || maybe_ne (TYPE_VECTOR_SUBPARTS (t1), TYPE_VECTOR_SUBPARTS (t2))
1443 || !same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))comptypes ((((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1443, __FUNCTION__))->typed.type)), (((contains_struct_check
((t2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1443, __FUNCTION__))->typed.type)), 0)
)
1444 return false;
1445 break;
1446
1447 case TYPE_PACK_EXPANSION:
1448 return (same_type_p (PACK_EXPANSION_PATTERN (t1),comptypes (((((enum tree_code) (t1)->base.code) == TYPE_PACK_EXPANSION
? ((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1448, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((t1), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1448, __FUNCTION__))))))), ((((enum tree_code) (t2)->base
.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((t2)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1449, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((t2), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1449, __FUNCTION__))))))), 0)
1449 PACK_EXPANSION_PATTERN (t2))comptypes (((((enum tree_code) (t1)->base.code) == TYPE_PACK_EXPANSION
? ((contains_struct_check ((t1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1448, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((t1), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1448, __FUNCTION__))))))), ((((enum tree_code) (t2)->base
.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((t2)
, (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1449, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((t2), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1449, __FUNCTION__))))))), 0)
1450 && comp_template_args (PACK_EXPANSION_EXTRA_ARGS (t1)*(((enum tree_code) (t1)->base.code) == TYPE_PACK_EXPANSION
? &((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1450, __FUNCTION__))->type_non_common.maxval) : &(*(
(const_cast<tree*> (tree_operand_check (((t1)), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1450, __FUNCTION__))))))
,
1451 PACK_EXPANSION_EXTRA_ARGS (t2)*(((enum tree_code) (t2)->base.code) == TYPE_PACK_EXPANSION
? &((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1451, __FUNCTION__))->type_non_common.maxval) : &(*(
(const_cast<tree*> (tree_operand_check (((t2)), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1451, __FUNCTION__))))))
));
1452
1453 case DECLTYPE_TYPE:
1454 if (DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1454, __FUNCTION__, (DECLTYPE_TYPE))))->type_common.string_flag
1455 != DECLTYPE_TYPE_ID_EXPR_OR_MEMBER_ACCESS_P (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1455, __FUNCTION__, (DECLTYPE_TYPE))))->type_common.string_flag
)
1456 return false;
1457 if (DECLTYPE_FOR_LAMBDA_CAPTURE (t1)((tree_not_check2 (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1457, __FUNCTION__, (DECLTYPE_TYPE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1457, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
!= DECLTYPE_FOR_LAMBDA_CAPTURE (t2)((tree_not_check2 (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1457, __FUNCTION__, (DECLTYPE_TYPE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1457, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)
1458 return false;
1459 if (DECLTYPE_FOR_LAMBDA_PROXY (t1)((tree_not_check2 (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1459, __FUNCTION__, (DECLTYPE_TYPE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1459, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
!= DECLTYPE_FOR_LAMBDA_PROXY (t2)((tree_not_check2 (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1459, __FUNCTION__, (DECLTYPE_TYPE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1459, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)
)
1460 return false;
1461 if (!cp_tree_equal (DECLTYPE_TYPE_EXPR (t1)(((tree_class_check (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1461, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1461, __FUNCTION__))->type_non_common.values))
, DECLTYPE_TYPE_EXPR (t2)(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1461, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1461, __FUNCTION__))->type_non_common.values))
))
1462 return false;
1463 break;
1464
1465 case UNDERLYING_TYPE:
1466 if (!same_type_p (UNDERLYING_TYPE_TYPE (t1), UNDERLYING_TYPE_TYPE (t2))comptypes (((((tree_class_check (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1466, __FUNCTION__, (UNDERLYING_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1466, __FUNCTION__))->type_non_common.values))), ((((tree_class_check
(((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1466, __FUNCTION__, (UNDERLYING_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1466, __FUNCTION__))->type_non_common.values))), 0)
)
1467 return false;
1468 break;
1469
1470 case TYPEOF_TYPE:
1471 if (!cp_tree_equal (TYPEOF_TYPE_EXPR (t1)(((tree_class_check (((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1471, __FUNCTION__, (TYPEOF_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1471, __FUNCTION__))->type_non_common.values))
, TYPEOF_TYPE_EXPR (t2)(((tree_class_check (((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1471, __FUNCTION__, (TYPEOF_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1471, __FUNCTION__))->type_non_common.values))
))
1472 return false;
1473 break;
1474
1475 default:
1476 return false;
1477 }
1478
1479 /* If we get here, we know that from a target independent POV the
1480 types are the same. Make sure the target attributes are also
1481 the same. */
1482 if (!comp_type_attributes (t1, t2))
1483 return false;
1484
1485 check_alias:
1486 if (comparing_specializations)
1487 {
1488 /* Don't treat an alias template specialization with dependent
1489 arguments as equivalent to its underlying type when used as a
1490 template argument; we need them to be distinct so that we
1491 substitute into the specialization arguments at instantiation
1492 time. And aliases can't be equivalent without being ==, so
1493 we don't need to look any deeper. */
1494 tree dep1 = dependent_alias_template_spec_p (t1, nt_transparent);
1495 tree dep2 = dependent_alias_template_spec_p (t2, nt_transparent);
1496 if ((dep1 || dep2) && dep1 != dep2)
1497 return false;
1498 }
1499
1500 return true;
1501}
1502
1503/* Return true if T1 and T2 are related as allowed by STRICT. STRICT
1504 is a bitwise-or of the COMPARE_* flags. */
1505
1506bool
1507comptypes (tree t1, tree t2, int strict)
1508{
1509 gcc_checking_assert (t1 && t2)((void)(!(t1 && t2) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1509, __FUNCTION__), 0 : 0))
;
1510
1511 /* TYPE_ARGUMENT_PACKS are not really types. */
1512 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1513, __FUNCTION__), 0 : 0))
1513 && 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1513, __FUNCTION__), 0 : 0))
;
1514
1515 if (t1 == t2)
1516 return true;
1517
1518 /* Suppress errors caused by previously reported errors. */
1519 if (t1 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || t2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1520 return false;
1521
1522 if (strict == COMPARE_STRICT0 && comparing_specializations
1523 && (t1 != TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1523, __FUNCTION__))->type_common.canonical)
|| t2 != TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1523, __FUNCTION__))->type_common.canonical)
))
1524 /* If comparing_specializations, treat dependent aliases as distinct. */
1525 strict = COMPARE_STRUCTURAL8;
1526
1527 if (strict == COMPARE_STRICT0)
1528 {
1529 if (TYPE_STRUCTURAL_EQUALITY_P (t1)(((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1529, __FUNCTION__))->type_common.canonical) == (tree) __null
)
|| TYPE_STRUCTURAL_EQUALITY_P (t2)(((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1529, __FUNCTION__))->type_common.canonical) == (tree) __null
)
)
1530 /* At least one of the types requires structural equality, so
1531 perform a deep check. */
1532 return structural_comptypes (t1, t2, strict);
1533
1534 if (flag_checkingglobal_options.x_flag_checking && param_use_canonical_typesglobal_options.x_param_use_canonical_types)
1535 {
1536 bool result = structural_comptypes (t1, t2, strict);
1537
1538 if (result && TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1538, __FUNCTION__))->type_common.canonical)
!= TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1538, __FUNCTION__))->type_common.canonical)
)
1539 /* The two types are structurally equivalent, but their
1540 canonical types were different. This is a failure of the
1541 canonical type propagation code.*/
1542 internal_error
1543 ("canonical types differ for identical types %qT and %qT",
1544 t1, t2);
1545 else if (!result && TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1545, __FUNCTION__))->type_common.canonical)
== TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1545, __FUNCTION__))->type_common.canonical)
)
1546 /* Two types are structurally different, but the canonical
1547 types are the same. This means we were over-eager in
1548 assigning canonical types. */
1549 internal_error
1550 ("same canonical type node for different types %qT and %qT",
1551 t1, t2);
1552
1553 return result;
1554 }
1555 if (!flag_checkingglobal_options.x_flag_checking && param_use_canonical_typesglobal_options.x_param_use_canonical_types)
1556 return TYPE_CANONICAL (t1)((tree_class_check ((t1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1556, __FUNCTION__))->type_common.canonical)
== TYPE_CANONICAL (t2)((tree_class_check ((t2), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1556, __FUNCTION__))->type_common.canonical)
;
1557 else
1558 return structural_comptypes (t1, t2, strict);
1559 }
1560 else if (strict == COMPARE_STRUCTURAL8)
1561 return structural_comptypes (t1, t2, COMPARE_STRICT0);
1562 else
1563 return structural_comptypes (t1, t2, strict);
1564}
1565
1566/* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring
1567 top-level qualifiers. */
1568
1569bool
1570same_type_ignoring_top_level_qualifiers_p (tree type1, tree type2)
1571{
1572 if (type1 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || type2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1573 return false;
1574 if (type1 == type2)
1575 return true;
1576
1577 type1 = cp_build_qualified_type (type1, TYPE_UNQUALIFIED)cp_build_qualified_type_real ((type1), (TYPE_UNQUALIFIED), tf_warning_or_error
)
;
1578 type2 = cp_build_qualified_type (type2, TYPE_UNQUALIFIED)cp_build_qualified_type_real ((type2), (TYPE_UNQUALIFIED), tf_warning_or_error
)
;
1579 return same_type_p (type1, type2)comptypes ((type1), (type2), 0);
1580}
1581
1582/* Returns nonzero iff TYPE1 and TYPE2 are similar, as per [conv.qual]. */
1583
1584bool
1585similar_type_p (tree type1, tree type2)
1586{
1587 if (type1 == error_mark_nodeglobal_trees[TI_ERROR_MARK] || type2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1588 return false;
1589
1590 /* Informally, two types are similar if, ignoring top-level cv-qualification:
1591 * they are the same type; or
1592 * they are both pointers, and the pointed-to types are similar; or
1593 * they are both pointers to member of the same class, and the types of
1594 the pointed-to members are similar; or
1595 * they are both arrays of the same size or both arrays of unknown bound,
1596 and the array element types are similar. */
1597
1598 if (same_type_ignoring_top_level_qualifiers_p (type1, type2))
1599 return true;
1600
1601 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))
1602 || (TYPE_PTRDATAMEM_P (type1)(((enum tree_code) (type1)->base.code) == OFFSET_TYPE) && TYPE_PTRDATAMEM_P (type2)(((enum tree_code) (type2)->base.code) == OFFSET_TYPE))
1603 || (TREE_CODE (type1)((enum tree_code) (type1)->base.code) == ARRAY_TYPE && TREE_CODE (type2)((enum tree_code) (type2)->base.code) == ARRAY_TYPE))
1604 return comp_ptr_ttypes_const (type1, type2, bounds_either);
1605
1606 return false;
1607}
1608
1609/* Returns 1 if TYPE1 is at least as qualified as TYPE2. */
1610
1611bool
1612at_least_as_qualified_p (const_tree type1, const_tree type2)
1613{
1614 int q1 = cp_type_quals (type1);
1615 int q2 = cp_type_quals (type2);
1616
1617 /* All qualifiers for TYPE2 must also appear in TYPE1. */
1618 return (q1 & q2) == q2;
1619}
1620
1621/* Returns 1 if TYPE1 is more cv-qualified than TYPE2, -1 if TYPE2 is
1622 more cv-qualified that TYPE1, and 0 otherwise. */
1623
1624int
1625comp_cv_qualification (int q1, int q2)
1626{
1627 if (q1 == q2)
1628 return 0;
1629
1630 if ((q1 & q2) == q2)
1631 return 1;
1632 else if ((q1 & q2) == q1)
1633 return -1;
1634
1635 return 0;
1636}
1637
1638int
1639comp_cv_qualification (const_tree type1, const_tree type2)
1640{
1641 int q1 = cp_type_quals (type1);
1642 int q2 = cp_type_quals (type2);
1643 return comp_cv_qualification (q1, q2);
1644}
1645
1646/* Returns 1 if the cv-qualification signature of TYPE1 is a proper
1647 subset of the cv-qualification signature of TYPE2, and the types
1648 are similar. Returns -1 if the other way 'round, and 0 otherwise. */
1649
1650int
1651comp_cv_qual_signature (tree type1, tree type2)
1652{
1653 if (comp_ptr_ttypes_real (type2, type1, -1))
1654 return 1;
1655 else if (comp_ptr_ttypes_real (type1, type2, -1))
1656 return -1;
1657 else
1658 return 0;
1659}
1660
1661/* Subroutines of `comptypes'. */
1662
1663/* Return true if two parameter type lists PARMS1 and PARMS2 are
1664 equivalent in the sense that functions with those parameter types
1665 can have equivalent types. The two lists must be equivalent,
1666 element by element. */
1667
1668bool
1669compparms (const_tree parms1, const_tree parms2)
1670{
1671 const_tree t1, t2;
1672
1673 /* An unspecified parmlist matches any specified parmlist
1674 whose argument types don't need default promotions. */
1675
1676 for (t1 = parms1, t2 = parms2;
1677 t1 || t2;
1678 t1 = TREE_CHAIN (t1)((contains_struct_check ((t1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1678, __FUNCTION__))->common.chain)
, t2 = TREE_CHAIN (t2)((contains_struct_check ((t2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1678, __FUNCTION__))->common.chain)
)
1679 {
1680 /* If one parmlist is shorter than the other,
1681 they fail to match. */
1682 if (!t1 || !t2)
1683 return false;
1684 if (!same_type_p (TREE_VALUE (t1), TREE_VALUE (t2))comptypes ((((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1684, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check
((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1684, __FUNCTION__, (TREE_LIST)))->list.value)), 0)
)
1685 return false;
1686 }
1687 return true;
1688}
1689
1690
1691/* Process a sizeof or alignof expression where the operand is a
1692 type. STD_ALIGNOF indicates whether an alignof has C++11 (minimum alignment)
1693 or GNU (preferred alignment) semantics; it is ignored if op is
1694 SIZEOF_EXPR. */
1695
1696tree
1697cxx_sizeof_or_alignof_type (location_t loc, tree type, enum tree_code op,
1698 bool std_alignof, bool complain)
1699{
1700 gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR)((void)(!(op == SIZEOF_EXPR || op == ALIGNOF_EXPR) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1700, __FUNCTION__), 0 : 0))
;
1701 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1702 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1703
1704 type = non_reference (type);
1705 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == METHOD_TYPE)
1706 {
1707 if (complain)
1708 {
1709 pedwarn (loc, OPT_Wpointer_arith,
1710 "invalid application of %qs to a member function",
1711 OVL_OP_INFO (false, op)(&ovl_op_info[(false) != 0][ovl_op_mapping[(op)]])->name);
1712 return size_one_nodeglobal_trees[TI_SIZE_ONE];
1713 }
1714 else
1715 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1716 }
1717
1718 bool dependent_p = dependent_type_p (type);
1719 if (!dependent_p)
1720 complete_type (type);
1721 if (dependent_p
1722 /* VLA types will have a non-constant size. In the body of an
1723 uninstantiated template, we don't need to try to compute the
1724 value, because the sizeof expression is not an integral
1725 constant expression in that case. And, if we do try to
1726 compute the value, we'll likely end up with SAVE_EXPRs, which
1727 the template substitution machinery does not expect to see. */
1728 || (processing_template_declscope_chain->x_processing_template_decl
1729 && COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1729, __FUNCTION__))->type_common.size) != (tree) __null
)
1730 && TREE_CODE (TYPE_SIZE (type))((enum tree_code) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1730, __FUNCTION__))->type_common.size))->base.code)
!= INTEGER_CST))
1731 {
1732 tree value = build_min (op, size_type_nodeglobal_trees[TI_SIZE_TYPE], type);
1733 TREE_READONLY (value)((non_type_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1733, __FUNCTION__))->base.readonly_flag)
= 1;
1734 if (op == ALIGNOF_EXPR && std_alignof)
1735 ALIGNOF_EXPR_STD_P (value)((tree_not_check2 (((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1735, __FUNCTION__, (ALIGNOF_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1735, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= true;
1736 SET_EXPR_LOCATION (value, loc)(expr_check (((value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1736, __FUNCTION__))->exp.locus = (loc)
;
1737 return value;
1738 }
1739
1740 return c_sizeof_or_alignof_type (loc, complete_type (type),
1741 op == SIZEOF_EXPR, std_alignof,
1742 complain);
1743}
1744
1745/* Return the size of the type, without producing any warnings for
1746 types whose size cannot be taken. This routine should be used only
1747 in some other routine that has already produced a diagnostic about
1748 using the size of such a type. */
1749tree
1750cxx_sizeof_nowarn (tree type)
1751{
1752 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == FUNCTION_TYPE
1753 || VOID_TYPE_P (type)(((enum tree_code) (type)->base.code) == VOID_TYPE)
1754 || TREE_CODE (type)((enum tree_code) (type)->base.code) == ERROR_MARK)
1755 return size_one_nodeglobal_trees[TI_SIZE_ONE];
1756 else if (!COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1756, __FUNCTION__))->type_common.size) != (tree) __null
)
)
1757 return size_zero_nodeglobal_trees[TI_SIZE_ZERO];
1758 else
1759 return cxx_sizeof_or_alignof_type (input_location, type,
1760 SIZEOF_EXPR, false, false);
1761}
1762
1763/* Process a sizeof expression where the operand is an expression. */
1764
1765static tree
1766cxx_sizeof_expr (location_t loc, tree e, tsubst_flags_t complain)
1767{
1768 if (e == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1769 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1770
1771 if (instantiation_dependent_uneval_expression_p (e))
1772 {
1773 e = build_min (SIZEOF_EXPR, size_type_nodeglobal_trees[TI_SIZE_TYPE], e);
1774 TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1774, __FUNCTION__))->base.side_effects_flag)
= 0;
1775 TREE_READONLY (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1775, __FUNCTION__))->base.readonly_flag)
= 1;
1776 SET_EXPR_LOCATION (e, loc)(expr_check (((e)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1776, __FUNCTION__))->exp.locus = (loc)
;
1777
1778 return e;
1779 }
1780
1781 location_t e_loc = cp_expr_loc_or_loc (e, loc);
1782 STRIP_ANY_LOCATION_WRAPPER (e)(e) = tree_strip_any_location_wrapper ((const_cast<union tree_node
*> (((e)))))
;
1783
1784 /* To get the size of a static data member declared as an array of
1785 unknown bound, we need to instantiate it. */
1786 if (VAR_P (e)(((enum tree_code) (e)->base.code) == VAR_DECL)
1787 && VAR_HAD_UNKNOWN_BOUND (e)(((contains_struct_check (((tree_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1787, __FUNCTION__, (VAR_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1787, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((e), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1787, __FUNCTION__))->decl_common.lang_specific)->u.base
.unknown_bound_p : false)
1788 && DECL_TEMPLATE_INSTANTIATION (e)((((contains_struct_check ((e), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1788, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) & 1)
)
1789 instantiate_decl (e, /*defer_ok*/true, /*expl_inst_mem*/false);
1790
1791 if (TREE_CODE (e)((enum tree_code) (e)->base.code) == PARM_DECL
1792 && DECL_ARRAY_PARAMETER_P (e)((contains_struct_check (((tree_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1792, __FUNCTION__, (PARM_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1792, __FUNCTION__))->decl_common.lang_flag_1)
1793 && (complain & tf_warning))
1794 {
1795 auto_diagnostic_group d;
1796 if (warning_at (e_loc, OPT_Wsizeof_array_argument,
1797 "%<sizeof%> on array function parameter %qE "
1798 "will return size of %qT", e, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1798, __FUNCTION__))->typed.type)
))
1799 inform (DECL_SOURCE_LOCATION (e)((contains_struct_check ((e), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1799, __FUNCTION__))->decl_minimal.locus)
, "declared here");
1800 }
1801
1802 e = mark_type_use (e);
1803
1804 if (bitfield_p (e))
1805 {
1806 if (complain & tf_error)
1807 error_at (e_loc,
1808 "invalid application of %<sizeof%> to a bit-field");
1809 else
1810 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1811 e = char_type_nodeinteger_types[itk_char];
1812 }
1813 else if (is_overloaded_fn (e))
1814 {
1815 if (complain & tf_error)
1816 permerror (e_loc, "ISO C++ forbids applying %<sizeof%> to "
1817 "an expression of function type");
1818 else
1819 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1820 e = char_type_nodeinteger_types[itk_char];
1821 }
1822 else if (type_unknown_p (e))
1823 {
1824 if (complain & tf_error)
1825 cxx_incomplete_type_error (e_loc, e, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1825, __FUNCTION__))->typed.type)
);
1826 else
1827 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1828 e = char_type_nodeinteger_types[itk_char];
1829 }
1830 else
1831 e = TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1831, __FUNCTION__))->typed.type)
;
1832
1833 return cxx_sizeof_or_alignof_type (loc, e, SIZEOF_EXPR, false,
1834 complain & tf_error);
1835}
1836
1837/* Implement the __alignof keyword: Return the minimum required
1838 alignment of E, measured in bytes. For VAR_DECL's and
1839 FIELD_DECL's return DECL_ALIGN (which can be set from an
1840 "aligned" __attribute__ specification). STD_ALIGNOF acts
1841 like in cxx_sizeof_or_alignof_type. */
1842
1843static tree
1844cxx_alignof_expr (location_t loc, tree e, bool std_alignof,
1845 tsubst_flags_t complain)
1846{
1847 tree t;
1848
1849 if (e == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1850 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1851
1852 if (processing_template_declscope_chain->x_processing_template_decl)
1853 {
1854 e = build_min (ALIGNOF_EXPR, size_type_nodeglobal_trees[TI_SIZE_TYPE], e);
1855 TREE_SIDE_EFFECTS (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1855, __FUNCTION__))->base.side_effects_flag)
= 0;
1856 TREE_READONLY (e)((non_type_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1856, __FUNCTION__))->base.readonly_flag)
= 1;
1857 SET_EXPR_LOCATION (e, loc)(expr_check (((e)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1857, __FUNCTION__))->exp.locus = (loc)
;
1858 ALIGNOF_EXPR_STD_P (e)((tree_not_check2 (((tree_check ((e), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1858, __FUNCTION__, (ALIGNOF_EXPR)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1858, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= std_alignof;
1859
1860 return e;
1861 }
1862
1863 location_t e_loc = cp_expr_loc_or_loc (e, loc);
1864 STRIP_ANY_LOCATION_WRAPPER (e)(e) = tree_strip_any_location_wrapper ((const_cast<union tree_node
*> (((e)))))
;
1865
1866 e = mark_type_use (e);
1867
1868 if (!verify_type_context (loc, TCTX_ALIGNOF, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1868, __FUNCTION__))->typed.type)
,
1869 !(complain & tf_error)))
1870 {
1871 if (!(complain & tf_error))
1872 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1873 t = size_one_nodeglobal_trees[TI_SIZE_ONE];
1874 }
1875 else if (VAR_P (e)(((enum tree_code) (e)->base.code) == VAR_DECL))
1876 t = size_int (DECL_ALIGN_UNIT (e))size_int_kind (((((contains_struct_check ((e), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1876, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((e), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1876, __FUNCTION__))->decl_common.align) - 1) : 0) / (8)
), stk_sizetype)
;
1877 else if (bitfield_p (e))
1878 {
1879 if (complain & tf_error)
1880 error_at (e_loc,
1881 "invalid application of %<__alignof%> to a bit-field");
1882 else
1883 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1884 t = size_one_nodeglobal_trees[TI_SIZE_ONE];
1885 }
1886 else if (TREE_CODE (e)((enum tree_code) (e)->base.code) == COMPONENT_REF
1887 && TREE_CODE (TREE_OPERAND (e, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((e), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1887, __FUNCTION__))))))->base.code)
== FIELD_DECL)
1888 t = size_int (DECL_ALIGN_UNIT (TREE_OPERAND (e, 1)))size_int_kind (((((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((e), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1888, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1888, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check (((*((const_cast<tree*>
(tree_operand_check ((e), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1888, __FUNCTION__)))))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1888, __FUNCTION__))->decl_common.align) - 1) : 0) / (8)
), stk_sizetype)
;
1889 else if (is_overloaded_fn (e))
1890 {
1891 if (complain & tf_error)
1892 permerror (e_loc, "ISO C++ forbids applying %<__alignof%> to "
1893 "an expression of function type");
1894 else
1895 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1896 if (TREE_CODE (e)((enum tree_code) (e)->base.code) == FUNCTION_DECL)
1897 t = size_int (DECL_ALIGN_UNIT (e))size_int_kind (((((contains_struct_check ((e), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1897, __FUNCTION__))->decl_common.align) ? ((unsigned)1)
<< (((contains_struct_check ((e), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1897, __FUNCTION__))->decl_common.align) - 1) : 0) / (8)
), stk_sizetype)
;
1898 else
1899 t = size_one_nodeglobal_trees[TI_SIZE_ONE];
1900 }
1901 else if (type_unknown_p (e))
1902 {
1903 if (complain & tf_error)
1904 cxx_incomplete_type_error (e_loc, e, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1904, __FUNCTION__))->typed.type)
);
1905 else
1906 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1907 t = size_one_nodeglobal_trees[TI_SIZE_ONE];
1908 }
1909 else
1910 return cxx_sizeof_or_alignof_type (loc, TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1910, __FUNCTION__))->typed.type)
,
1911 ALIGNOF_EXPR, std_alignof,
1912 complain & tf_error);
1913
1914 return fold_convert_loc (loc, size_type_nodeglobal_trees[TI_SIZE_TYPE], t);
1915}
1916
1917/* Process a sizeof or alignof expression E with code OP where the operand
1918 is an expression. STD_ALIGNOF acts like in cxx_sizeof_or_alignof_type. */
1919
1920tree
1921cxx_sizeof_or_alignof_expr (location_t loc, tree e, enum tree_code op,
1922 bool std_alignof, bool complain)
1923{
1924 gcc_assert (op == SIZEOF_EXPR || op == ALIGNOF_EXPR)((void)(!(op == SIZEOF_EXPR || op == ALIGNOF_EXPR) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1924, __FUNCTION__), 0 : 0))
;
1925 if (op == SIZEOF_EXPR)
1926 return cxx_sizeof_expr (loc, e, complain? tf_warning_or_error : tf_none);
1927 else
1928 return cxx_alignof_expr (loc, e, std_alignof,
1929 complain? tf_warning_or_error : tf_none);
1930}
1931
1932/* Build a representation of an expression 'alignas(E).' Return the
1933 folded integer value of E if it is an integral constant expression
1934 that resolves to a valid alignment. If E depends on a template
1935 parameter, return a syntactic representation tree of kind
1936 ALIGNOF_EXPR. Otherwise, return an error_mark_node if the
1937 expression is ill formed, or NULL_TREE if E is NULL_TREE. */
1938
1939tree
1940cxx_alignas_expr (tree e)
1941{
1942 if (e == NULL_TREE(tree) __null || e == error_mark_nodeglobal_trees[TI_ERROR_MARK]
1943 || (!TYPE_P (e)(tree_code_type[(int) (((enum tree_code) (e)->base.code))]
== tcc_type)
&& !require_potential_rvalue_constant_expression (e)))
1944 return e;
1945
1946 if (TYPE_P (e)(tree_code_type[(int) (((enum tree_code) (e)->base.code))]
== tcc_type)
)
1947 /* [dcl.align]/3:
1948
1949 When the alignment-specifier is of the form
1950 alignas(type-id ), it shall have the same effect as
1951 alignas(alignof(type-id )). */
1952
1953 return cxx_sizeof_or_alignof_type (input_location,
1954 e, ALIGNOF_EXPR, true, false);
1955
1956 /* If we reach this point, it means the alignas expression if of
1957 the form "alignas(assignment-expression)", so we should follow
1958 what is stated by [dcl.align]/2. */
1959
1960 if (value_dependent_expression_p (e))
1961 /* Leave value-dependent expression alone for now. */
1962 return e;
1963
1964 e = instantiate_non_dependent_expr (e);
1965 e = mark_rvalue_use (e);
1966
1967 /* [dcl.align]/2 says:
1968
1969 the assignment-expression shall be an integral constant
1970 expression. */
1971
1972 if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (e))((((enum tree_code) (((contains_struct_check ((e), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1972, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
&& !((tree_check ((((contains_struct_check ((e), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1972, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1972, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
) || (((enum tree_code) (((contains_struct_check ((e), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1972, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((e), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1972, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
))
)
1973 {
1974 error ("%<alignas%> argument has non-integral type %qT", TREE_TYPE (e)((contains_struct_check ((e), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 1974, __FUNCTION__))->typed.type)
);
1975 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1976 }
1977
1978 return cxx_constant_value (e);
1979}
1980
1981
1982/* EXPR is being used in a context that is not a function call.
1983 Enforce:
1984
1985 [expr.ref]
1986
1987 The expression can be used only as the left-hand operand of a
1988 member function call.
1989
1990 [expr.mptr.operator]
1991
1992 If the result of .* or ->* is a function, then that result can be
1993 used only as the operand for the function call operator ().
1994
1995 by issuing an error message if appropriate. Returns true iff EXPR
1996 violates these rules. */
1997
1998bool
1999invalid_nonstatic_memfn_p (location_t loc, tree expr, tsubst_flags_t complain)
2000{
2001 if (expr == NULL_TREE(tree) __null)
2002 return false;
2003 /* Don't enforce this in MS mode. */
2004 if (flag_ms_extensionsglobal_options.x_flag_ms_extensions)
2005 return false;
2006 if (is_overloaded_fn (expr) && !really_overloaded_fn (expr))
2007 expr = get_first_fn (expr);
2008 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (expr)(((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2008, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2009 {
2010 if (complain & tf_error)
2011 {
2012 if (DECL_P (expr)(tree_code_type[(int) (((enum tree_code) (expr)->base.code
))] == tcc_declaration)
)
2013 {
2014 error_at (loc, "invalid use of non-static member function %qD",
2015 expr);
2016 inform (DECL_SOURCE_LOCATION (expr)((contains_struct_check ((expr), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2016, __FUNCTION__))->decl_minimal.locus)
, "declared here");
2017 }
2018 else
2019 error_at (loc, "invalid use of non-static member function of "
2020 "type %qT", TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2020, __FUNCTION__))->typed.type)
);
2021 }
2022 return true;
2023 }
2024 return false;
2025}
2026
2027/* If EXP is a reference to a bitfield, and the type of EXP does not
2028 match the declared type of the bitfield, return the declared type
2029 of the bitfield. Otherwise, return NULL_TREE. */
2030
2031tree
2032is_bitfield_expr_with_lowered_type (const_tree exp)
2033{
2034 switch (TREE_CODE (exp)((enum tree_code) (exp)->base.code))
2035 {
2036 case COND_EXPR:
2037 if (!is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2037, __FUNCTION__)))))
2038 ? TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2038, __FUNCTION__)))))
2039 : TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2039, __FUNCTION__)))))
))
2040 return NULL_TREE(tree) __null;
2041 return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 2)(*((const_cast<tree*> (tree_operand_check ((exp), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2041, __FUNCTION__)))))
);
2042
2043 case COMPOUND_EXPR:
2044 return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2044, __FUNCTION__)))))
);
2045
2046 case MODIFY_EXPR:
2047 case SAVE_EXPR:
2048 return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2048, __FUNCTION__)))))
);
2049
2050 case COMPONENT_REF:
2051 {
2052 tree field;
2053
2054 field = TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2054, __FUNCTION__)))))
;
2055 if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL || !DECL_BIT_FIELD_TYPE (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2055, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type
)
)
2056 return NULL_TREE(tree) __null;
2057 if (same_type_ignoring_top_level_qualifiers_p
2058 (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2058, __FUNCTION__))->typed.type)
, DECL_BIT_FIELD_TYPE (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2058, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type
)
))
2059 return NULL_TREE(tree) __null;
2060 return DECL_BIT_FIELD_TYPE (field)((tree_check ((field), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2060, __FUNCTION__, (FIELD_DECL)))->field_decl.bit_field_type
)
;
2061 }
2062
2063 case VAR_DECL:
2064 if (DECL_HAS_VALUE_EXPR_P (exp)((tree_check3 ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2064, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))
) ->decl_common.decl_flag_2)
)
2065 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2066, __FUNCTION__))))
2066 (CONST_CAST_TREE (exp))(decl_value_expr_lookup ((contains_struct_check (((const_cast
<union tree_node *> (((exp))))), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2066, __FUNCTION__))))
);
2067 return NULL_TREE(tree) __null;
2068
2069 case VIEW_CONVERT_EXPR:
2070 if (location_wrapper_p (exp))
2071 return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2071, __FUNCTION__)))))
);
2072 else
2073 return NULL_TREE(tree) __null;
2074
2075 default:
2076 return NULL_TREE(tree) __null;
2077 }
2078}
2079
2080/* Like is_bitfield_with_lowered_type, except that if EXP is not a
2081 bitfield with a lowered type, the type of EXP is returned, rather
2082 than NULL_TREE. */
2083
2084tree
2085unlowered_expr_type (const_tree exp)
2086{
2087 tree type;
2088 tree etype = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2088, __FUNCTION__))->typed.type)
;
2089
2090 type = is_bitfield_expr_with_lowered_type (exp);
2091 if (type)
2092 type = cp_build_qualified_type (type, cp_type_quals (etype))cp_build_qualified_type_real ((type), (cp_type_quals (etype))
, tf_warning_or_error)
;
2093 else
2094 type = etype;
2095
2096 return type;
2097}
2098
2099/* Perform the conversions in [expr] that apply when an lvalue appears
2100 in an rvalue context: the lvalue-to-rvalue, array-to-pointer, and
2101 function-to-pointer conversions. In addition, bitfield references are
2102 converted to their declared types. Note that this function does not perform
2103 the lvalue-to-rvalue conversion for class types. If you need that conversion
2104 for class types, then you probably need to use force_rvalue.
2105
2106 Although the returned value is being used as an rvalue, this
2107 function does not wrap the returned expression in a
2108 NON_LVALUE_EXPR; the caller is expected to be mindful of the fact
2109 that the return value is no longer an lvalue. */
2110
2111tree
2112decay_conversion (tree exp,
2113 tsubst_flags_t complain,
2114 bool reject_builtin /* = true */)
2115{
2116 tree type;
2117 enum tree_code code;
2118 location_t loc = cp_expr_loc_or_input_loc (exp);
2119
2120 type = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2120, __FUNCTION__))->typed.type)
;
2121 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2122 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2123
2124 exp = resolve_nondeduced_context_or_error (exp, complain);
2125
2126 code = TREE_CODE (type)((enum tree_code) (type)->base.code);
2127
2128 if (error_operand_p (exp)((exp) == global_trees[TI_ERROR_MARK] || ((exp) && ((
contains_struct_check (((exp)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2128, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK
]))
)
2129 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2130
2131 if (NULLPTR_TYPE_P (type)(((enum tree_code) (type)->base.code) == NULLPTR_TYPE) && !TREE_SIDE_EFFECTS (exp)((non_type_check ((exp), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2131, __FUNCTION__))->base.side_effects_flag)
)
2132 {
2133 mark_rvalue_use (exp, loc, reject_builtin);
2134 return nullptr_nodecp_global_trees[CPTI_NULLPTR];
2135 }
2136
2137 /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
2138 Leave such NOP_EXPRs, since RHS is being used in non-lvalue context. */
2139 if (code == VOID_TYPE)
2140 {
2141 if (complain & tf_error)
2142 error_at (loc, "void value not ignored as it ought to be");
2143 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2144 }
2145 if (invalid_nonstatic_memfn_p (loc, exp, complain))
2146 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2147 if (code == FUNCTION_TYPE || is_overloaded_fn (exp))
2148 {
2149 exp = mark_lvalue_use (exp);
2150 if (reject_builtin && reject_gcc_builtin (exp, loc))
2151 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2152 return cp_build_addr_expr (exp, complain);
2153 }
2154 if (code == ARRAY_TYPE)
2155 {
2156 tree adr;
2157 tree ptrtype;
2158
2159 exp = mark_lvalue_use (exp);
2160
2161 if (INDIRECT_REF_P (exp)(((enum tree_code) (exp)->base.code) == INDIRECT_REF))
2162 return build_nop (build_pointer_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2162, __FUNCTION__))->typed.type)
),
2163 TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2163, __FUNCTION__)))))
);
2164
2165 if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == COMPOUND_EXPR)
2166 {
2167 tree op1 = decay_conversion (TREE_OPERAND (exp, 1)(*((const_cast<tree*> (tree_operand_check ((exp), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2167, __FUNCTION__)))))
, complain);
2168 if (op1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2169 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2170 return build2 (COMPOUND_EXPR, TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2170, __FUNCTION__))->typed.type)
,
2171 TREE_OPERAND (exp, 0)(*((const_cast<tree*> (tree_operand_check ((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2171, __FUNCTION__)))))
, op1);
2172 }
2173
2174 if (!obvalue_p (exp)
2175 && ! (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == CONSTRUCTOR && TREE_STATIC (exp)((exp)->base.static_flag)))
2176 {
2177 if (complain & tf_error)
2178 error_at (loc, "invalid use of non-lvalue array");
2179 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2180 }
2181
2182 /* Don't let an array compound literal decay to a pointer. It can
2183 still be used to initialize an array or bind to a reference. */
2184 if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == TARGET_EXPR)
2185 {
2186 if (complain & tf_error)
2187 error_at (loc, "taking address of temporary array");
2188 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2189 }
2190
2191 ptrtype = build_pointer_type (TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2191, __FUNCTION__))->typed.type)
);
2192
2193 if (VAR_P (exp)(((enum tree_code) (exp)->base.code) == VAR_DECL))
2194 {
2195 if (!cxx_mark_addressable (exp))
2196 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2197 adr = build_nop (ptrtype, build_address (exp));
2198 return adr;
2199 }
2200 /* This way is better for a COMPONENT_REF since it can
2201 simplify the offset for a component. */
2202 adr = cp_build_addr_expr (exp, complain);
2203 return cp_convert (ptrtype, adr, complain);
2204 }
2205
2206 /* Otherwise, it's the lvalue-to-rvalue conversion. */
2207 exp = mark_rvalue_use (exp, loc, reject_builtin);
2208
2209 /* If a bitfield is used in a context where integral promotion
2210 applies, then the caller is expected to have used
2211 default_conversion. That function promotes bitfields correctly
2212 before calling this function. At this point, if we have a
2213 bitfield referenced, we may assume that is not subject to
2214 promotion, and that, therefore, the type of the resulting rvalue
2215 is the declared type of the bitfield. */
2216 exp = convert_bitfield_to_declared_type (exp);
2217
2218 /* We do not call rvalue() here because we do not want to wrap EXP
2219 in a NON_LVALUE_EXPR. */
2220
2221 /* [basic.lval]
2222
2223 Non-class rvalues always have cv-unqualified types. */
2224 type = TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2224, __FUNCTION__))->typed.type)
;
2225 if (!CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2225, __FUNCTION__))->type_common.lang_flag_5))
&& cv_qualified_p (type))
2226 exp = build_nop (cv_unqualified (type), exp);
2227
2228 if (!complete_type_or_maybe_complain (type, exp, complain))
2229 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2230
2231 return exp;
2232}
2233
2234/* Perform preparatory conversions, as part of the "usual arithmetic
2235 conversions". In particular, as per [expr]:
2236
2237 Whenever an lvalue expression appears as an operand of an
2238 operator that expects the rvalue for that operand, the
2239 lvalue-to-rvalue, array-to-pointer, or function-to-pointer
2240 standard conversions are applied to convert the expression to an
2241 rvalue.
2242
2243 In addition, we perform integral promotions here, as those are
2244 applied to both operands to a binary operator before determining
2245 what additional conversions should apply. */
2246
2247static tree
2248cp_default_conversion (tree exp, tsubst_flags_t complain)
2249{
2250 /* Check for target-specific promotions. */
2251 tree promoted_type = targetm.promoted_type (TREE_TYPE (exp)((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2251, __FUNCTION__))->typed.type)
);
2252 if (promoted_type)
2253 exp = cp_convert (promoted_type, exp, complain);
2254 /* Perform the integral promotions first so that bitfield
2255 expressions (which may promote to "int", even if the bitfield is
2256 declared "unsigned") are promoted correctly. */
2257 else if (INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (exp))((((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2257, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
&& !((tree_check ((((contains_struct_check ((exp), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2257, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2257, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
) || (((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2257, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((exp), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2257, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
))
)
2258 exp = cp_perform_integral_promotions (exp, complain);
2259 /* Perform the other conversions. */
2260 exp = decay_conversion (exp, complain);
2261
2262 return exp;
2263}
2264
2265/* C version. */
2266
2267tree
2268default_conversion (tree exp)
2269{
2270 return cp_default_conversion (exp, tf_warning_or_error);
2271}
2272
2273/* EXPR is an expression with an integral or enumeration type.
2274 Perform the integral promotions in [conv.prom], and return the
2275 converted value. */
2276
2277tree
2278cp_perform_integral_promotions (tree expr, tsubst_flags_t complain)
2279{
2280 tree type;
2281 tree promoted_type;
2282
2283 expr = mark_rvalue_use (expr);
2284 if (error_operand_p (expr)((expr) == global_trees[TI_ERROR_MARK] || ((expr) && (
(contains_struct_check (((expr)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2284, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK
]))
)
2285 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2286
2287 type = TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2287, __FUNCTION__))->typed.type)
;
2288
2289 /* [conv.prom]
2290
2291 A prvalue for an integral bit-field (11.3.9) can be converted to a prvalue
2292 of type int if int can represent all the values of the bit-field;
2293 otherwise, it can be converted to unsigned int if unsigned int can
2294 represent all the values of the bit-field. If the bit-field is larger yet,
2295 no integral promotion applies to it. If the bit-field has an enumerated
2296 type, it is treated as any other value of that type for promotion
2297 purposes. */
2298 tree bitfield_type = is_bitfield_expr_with_lowered_type (expr);
2299 if (bitfield_type
2300 && (TREE_CODE (bitfield_type)((enum tree_code) (bitfield_type)->base.code) == ENUMERAL_TYPE
2301 || TYPE_PRECISION (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2301, __FUNCTION__))->type_common.precision)
> TYPE_PRECISION (integer_type_node)((tree_class_check ((integer_types[itk_int]), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2301, __FUNCTION__))->type_common.precision)
))
2302 type = bitfield_type;
2303
2304 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2304, __FUNCTION__), 0 : 0))
;
2305 /* Scoped enums don't promote. */
2306 if (SCOPED_ENUM_P (type)(((enum tree_code) (type)->base.code) == ENUMERAL_TYPE &&
((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2306, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
)
)
2307 return expr;
2308 promoted_type = type_promotes_to (type);
2309 if (type != promoted_type)
2310 expr = cp_convert (promoted_type, expr, complain);
2311 else if (bitfield_type && bitfield_type != type)
2312 /* Prevent decay_conversion from converting to bitfield_type. */
2313 expr = build_nop (type, expr);
2314 return expr;
2315}
2316
2317/* C version. */
2318
2319tree
2320perform_integral_promotions (tree expr)
2321{
2322 return cp_perform_integral_promotions (expr, tf_warning_or_error);
2323}
2324
2325/* Returns nonzero iff exp is a STRING_CST or the result of applying
2326 decay_conversion to one. */
2327
2328int
2329string_conv_p (const_tree totype, const_tree exp, int warn)
2330{
2331 tree t;
2332
2333 if (!TYPE_PTR_P (totype)(((enum tree_code) (totype)->base.code) == POINTER_TYPE))
2334 return 0;
2335
2336 t = TREE_TYPE (totype)((contains_struct_check ((totype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2336, __FUNCTION__))->typed.type)
;
2337 if (!same_type_p (t, char_type_node)comptypes ((t), (integer_types[itk_char]), 0)
2338 && !same_type_p (t, char8_type_node)comptypes ((t), (c_global_trees[CTI_CHAR8_TYPE]), 0)
2339 && !same_type_p (t, char16_type_node)comptypes ((t), (c_global_trees[CTI_CHAR16_TYPE]), 0)
2340 && !same_type_p (t, char32_type_node)comptypes ((t), (c_global_trees[CTI_CHAR32_TYPE]), 0)
2341 && !same_type_p (t, wchar_type_node)comptypes ((t), (c_global_trees[CTI_WCHAR_TYPE]), 0))
2342 return 0;
2343
2344 location_t loc = EXPR_LOC_OR_LOC (exp, input_location)((((IS_ADHOC_LOC (((((exp)) && ((tree_code_type[(int)
(((enum tree_code) ((exp))->base.code))]) >= tcc_reference
&& (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[(int) (((enum tree_code
) ((exp))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((exp))->base.code))]) <= tcc_expression
)) ? (exp)->exp.locus : ((location_t) 0))) : (((((exp)) &&
((tree_code_type[(int) (((enum tree_code) ((exp))->base.code
))]) >= tcc_reference && (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))
;
2345
2346 STRIP_ANY_LOCATION_WRAPPER (exp)(exp) = tree_strip_any_location_wrapper ((const_cast<union
tree_node *> (((exp)))))
;
2347
2348 if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) == STRING_CST)
2349 {
2350 /* Make sure that we don't try to convert between char and wide chars. */
2351 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2351, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2351, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2351, __FUNCTION__))->type_common.main_variant)), (t), 0
)
)
2352 return 0;
2353 }
2354 else
2355 {
2356 /* Is this a string constant which has decayed to 'const char *'? */
2357 t = build_pointer_type (cp_build_qualified_type (t, TYPE_QUAL_CONST)cp_build_qualified_type_real ((t), (TYPE_QUAL_CONST), tf_warning_or_error
)
);
2358 if (!same_type_p (TREE_TYPE (exp), t)comptypes ((((contains_struct_check ((exp), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2358, __FUNCTION__))->typed.type)), (t), 0)
)
2359 return 0;
2360 STRIP_NOPS (exp)(exp) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((exp)))))
;
2361 if (TREE_CODE (exp)((enum tree_code) (exp)->base.code) != ADDR_EXPR
2362 || TREE_CODE (TREE_OPERAND (exp, 0))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((exp), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2362, __FUNCTION__))))))->base.code)
!= STRING_CST)
2363 return 0;
2364 }
2365 if (warn)
2366 {
2367 if (cxx_dialect >= cxx11)
2368 pedwarn (loc, OPT_Wwrite_strings,
2369 "ISO C++ forbids converting a string constant to %qT",
2370 totype);
2371 else
2372 warning_at (loc, OPT_Wwrite_strings,
2373 "deprecated conversion from string constant to %qT",
2374 totype);
2375 }
2376
2377 return 1;
2378}
2379
2380/* Given a COND_EXPR, MIN_EXPR, or MAX_EXPR in T, return it in a form that we
2381 can, for example, use as an lvalue. This code used to be in
2382 unary_complex_lvalue, but we needed it to deal with `a = (d == c) ? b : c'
2383 expressions, where we're dealing with aggregates. But now it's again only
2384 called from unary_complex_lvalue. The case (in particular) that led to
2385 this was with CODE == ADDR_EXPR, since it's not an lvalue when we'd
2386 get it there. */
2387
2388static tree
2389rationalize_conditional_expr (enum tree_code code, tree t,
2390 tsubst_flags_t complain)
2391{
2392 location_t loc = cp_expr_loc_or_input_loc (t);
2393
2394 /* For MIN_EXPR or MAX_EXPR, fold-const.c has arranged things so that
2395 the first operand is always the one to be used if both operands
2396 are equal, so we know what conditional expression this used to be. */
2397 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == MIN_EXPR || TREE_CODE (t)((enum tree_code) (t)->base.code) == MAX_EXPR)
2398 {
2399 tree op0 = TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2399, __FUNCTION__)))))
;
2400 tree op1 = TREE_OPERAND (t, 1)(*((const_cast<tree*> (tree_operand_check ((t), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2400, __FUNCTION__)))))
;
2401
2402 /* The following code is incorrect if either operand side-effects. */
2403 gcc_assert (!TREE_SIDE_EFFECTS (op0)((void)(!(!((non_type_check ((op0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2403, __FUNCTION__))->base.side_effects_flag) &&
!((non_type_check ((op1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2404, __FUNCTION__))->base.side_effects_flag)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2404, __FUNCTION__), 0 : 0))
2404 && !TREE_SIDE_EFFECTS (op1))((void)(!(!((non_type_check ((op0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2403, __FUNCTION__))->base.side_effects_flag) &&
!((non_type_check ((op1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2404, __FUNCTION__))->base.side_effects_flag)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2404, __FUNCTION__), 0 : 0))
;
2405 return
2406 build_conditional_expr (loc,
2407 build_x_binary_op (loc,
2408 (TREE_CODE (t)((enum tree_code) (t)->base.code) == MIN_EXPR
2409 ? LE_EXPR : GE_EXPR),
2410 op0, TREE_CODE (op0)((enum tree_code) (op0)->base.code),
2411 op1, TREE_CODE (op1)((enum tree_code) (op1)->base.code),
2412 /*overload=*/NULL__null,
2413 complain),
2414 cp_build_unary_op (code, op0, false, complain),
2415 cp_build_unary_op (code, op1, false, complain),
2416 complain);
2417 }
2418
2419 tree op1 = TREE_OPERAND (t, 1)(*((const_cast<tree*> (tree_operand_check ((t), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2419, __FUNCTION__)))))
;
2420 if (TREE_CODE (op1)((enum tree_code) (op1)->base.code) != THROW_EXPR)
2421 op1 = cp_build_unary_op (code, op1, false, complain);
2422 tree op2 = TREE_OPERAND (t, 2)(*((const_cast<tree*> (tree_operand_check ((t), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2422, __FUNCTION__)))))
;
2423 if (TREE_CODE (op2)((enum tree_code) (op2)->base.code) != THROW_EXPR)
2424 op2 = cp_build_unary_op (code, op2, false, complain);
2425
2426 return
2427 build_conditional_expr (loc, TREE_OPERAND (t, 0)(*((const_cast<tree*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2427, __FUNCTION__)))))
, op1, op2, complain);
2428}
2429
2430/* Given the TYPE of an anonymous union field inside T, return the
2431 FIELD_DECL for the field. If not found return NULL_TREE. Because
2432 anonymous unions can nest, we must also search all anonymous unions
2433 that are directly reachable. */
2434
2435tree
2436lookup_anon_field (tree t, tree type)
2437{
2438 tree field;
2439
2440 t = TYPE_MAIN_VARIANT (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2440, __FUNCTION__))->type_common.main_variant)
;
2441
2442 for (field = TYPE_FIELDS (t)((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2442, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2442, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2442, __FUNCTION__))->common.chain))
)
2443 {
2444 if (TREE_STATIC (field)((field)->base.static_flag))
2445 continue;
2446 if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL || DECL_ARTIFICIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2446, __FUNCTION__))->decl_common.artificial_flag)
)
2447 continue;
2448
2449 /* If we find it directly, return the field. */
2450 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2450, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) __null
2451 && type == TYPE_MAIN_VARIANT (TREE_TYPE (field))((tree_class_check ((((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2451, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2451, __FUNCTION__))->type_common.main_variant)
)
2452 {
2453 return field;
2454 }
2455
2456 /* Otherwise, it could be nested, search harder. */
2457 if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2457, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) __null
2458 && ANON_AGGR_TYPE_P (TREE_TYPE (field))((((((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2458, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2458, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((field
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2458, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2458, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((field), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2458, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2458, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
)
2459 {
2460 tree subfield = lookup_anon_field (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2460, __FUNCTION__))->typed.type)
, type);
2461 if (subfield)
2462 return subfield;
2463 }
2464 }
2465 return NULL_TREE(tree) __null;
2466}
2467
2468/* Build an expression representing OBJECT.MEMBER. OBJECT is an
2469 expression; MEMBER is a DECL or baselink. If ACCESS_PATH is
2470 non-NULL, it indicates the path to the base used to name MEMBER.
2471 If PRESERVE_REFERENCE is true, the expression returned will have
2472 REFERENCE_TYPE if the MEMBER does. Otherwise, the expression
2473 returned will have the type referred to by the reference.
2474
2475 This function does not perform access control; that is either done
2476 earlier by the parser when the name of MEMBER is resolved to MEMBER
2477 itself, or later when overload resolution selects one of the
2478 functions indicated by MEMBER. */
2479
2480tree
2481build_class_member_access_expr (cp_expr object, tree member,
2482 tree access_path, bool preserve_reference,
2483 tsubst_flags_t complain)
2484{
2485 tree object_type;
2486 tree member_scope;
2487 tree result = NULL_TREE(tree) __null;
2488 tree using_decl = NULL_TREE(tree) __null;
2489
2490 if (error_operand_p (object)((object) == global_trees[TI_ERROR_MARK] || ((object) &&
((contains_struct_check (((object)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2490, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK
]))
|| error_operand_p (member)((member) == global_trees[TI_ERROR_MARK] || ((member) &&
((contains_struct_check (((member)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2490, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK
]))
)
2491 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2492
2493 gcc_assert (DECL_P (member) || BASELINK_P (member))((void)(!((tree_code_type[(int) (((enum tree_code) (member)->
base.code))] == tcc_declaration) || (((enum tree_code) (member
)->base.code) == BASELINK)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2493, __FUNCTION__), 0 : 0))
;
2494
2495 /* [expr.ref]
2496
2497 The type of the first expression shall be "class object" (of a
2498 complete type). */
2499 object_type = TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2499, __FUNCTION__))->typed.type)
;
2500 if (!currently_open_class (object_type)
2501 && !complete_type_or_maybe_complain (object_type, object, complain))
2502 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2503 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2503, __FUNCTION__))->type_common.lang_flag_5))
)
2504 {
2505 if (complain & tf_error)
2506 {
2507 if (INDIRECT_TYPE_P (object_type)((((enum tree_code) (object_type)->base.code) == POINTER_TYPE
) || (((enum tree_code) (object_type)->base.code) == REFERENCE_TYPE
))
2508 && CLASS_TYPE_P (TREE_TYPE (object_type))(((((enum tree_code) (((contains_struct_check ((object_type),
(TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2508, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((object_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2508, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((object_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2508, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2508, __FUNCTION__))->type_common.lang_flag_5))
)
2509 error ("request for member %qD in %qE, which is of pointer "
2510 "type %qT (maybe you meant to use %<->%> ?)",
2511 member, object.get_value (), object_type);
2512 else
2513 error ("request for member %qD in %qE, which is of non-class "
2514 "type %qT", member, object.get_value (), object_type);
2515 }
2516 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2517 }
2518
2519 /* The standard does not seem to actually say that MEMBER must be a
2520 member of OBJECT_TYPE. However, that is clearly what is
2521 intended. */
2522 if (DECL_P (member)(tree_code_type[(int) (((enum tree_code) (member)->base.code
))] == tcc_declaration)
)
2523 {
2524 member_scope = DECL_CLASS_CONTEXT (member)((((contains_struct_check ((member), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2524, __FUNCTION__))->decl_minimal.context) && (
tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((member), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2524, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type)) ? ((contains_struct_check ((member), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2524, __FUNCTION__))->decl_minimal.context) : (tree) __null
)
;
2525 if (!mark_used (member, complain) && !(complain & tf_error))
2526 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2527 if (TREE_DEPRECATED (member)((member)->base.deprecated_flag))
2528 warn_deprecated_use (member, NULL_TREE(tree) __null);
2529 }
2530 else
2531 member_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (member))((contains_struct_check (((tree_check (((((struct tree_baselink
*) (tree_check ((member), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2531, __FUNCTION__, (BASELINK))))->access_binfo)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2531, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2531, __FUNCTION__))->typed.type)
;
2532 /* If MEMBER is from an anonymous aggregate, MEMBER_SCOPE will
2533 presently be the anonymous union. Go outwards until we find a
2534 type related to OBJECT_TYPE. */
2535 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2535, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((member_scope), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2535, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2535, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
)
)
2536 && !same_type_ignoring_top_level_qualifiers_p (member_scope,
2537 object_type))
2538 member_scope = TYPE_CONTEXT (member_scope)((tree_class_check ((member_scope), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2538, __FUNCTION__))->type_common.context)
;
2539 if (!member_scope || !DERIVED_FROM_P (member_scope, object_type)(lookup_base ((object_type), (member_scope), ba_any, __null, tf_none
) != (tree) __null)
)
2540 {
2541 if (complain & tf_error)
2542 {
2543 if (TREE_CODE (member)((enum tree_code) (member)->base.code) == FIELD_DECL)
2544 error ("invalid use of non-static data member %qE", member);
2545 else
2546 error ("%qD is not a member of %qT", member, object_type);
2547 }
2548 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2549 }
2550
2551 /* Transform `(a, b).x' into `(*(a, &b)).x', `(a ? b : c).x' into
2552 `(*(a ? &b : &c)).x', and so on. A COND_EXPR is only an lvalue
2553 in the front end; only _DECLs and _REFs are lvalues in the back end. */
2554 {
2555 tree temp = unary_complex_lvalue (ADDR_EXPR, object);
2556 if (temp)
2557 {
2558 temp = cp_build_fold_indirect_ref (temp);
2559 if (xvalue_p (object) && !xvalue_p (temp))
2560 /* Preserve xvalue kind. */
2561 temp = move (temp);
2562 object = temp;
2563 }
2564 }
2565
2566 /* In [expr.ref], there is an explicit list of the valid choices for
2567 MEMBER. We check for each of those cases here. */
2568 if (VAR_P (member)(((enum tree_code) (member)->base.code) == VAR_DECL))
2569 {
2570 /* A static data member. */
2571 result = member;
2572 mark_exp_read (object);
2573
2574 if (tree wrap = maybe_get_tls_wrapper_call (result))
2575 /* Replace an evaluated use of the thread_local variable with
2576 a call to its wrapper. */
2577 result = wrap;
2578
2579 /* If OBJECT has side-effects, they are supposed to occur. */
2580 if (TREE_SIDE_EFFECTS (object)((non_type_check ((object), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2580, __FUNCTION__))->base.side_effects_flag)
)
2581 result = build2 (COMPOUND_EXPR, TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2581, __FUNCTION__))->typed.type)
, object, result);
2582 }
2583 else if (TREE_CODE (member)((enum tree_code) (member)->base.code) == FIELD_DECL)
2584 {
2585 /* A non-static data member. */
2586 bool null_object_p;
2587 int type_quals;
2588 tree member_type;
2589
2590 if (INDIRECT_REF_P (object)(((enum tree_code) (object)->base.code) == INDIRECT_REF))
2591 null_object_p =
2592 integer_zerop (tree_strip_nop_conversions (TREE_OPERAND (object, 0)(*((const_cast<tree*> (tree_operand_check ((object), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2592, __FUNCTION__)))))
));
2593 else
2594 null_object_p = false;
2595
2596 /* Convert OBJECT to the type of MEMBER. */
2597 if (!same_type_p (TYPE_MAIN_VARIANT (object_type),comptypes ((((tree_class_check ((object_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2597, __FUNCTION__))->type_common.main_variant)), (((tree_class_check
((member_scope), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2598, __FUNCTION__))->type_common.main_variant)), 0)
2598 TYPE_MAIN_VARIANT (member_scope))comptypes ((((tree_class_check ((object_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2597, __FUNCTION__))->type_common.main_variant)), (((tree_class_check
((member_scope), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2598, __FUNCTION__))->type_common.main_variant)), 0)
)
2599 {
2600 tree binfo;
2601 base_kind kind;
2602
2603 /* We didn't complain above about a currently open class, but now we
2604 must: we don't know how to refer to a base member before layout is
2605 complete. But still don't complain in a template. */
2606 if (!cp_unevaluated_operand
2607 && !dependent_type_p (object_type)
2608 && !complete_type_or_maybe_complain (object_type, object,
2609 complain))
2610 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2611
2612 binfo = lookup_base (access_path ? access_path : object_type,
2613 member_scope, ba_unique, &kind, complain);
2614 if (binfo == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2615 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2616
2617 /* It is invalid to try to get to a virtual base of a
2618 NULL object. The most common cause is invalid use of
2619 offsetof macro. */
2620 if (null_object_p && kind == bk_via_virtual)
2621 {
2622 if (complain & tf_error)
2623 {
2624 error ("invalid access to non-static data member %qD in "
2625 "virtual base of NULL object", member);
2626 }
2627 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2628 }
2629
2630 /* Convert to the base. */
2631 object = build_base_path (PLUS_EXPR, object, binfo,
2632 /*nonnull=*/1, complain);
2633 /* If we found the base successfully then we should be able
2634 to convert to it successfully. */
2635 gcc_assert (object != error_mark_node)((void)(!(object != global_trees[TI_ERROR_MARK]) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2635, __FUNCTION__), 0 : 0))
;
2636 }
2637
2638 /* If MEMBER is from an anonymous aggregate, we have converted
2639 OBJECT so that it refers to the class containing the
2640 anonymous union. Generate a reference to the anonymous union
2641 itself, and recur to find MEMBER. */
2642 if (ANON_AGGR_TYPE_P (DECL_CONTEXT (member))((((((enum tree_code) (((contains_struct_check ((member), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2642, __FUNCTION__))->decl_minimal.context))->base.code
)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check
((member), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2642, __FUNCTION__))->decl_minimal.context))->base.code
)) == UNION_TYPE) && ((tree_class_check ((((contains_struct_check
((member), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2642, __FUNCTION__))->decl_minimal.context)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2642, __FUNCTION__))->type_common.lang_flag_5)) &&
(((tree_class_check ((((contains_struct_check ((member), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2642, __FUNCTION__))->decl_minimal.context)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2642, __FUNCTION__))->type_with_lang_specific.lang_specific
))->anon_aggr)
2643 /* When this code is called from build_field_call, the
2644 object already has the type of the anonymous union.
2645 That is because the COMPONENT_REF was already
2646 constructed, and was then disassembled before calling
2647 build_field_call. After the function-call code is
2648 cleaned up, this waste can be eliminated. */
2649 && (!same_type_ignoring_top_level_qualifiers_p
2650 (TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2650, __FUNCTION__))->typed.type)
, DECL_CONTEXT (member)((contains_struct_check ((member), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2650, __FUNCTION__))->decl_minimal.context)
)))
2651 {
2652 tree anonymous_union;
2653
2654 anonymous_union = lookup_anon_field (TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2654, __FUNCTION__))->typed.type)
,
2655 DECL_CONTEXT (member)((contains_struct_check ((member), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2655, __FUNCTION__))->decl_minimal.context)
);
2656 object = build_class_member_access_expr (object,
2657 anonymous_union,
2658 /*access_path=*/NULL_TREE(tree) __null,
2659 preserve_reference,
2660 complain);
2661 }
2662
2663 /* Compute the type of the field, as described in [expr.ref]. */
2664 type_quals = TYPE_UNQUALIFIED;
2665 member_type = TREE_TYPE (member)((contains_struct_check ((member), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2665, __FUNCTION__))->typed.type)
;
2666 if (!TYPE_REF_P (member_type)(((enum tree_code) (member_type)->base.code) == REFERENCE_TYPE
)
)
2667 {
2668 type_quals = (cp_type_quals (member_type)
2669 | cp_type_quals (object_type));
2670
2671 /* A field is const (volatile) if the enclosing object, or the
2672 field itself, is const (volatile). But, a mutable field is
2673 not const, even within a const object. */
2674 if (DECL_MUTABLE_P (member)(((contains_struct_check (((tree_check ((member), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2674, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2674, __FUNCTION__))->decl_common.lang_flag_0))
)
2675 type_quals &= ~TYPE_QUAL_CONST;
2676 member_type = cp_build_qualified_type (member_type, type_quals)cp_build_qualified_type_real ((member_type), (type_quals), tf_warning_or_error
)
;
2677 }
2678
2679 result = build3_loc (input_location, COMPONENT_REF, member_type,
2680 object, member, NULL_TREE(tree) __null);
2681
2682 /* Mark the expression const or volatile, as appropriate. Even
2683 though we've dealt with the type above, we still have to mark the
2684 expression itself. */
2685 if (type_quals & TYPE_QUAL_CONST)
2686 TREE_READONLY (result)((non_type_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2686, __FUNCTION__))->base.readonly_flag)
= 1;
2687 if (type_quals & TYPE_QUAL_VOLATILE)
2688 TREE_THIS_VOLATILE (result)((result)->base.volatile_flag) = 1;
2689 }
2690 else if (BASELINK_P (member)(((enum tree_code) (member)->base.code) == BASELINK))
2691 {
2692 /* The member is a (possibly overloaded) member function. */
2693 tree functions;
2694 tree type;
2695
2696 /* If the MEMBER is exactly one static member function, then we
2697 know the type of the expression. Otherwise, we must wait
2698 until overload resolution has been performed. */
2699 functions = BASELINK_FUNCTIONS (member)(((struct tree_baselink*) (tree_check ((member), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2699, __FUNCTION__, (BASELINK))))->functions)
;
2700 if (TREE_CODE (functions)((enum tree_code) (functions)->base.code) == FUNCTION_DECL
2701 && 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2701, __FUNCTION__, (TEMPLATE_DECL))))))))->result : functions
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2701, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2701, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((functions
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2701, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2701, __FUNCTION__); &lt->u.fn; })->static_function
)
)
2702 type = TREE_TYPE (functions)((contains_struct_check ((functions), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2702, __FUNCTION__))->typed.type)
;
2703 else
2704 type = unknown_type_nodecp_global_trees[CPTI_UNKNOWN_TYPE];
2705 /* Note that we do not convert OBJECT to the BASELINK_BINFO
2706 base. That will happen when the function is called. */
2707 result = build3_loc (input_location, COMPONENT_REF, type, object, member,
2708 NULL_TREE(tree) __null);
2709 }
2710 else if (TREE_CODE (member)((enum tree_code) (member)->base.code) == CONST_DECL)
2711 {
2712 /* The member is an enumerator. */
2713 result = member;
2714 /* If OBJECT has side-effects, they are supposed to occur. */
2715 if (TREE_SIDE_EFFECTS (object)((non_type_check ((object), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2715, __FUNCTION__))->base.side_effects_flag)
)
2716 result = build2 (COMPOUND_EXPR, TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2716, __FUNCTION__))->typed.type)
,
2717 object, result);
2718 }
2719 else if ((using_decl = strip_using_decl (member)) != member)
2720 result = build_class_member_access_expr (object,
2721 using_decl,
2722 access_path, preserve_reference,
2723 complain);
2724 else
2725 {
2726 if (complain & tf_error)
2727 error ("invalid use of %qD", member);
2728 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2729 }
2730
2731 if (!preserve_reference)
2732 /* [expr.ref]
2733
2734 If E2 is declared to have type "reference to T", then ... the
2735 type of E1.E2 is T. */
2736 result = convert_from_reference (result);
2737
2738 return result;
2739}
2740
2741/* Return the destructor denoted by OBJECT.SCOPE::DTOR_NAME, or, if
2742 SCOPE is NULL, by OBJECT.DTOR_NAME, where DTOR_NAME is ~type. */
2743
2744tree
2745lookup_destructor (tree object, tree scope, tree dtor_name,
2746 tsubst_flags_t complain)
2747{
2748 tree object_type = TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2748, __FUNCTION__))->typed.type)
;
2749 tree dtor_type = TREE_OPERAND (dtor_name, 0)(*((const_cast<tree*> (tree_operand_check ((dtor_name),
(0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2749, __FUNCTION__)))))
;
2750 tree expr;
2751
2752 /* We've already complained about this destructor. */
2753 if (dtor_type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2754 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2755
2756 if (scope && !check_dtor_name (scope, dtor_type))
2757 {
2758 if (complain & tf_error)
2759 error ("qualified type %qT does not match destructor name ~%qT",
2760 scope, dtor_type);
2761 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2762 }
2763 if (is_auto (dtor_type))
2764 dtor_type = object_type;
2765 else if (identifier_p (dtor_type))
2766 {
2767 /* In a template, names we can't find a match for are still accepted
2768 destructor names, and we check them here. */
2769 if (check_dtor_name (object_type, dtor_type))
2770 dtor_type = object_type;
2771 else
2772 {
2773 if (complain & tf_error)
2774 error ("object type %qT does not match destructor name ~%qT",
2775 object_type, dtor_type);
2776 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2777 }
2778
2779 }
2780 else if (!DERIVED_FROM_P (dtor_type, TYPE_MAIN_VARIANT (object_type))(lookup_base ((((tree_class_check ((object_type), (tcc_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2780, __FUNCTION__))->type_common.main_variant)), (dtor_type
), ba_any, __null, tf_none) != (tree) __null)
)
2781 {
2782 if (complain & tf_error)
2783 error ("the type being destroyed is %qT, but the destructor "
2784 "refers to %qT", TYPE_MAIN_VARIANT (object_type)((tree_class_check ((object_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2784, __FUNCTION__))->type_common.main_variant)
, dtor_type);
2785 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2786 }
2787 expr = lookup_member (dtor_type, complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER],
2788 /*protect=*/1, /*want_type=*/false,
2789 tf_warning_or_error);
2790 if (!expr)
2791 {
2792 if (complain & tf_error)
2793 cxx_incomplete_type_error (dtor_name, dtor_type);
2794 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2795 }
2796 expr = (adjust_result_of_qualified_name_lookup
2797 (expr, dtor_type, object_type));
2798 if (scope == NULL_TREE(tree) __null)
2799 /* We need to call adjust_result_of_qualified_name_lookup in case the
2800 destructor names a base class, but we unset BASELINK_QUALIFIED_P so
2801 that we still get virtual function binding. */
2802 BASELINK_QUALIFIED_P (expr)((tree_not_check2 (((tree_check ((expr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2802, __FUNCTION__, (BASELINK)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2802, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= false;
2803 return expr;
2804}
2805
2806/* An expression of the form "A::template B" has been resolved to
2807 DECL. Issue a diagnostic if B is not a template or template
2808 specialization. */
2809
2810void
2811check_template_keyword (tree decl)
2812{
2813 /* The standard says:
2814
2815 [temp.names]
2816
2817 If a name prefixed by the keyword template is not a member
2818 template, the program is ill-formed.
2819
2820 DR 228 removed the restriction that the template be a member
2821 template.
2822
2823 DR 96, if accepted would add the further restriction that explicit
2824 template arguments must be provided if the template keyword is
2825 used, but, as of 2005-10-16, that DR is still in "drafting". If
2826 this DR is accepted, then the semantic checks here can be
2827 simplified, as the entity named must in fact be a template
2828 specialization, rather than, as at present, a set of overloaded
2829 functions containing at least one template function. */
2830 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TEMPLATE_DECL
2831 && TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TEMPLATE_ID_EXPR)
2832 {
2833 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
2834 {
2835 if (DECL_USE_TEMPLATE (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2835, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
2836 && 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2836, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
2837 ;
2838 else
2839 permerror (input_location, "%qD is not a template", decl);
2840 }
2841 else if (!is_overloaded_fn (decl))
2842 permerror (input_location, "%qD is not a template", decl);
2843 else
2844 {
2845 bool found = false;
2846
2847 for (lkp_iterator iter (MAYBE_BASELINK_FUNCTIONS (decl)((((enum tree_code) (decl)->base.code) == BASELINK) ? (((struct
tree_baselink*) (tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2847, __FUNCTION__, (BASELINK))))->functions) : decl)
);
2848 !found && iter; ++iter)
2849 {
2850 tree fn = *iter;
2851 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL
2852 || TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_ID_EXPR
2853 || (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL
2854 && DECL_USE_TEMPLATE (fn)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2854, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
2855 && 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2855, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
))
2856 found = true;
2857 }
2858 if (!found)
2859 permerror (input_location, "%qD is not a template", decl);
2860 }
2861 }
2862}
2863
2864/* Record that an access failure occurred on BASETYPE_PATH attempting
2865 to access DECL, where DIAG_DECL should be used for diagnostics. */
2866
2867void
2868access_failure_info::record_access_failure (tree basetype_path,
2869 tree decl, tree diag_decl)
2870{
2871 m_was_inaccessible = true;
2872 m_basetype_path = basetype_path;
2873 m_decl = decl;
2874 m_diag_decl = diag_decl;
2875}
2876
2877/* If an access failure was recorded, then attempt to locate an
2878 accessor function for the pertinent field.
2879 Otherwise, return NULL_TREE. */
2880
2881tree
2882access_failure_info::get_any_accessor (bool const_p) const
2883{
2884 if (!was_inaccessible_p ())
2885 return NULL_TREE(tree) __null;
2886
2887 tree accessor
2888 = locate_field_accessor (m_basetype_path, m_diag_decl, const_p);
2889 if (!accessor)
2890 return NULL_TREE(tree) __null;
2891
2892 /* The accessor must itself be accessible for it to be a reasonable
2893 suggestion. */
2894 if (!accessible_p (m_basetype_path, accessor, true))
2895 return NULL_TREE(tree) __null;
2896
2897 return accessor;
2898}
2899
2900/* Add a fix-it hint to RICHLOC suggesting the use of ACCESSOR_DECL, by
2901 replacing the primary location in RICHLOC with "accessor()". */
2902
2903void
2904access_failure_info::add_fixit_hint (rich_location *richloc,
2905 tree accessor_decl)
2906{
2907 pretty_printer pp;
2908 pp_string (&pp, IDENTIFIER_POINTER (DECL_NAME (accessor_decl))((const char *) (tree_check ((((contains_struct_check ((accessor_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2908, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2908, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
);
2909 pp_string (&pp, "()");
2910 richloc->add_fixit_replace (pp_formatted_text (&pp));
2911}
2912
2913/* If an access failure was recorded, then attempt to locate an
2914 accessor function for the pertinent field, and if one is
2915 available, add a note and fix-it hint suggesting using it. */
2916
2917void
2918access_failure_info::maybe_suggest_accessor (bool const_p) const
2919{
2920 tree accessor = get_any_accessor (const_p);
2921 if (accessor == NULL_TREE(tree) __null)
2922 return;
2923 rich_location richloc (line_table, input_location);
2924 add_fixit_hint (&richloc, accessor);
2925 inform (&richloc, "field %q#D can be accessed via %q#D",
2926 m_diag_decl, accessor);
2927}
2928
2929/* Subroutine of finish_class_member_access_expr.
2930 Issue an error about NAME not being a member of ACCESS_PATH (or
2931 OBJECT_TYPE), potentially providing a fix-it hint for misspelled
2932 names. */
2933
2934static void
2935complain_about_unrecognized_member (tree access_path, tree name,
2936 tree object_type)
2937{
2938 /* Attempt to provide a hint about misspelled names. */
2939 tree guessed_id = lookup_member_fuzzy (access_path, name,
2940 /*want_type=*/false);
2941 if (guessed_id == NULL_TREE(tree) __null)
2942 {
2943 /* No hint. */
2944 error ("%q#T has no member named %qE",
2945 TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO
2946 ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2946, __FUNCTION__))->typed.type)
: object_type, name);
2947 return;
2948 }
2949
2950 location_t bogus_component_loc = input_location;
2951 gcc_rich_location rich_loc (bogus_component_loc);
2952
2953 /* Check that the guessed name is accessible along access_path. */
2954 access_failure_info afi;
2955 lookup_member (access_path, guessed_id, /*protect=*/1,
2956 /*want_type=*/false, /*complain=*/false,
2957 &afi);
2958 if (afi.was_inaccessible_p ())
2959 {
2960 tree accessor = afi.get_any_accessor (TYPE_READONLY (object_type)((tree_class_check ((object_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2960, __FUNCTION__))->base.readonly_flag)
);
2961 if (accessor)
2962 {
2963 /* The guessed name isn't directly accessible, but can be accessed
2964 via an accessor member function. */
2965 afi.add_fixit_hint (&rich_loc, accessor);
2966 error_at (&rich_loc,
2967 "%q#T has no member named %qE;"
2968 " did you mean %q#D? (accessible via %q#D)",
2969 TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO
2970 ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2970, __FUNCTION__))->typed.type)
: object_type,
2971 name, afi.get_diag_decl (), accessor);
2972 }
2973 else
2974 {
2975 /* The guessed name isn't directly accessible, and no accessor
2976 member function could be found. */
2977 error_at (&rich_loc,
2978 "%q#T has no member named %qE;"
2979 " did you mean %q#D? (not accessible from this context)",
2980 TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO
2981 ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2981, __FUNCTION__))->typed.type)
: object_type,
2982 name, afi.get_diag_decl ());
2983 complain_about_access (afi.get_decl (), afi.get_diag_decl (), false);
2984 }
2985 }
2986 else
2987 {
2988 /* The guessed name is directly accessible; suggest it. */
2989 rich_loc.add_fixit_misspelled_id (bogus_component_loc,
2990 guessed_id);
2991 error_at (&rich_loc,
2992 "%q#T has no member named %qE;"
2993 " did you mean %qE?",
2994 TREE_CODE (access_path)((enum tree_code) (access_path)->base.code) == TREE_BINFO
2995 ? TREE_TYPE (access_path)((contains_struct_check ((access_path), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 2995, __FUNCTION__))->typed.type)
: object_type,
2996 name, guessed_id);
2997 }
2998}
2999
3000/* This function is called by the parser to process a class member
3001 access expression of the form OBJECT.NAME. NAME is a node used by
3002 the parser to represent a name; it is not yet a DECL. It may,
3003 however, be a BASELINK where the BASELINK_FUNCTIONS is a
3004 TEMPLATE_ID_EXPR. Templates must be looked up by the parser, and
3005 there is no reason to do the lookup twice, so the parser keeps the
3006 BASELINK. TEMPLATE_P is true iff NAME was explicitly declared to
3007 be a template via the use of the "A::template B" syntax. */
3008
3009tree
3010finish_class_member_access_expr (cp_expr object, tree name, bool template_p,
3011 tsubst_flags_t complain)
3012{
3013 tree expr;
3014 tree object_type;
3015 tree member;
3016 tree access_path = NULL_TREE(tree) __null;
3017 tree orig_object = object;
3018 tree orig_name = name;
3019
3020 if (object == error_mark_nodeglobal_trees[TI_ERROR_MARK] || name == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3021 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3022
3023 /* If OBJECT is an ObjC class instance, we must obey ObjC access rules. */
3024 if (!objc_is_public (object, name))
3025 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3026
3027 object_type = TREE_TYPE (object)((contains_struct_check ((object), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3027, __FUNCTION__))->typed.type)
;
3028
3029 if (processing_template_declscope_chain->x_processing_template_decl)
3030 {
3031 if (/* If OBJECT is dependent, so is OBJECT.NAME. */
3032 type_dependent_object_expression_p (object)
3033 /* If NAME is "f<args>", where either 'f' or 'args' is
3034 dependent, then the expression is dependent. */
3035 || (TREE_CODE (name)((enum tree_code) (name)->base.code) == TEMPLATE_ID_EXPR
3036 && dependent_template_id_p (TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3036, __FUNCTION__)))))
,
3037 TREE_OPERAND (name, 1)(*((const_cast<tree*> (tree_operand_check ((name), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3037, __FUNCTION__)))))
))
3038 /* If NAME is "T::X" where "T" is dependent, then the
3039 expression is dependent. */
3040 || (TREE_CODE (name)((enum tree_code) (name)->base.code) == SCOPE_REF
3041 && TYPE_P (TREE_OPERAND (name, 0))(tree_code_type[(int) (((enum tree_code) ((*((const_cast<tree
*> (tree_operand_check ((name), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3041, __FUNCTION__))))))->base.code))] == tcc_type)
3042 && dependent_scope_p (TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3042, __FUNCTION__)))))
))
3043 /* If NAME is operator T where "T" is dependent, we can't
3044 lookup until we instantiate the T. */
3045 || (TREE_CODE (name)((enum tree_code) (name)->base.code) == IDENTIFIER_NODE
3046 && IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3046, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3046, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3046, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3046, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3046, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3046, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
3047 && dependent_type_p (TREE_TYPE (name)((contains_struct_check ((name), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3047, __FUNCTION__))->typed.type)
)))
3048 {
3049 dependent:
3050 return build_min_nt_loc (UNKNOWN_LOCATION((location_t) 0), COMPONENT_REF,
3051 orig_object, orig_name, NULL_TREE(tree) __null);
3052 }
3053 object = build_non_dependent_expr (object);
3054 }
3055 else if (c_dialect_objc ()((c_language & clk_objc) != 0)
3056 && identifier_p (name)
3057 && (expr = objc_maybe_build_component_ref (object, name)))
3058 return expr;
3059
3060 /* [expr.ref]
3061
3062 The type of the first expression shall be "class object" (of a
3063 complete type). */
3064 if (!currently_open_class (object_type)
3065 && !complete_type_or_maybe_complain (object_type, object, complain))
3066 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3067 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3067, __FUNCTION__))->type_common.lang_flag_5))
)
3068 {
3069 if (complain & tf_error)
3070 {
3071 if (INDIRECT_TYPE_P (object_type)((((enum tree_code) (object_type)->base.code) == POINTER_TYPE
) || (((enum tree_code) (object_type)->base.code) == REFERENCE_TYPE
))
3072 && CLASS_TYPE_P (TREE_TYPE (object_type))(((((enum tree_code) (((contains_struct_check ((object_type),
(TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3072, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((object_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3072, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((object_type
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3072, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3072, __FUNCTION__))->type_common.lang_flag_5))
)
3073 error ("request for member %qD in %qE, which is of pointer "
3074 "type %qT (maybe you meant to use %<->%> ?)",
3075 name, object.get_value (), object_type);
3076 else
3077 error ("request for member %qD in %qE, which is of non-class "
3078 "type %qT", name, object.get_value (), object_type);
3079 }
3080 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3081 }
3082
3083 if (BASELINK_P (name)(((enum tree_code) (name)->base.code) == BASELINK))
3084 /* A member function that has already been looked up. */
3085 member = name;
3086 else
3087 {
3088 bool is_template_id = false;
3089 tree template_args = NULL_TREE(tree) __null;
3090 tree scope = NULL_TREE(tree) __null;
3091
3092 access_path = object_type;
3093
3094 if (TREE_CODE (name)((enum tree_code) (name)->base.code) == SCOPE_REF)
3095 {
3096 /* A qualified name. The qualifying class or namespace `S'
3097 has already been looked up; it is either a TYPE or a
3098 NAMESPACE_DECL. */
3099 scope = TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3099, __FUNCTION__)))))
;
3100 name = TREE_OPERAND (name, 1)(*((const_cast<tree*> (tree_operand_check ((name), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3100, __FUNCTION__)))))
;
3101
3102 /* If SCOPE is a namespace, then the qualified name does not
3103 name a member of OBJECT_TYPE. */
3104 if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) == NAMESPACE_DECL)
3105 {
3106 if (complain & tf_error)
3107 error ("%<%D::%D%> is not a member of %qT",
3108 scope, name, object_type);
3109 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3110 }
3111 }
3112
3113 if (TREE_CODE (name)((enum tree_code) (name)->base.code) == TEMPLATE_ID_EXPR)
3114 {
3115 is_template_id = true;
3116 template_args = TREE_OPERAND (name, 1)(*((const_cast<tree*> (tree_operand_check ((name), (1),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3116, __FUNCTION__)))))
;
3117 name = TREE_OPERAND (name, 0)(*((const_cast<tree*> (tree_operand_check ((name), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3117, __FUNCTION__)))))
;
3118
3119 if (!identifier_p (name))
3120 name = OVL_NAME (name)((contains_struct_check ((ovl_first (name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3120, __FUNCTION__))->decl_minimal.name)
;
3121 }
3122
3123 if (scope)
3124 {
3125 if (TREE_CODE (scope)((enum tree_code) (scope)->base.code) == ENUMERAL_TYPE)
3126 {
3127 gcc_assert (!is_template_id)((void)(!(!is_template_id) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3127, __FUNCTION__), 0 : 0))
;
3128 /* Looking up a member enumerator (c++/56793). */
3129 if (!TYPE_CLASS_SCOPE_P (scope)(((tree_class_check ((scope), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3129, __FUNCTION__))->type_common.context) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((scope), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3129, __FUNCTION__))->type_common.context))->base.code
))] == tcc_type))
3130 || !DERIVED_FROM_P (TYPE_CONTEXT (scope), object_type)(lookup_base ((object_type), (((tree_class_check ((scope), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3130, __FUNCTION__))->type_common.context)), ba_any, __null
, tf_none) != (tree) __null)
)
3131 {
3132 if (complain & tf_error)
3133 error ("%<%D::%D%> is not a member of %qT",
3134 scope, name, object_type);
3135 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3136 }
3137 tree val = lookup_enumerator (scope, name);
3138 if (!val)
3139 {
3140 if (complain & tf_error)
3141 error ("%qD is not a member of %qD",
3142 name, scope);
3143 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3144 }
3145
3146 if (TREE_SIDE_EFFECTS (object)((non_type_check ((object), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3146, __FUNCTION__))->base.side_effects_flag)
)
3147 val = build2 (COMPOUND_EXPR, TREE_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3147, __FUNCTION__))->typed.type)
, object, val);
3148 return val;
3149 }
3150
3151 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3151, __FUNCTION__))->type_common.lang_flag_5))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3151, __FUNCTION__), 0 : 0))
;
3152 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 ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3152, __FUNCTION__), 0 : 0))
;
3153
3154 if (constructor_name_p (name, scope))
3155 {
3156 if (complain & tf_error)
3157 error ("cannot call constructor %<%T::%D%> directly",
3158 scope, name);
3159 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3160 }
3161
3162 /* Find the base of OBJECT_TYPE corresponding to SCOPE. */
3163 access_path = lookup_base (object_type, scope, ba_check,
3164 NULL__null, complain);
3165 if (access_path == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3166 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3167 if (!access_path)
3168 {
3169 if (any_dependent_bases_p (object_type))
3170 goto dependent;
3171 if (complain & tf_error)
3172 error ("%qT is not a base of %qT", scope, object_type);
3173 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3174 }
3175 }
3176
3177 if (TREE_CODE (name)((enum tree_code) (name)->base.code) == BIT_NOT_EXPR)
3178 {
3179 if (dependent_type_p (object_type))
3180 /* The destructor isn't declared yet. */
3181 goto dependent;
3182 member = lookup_destructor (object, scope, name, complain);
3183 }
3184 else
3185 {
3186 /* Look up the member. */
3187 access_failure_info afi;
3188 member = lookup_member (access_path, name, /*protect=*/1,
3189 /*want_type=*/false, complain,
3190 &afi);
3191 afi.maybe_suggest_accessor (TYPE_READONLY (object_type)((tree_class_check ((object_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3191, __FUNCTION__))->base.readonly_flag)
);
3192 if (member == NULL_TREE(tree) __null)
3193 {
3194 if (dependent_type_p (object_type))
3195 /* Try again at instantiation time. */
3196 goto dependent;
3197 if (complain & tf_error)
3198 complain_about_unrecognized_member (access_path, name,
3199 object_type);
3200 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3201 }
3202 if (member == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3203 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3204 if (DECL_P (member)(tree_code_type[(int) (((enum tree_code) (member)->base.code
))] == tcc_declaration)
3205 && any_dependent_type_attributes_p (DECL_ATTRIBUTES (member)((contains_struct_check ((member), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3205, __FUNCTION__))->decl_common.attributes)
))
3206 /* Dependent type attributes on the decl mean that the TREE_TYPE is
3207 wrong, so don't use it. */
3208 goto dependent;
3209 if (TREE_CODE (member)((enum tree_code) (member)->base.code) == USING_DECL && DECL_DEPENDENT_P (member)((contains_struct_check (((tree_check ((member), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3209, __FUNCTION__, (USING_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3209, __FUNCTION__))->decl_common.lang_flag_0)
)
3210 goto dependent;
3211 }
3212
3213 if (is_template_id)
3214 {
3215 tree templ = member;
3216
3217 if (BASELINK_P (templ)(((enum tree_code) (templ)->base.code) == BASELINK))
3218 member = lookup_template_function (templ, template_args);
3219 else if (variable_template_p (templ))
3220 member = (lookup_and_finish_template_variable
3221 (templ, template_args, complain));
3222 else
3223 {
3224 if (complain & tf_error)
3225 error ("%qD is not a member template function", name);
3226 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3227 }
3228 }
3229 }
3230
3231 if (TREE_DEPRECATED (member)((member)->base.deprecated_flag))
3232 warn_deprecated_use (member, NULL_TREE(tree) __null);
3233
3234 if (template_p)
3235 check_template_keyword (member);
3236
3237 expr = build_class_member_access_expr (object, member, access_path,
3238 /*preserve_reference=*/false,
3239 complain);
3240 if (processing_template_declscope_chain->x_processing_template_decl && expr != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3241 {
3242 if (BASELINK_P (member)(((enum tree_code) (member)->base.code) == BASELINK))
3243 {
3244 if (TREE_CODE (orig_name)((enum tree_code) (orig_name)->base.code) == SCOPE_REF)
3245 BASELINK_QUALIFIED_P (member)((tree_not_check2 (((tree_check ((member), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3245, __FUNCTION__, (BASELINK)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3245, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= 1;
3246 orig_name = member;
3247 }
3248 return build_min_non_dep (COMPONENT_REF, expr,
3249 orig_object, orig_name,
3250 NULL_TREE(tree) __null);
3251 }
3252
3253 return expr;
3254}
3255
3256/* Build a COMPONENT_REF of OBJECT and MEMBER with the appropriate
3257 type. */
3258
3259tree
3260build_simple_component_ref (tree object, tree member)
3261{
3262 tree type = cp_build_qualified_type (TREE_TYPE (member),cp_build_qualified_type_real ((((contains_struct_check ((member
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3262, __FUNCTION__))->typed.type)), (cp_type_quals (((contains_struct_check
((object), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3263, __FUNCTION__))->typed.type))), tf_warning_or_error
)
3263 cp_type_quals (TREE_TYPE (object)))cp_build_qualified_type_real ((((contains_struct_check ((member
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3262, __FUNCTION__))->typed.type)), (cp_type_quals (((contains_struct_check
((object), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3263, __FUNCTION__))->typed.type))), tf_warning_or_error
)
;
3264 return build3_loc (input_location,
3265 COMPONENT_REF, type,
3266 object, member, NULL_TREE(tree) __null);
3267}
3268
3269/* Return an expression for the MEMBER_NAME field in the internal
3270 representation of PTRMEM, a pointer-to-member function. (Each
3271 pointer-to-member function type gets its own RECORD_TYPE so it is
3272 more convenient to access the fields by name than by FIELD_DECL.)
3273 This routine converts the NAME to a FIELD_DECL and then creates the
3274 node for the complete expression. */
3275
3276tree
3277build_ptrmemfunc_access_expr (tree ptrmem, tree member_name)
3278{
3279 tree ptrmem_type;
3280 tree member;
3281
3282 if (TREE_CODE (ptrmem)((enum tree_code) (ptrmem)->base.code) == CONSTRUCTOR)
3283 {
3284 unsigned int ix;
3285 tree index, value;
3286 FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (ptrmem),for (ix = 0; (ix >= vec_safe_length (((tree_check ((ptrmem
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3286, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : (((void) (value = (*((tree_check ((ptrmem), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3286, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))[
ix].value)), (index = (*((tree_check ((ptrmem), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3286, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))[
ix].index), true); (ix)++)
3287 ix, index, value)for (ix = 0; (ix >= vec_safe_length (((tree_check ((ptrmem
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3286, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)))
? false : (((void) (value = (*((tree_check ((ptrmem), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3286, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))[
ix].value)), (index = (*((tree_check ((ptrmem), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3286, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))[
ix].index), true); (ix)++)
3288 if (index && DECL_P (index)(tree_code_type[(int) (((enum tree_code) (index)->base.code
))] == tcc_declaration)
&& DECL_NAME (index)((contains_struct_check ((index), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3288, __FUNCTION__))->decl_minimal.name)
== member_name)
3289 return value;
3290 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3290, __FUNCTION__))
;
3291 }
3292
3293 /* This code is a stripped down version of
3294 build_class_member_access_expr. It does not work to use that
3295 routine directly because it expects the object to be of class
3296 type. */
3297 ptrmem_type = TREE_TYPE (ptrmem)((contains_struct_check ((ptrmem), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3297, __FUNCTION__))->typed.type)
;
3298 gcc_assert (TYPE_PTRMEMFUNC_P (ptrmem_type))((void)(!((((enum tree_code) (ptrmem_type)->base.code) == RECORD_TYPE
&& (((tree_class_check (((tree_check ((ptrmem_type),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3298, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3298, __FUNCTION__))->type_common.lang_flag_2)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3298, __FUNCTION__), 0 : 0))
;
3299 for (member = TYPE_FIELDS (ptrmem_type)((tree_check3 ((ptrmem_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3299, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)
; member;
3300 member = DECL_CHAIN (member)(((contains_struct_check (((contains_struct_check ((member), (
TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3300, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3300, __FUNCTION__))->common.chain))
)
3301 if (DECL_NAME (member)((contains_struct_check ((member), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3301, __FUNCTION__))->decl_minimal.name)
== member_name)
3302 break;
3303 tree res = build_simple_component_ref (ptrmem, member);
3304
3305 TREE_NO_WARNING (res)((res)->base.nowarning_flag) = 1;
3306 return res;
3307}
3308
3309/* Given an expression PTR for a pointer, return an expression
3310 for the value pointed to.
3311 ERRORSTRING is the name of the operator to appear in error messages.
3312
3313 This function may need to overload OPERATOR_FNNAME.
3314 Must also handle REFERENCE_TYPEs for C++. */
3315
3316tree
3317build_x_indirect_ref (location_t loc, tree expr, ref_operator errorstring,
3318 tsubst_flags_t complain)
3319{
3320 tree orig_expr = expr;
3321 tree rval;
3322 tree overload = NULL_TREE(tree) __null;
3323
3324 if (processing_template_declscope_chain->x_processing_template_decl)
3325 {
3326 /* Retain the type if we know the operand is a pointer. */
3327 if (TREE_TYPE (expr)((contains_struct_check ((expr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3327, __FUNCTION__))->typed.type)
&& INDIRECT_TYPE_P (TREE_TYPE (expr))((((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3327, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
) || (((enum tree_code) (((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3327, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
))
)
3328 return build_min (INDIRECT_REF, TREE_TYPE (TREE_TYPE (expr))((contains_struct_check ((((contains_struct_check ((expr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3328, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3328, __FUNCTION__))->typed.type)
, expr);
3329 if (type_dependent_expression_p (expr))
3330 return build_min_nt_loc (loc, INDIRECT_REF, expr);
3331 expr = build_non_dependent_expr (expr);
3332 }
3333
3334 rval = build_new_op (loc, INDIRECT_REF, LOOKUP_NORMAL((1 << 0)), expr,
3335 NULL_TREE(tree) __null, NULL_TREE(tree) __null, &overload, complain);
3336 if (!rval)
3337 rval = cp_build_indirect_ref (loc, expr, errorstring, complain);
3338
3339 if (processing_template_declscope_chain->x_processing_template_decl && rval != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3340 {
3341 if (overload != NULL_TREE(tree) __null)
3342 return (build_min_non_dep_op_overload
3343 (INDIRECT_REF, rval, overload, orig_expr));
3344
3345 return build_min_non_dep (INDIRECT_REF, rval, orig_expr);
3346 }
3347 else
3348 return rval;
3349}
3350
3351/* Like c-family strict_aliasing_warning, but don't warn for dependent
3352 types or expressions. */
3353
3354static bool
3355cp_strict_aliasing_warning (location_t loc, tree type, tree expr)
3356{
3357 if (processing_template_declscope_chain->x_processing_template_decl)
3358 {
3359 tree e = expr;
3360 STRIP_NOPS (e)(e) = tree_strip_nop_conversions ((const_cast<union tree_node
*> (((e)))))
;
3361 if (dependent_type_p (type) || type_dependent_expression_p (e))
3362 return false;
3363 }
3364 return strict_aliasing_warning (loc, type, expr);
3365}
3366
3367/* The implementation of the above, and of indirection implied by other
3368 constructs. If DO_FOLD is true, fold away INDIRECT_REF of ADDR_EXPR. */
3369
3370static tree
3371cp_build_indirect_ref_1 (location_t loc, tree ptr, ref_operator errorstring,
3372 tsubst_flags_t complain, bool do_fold)
3373{
3374 tree pointer, type;
3375
3376 /* RO_NULL should only be used with the folding entry points below, not
3377 cp_build_indirect_ref. */
3378 gcc_checking_assert (errorstring != RO_NULL || do_fold)((void)(!(errorstring != RO_NULL || do_fold) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3378, __FUNCTION__), 0 : 0))
;
3379
3380 if (ptr == current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun
+ 0)->language)->x_current_class_ptr : &scope_chain
->x_current_class_ptr))
3381 || (TREE_CODE (ptr)((enum tree_code) (ptr)->base.code) == NOP_EXPR
3382 && TREE_OPERAND (ptr, 0)(*((const_cast<tree*> (tree_operand_check ((ptr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3382, __FUNCTION__)))))
== current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun
+ 0)->language)->x_current_class_ptr : &scope_chain
->x_current_class_ptr))
3383 && (same_type_ignoring_top_level_qualifiers_p
3384 (TREE_TYPE (ptr)((contains_struct_check ((ptr), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3384, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3384, __FUNCTION__))->typed.type)
))))
3385 return current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun
+ 0)->language)->x_current_class_ref : &scope_chain
->x_current_class_ref))
;
3386
3387 pointer = (TYPE_REF_P (TREE_TYPE (ptr))(((enum tree_code) (((contains_struct_check ((ptr), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3387, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
3388 ? ptr : decay_conversion (ptr, complain));
3389 if (pointer == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3390 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3391
3392 type = TREE_TYPE (pointer)((contains_struct_check ((pointer), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3392, __FUNCTION__))->typed.type)
;
3393
3394 if (INDIRECT_TYPE_P (type)((((enum tree_code) (type)->base.code) == POINTER_TYPE) ||
(((enum tree_code) (type)->base.code) == REFERENCE_TYPE))
)
3395 {
3396 /* [expr.unary.op]
3397
3398 If the type of the expression is "pointer to T," the type
3399 of the result is "T." */
3400 tree t = TREE_TYPE (type)((contains_struct_check ((type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3400, __FUNCTION__))->typed.type)
;
3401
3402 if ((CONVERT_EXPR_P (ptr)((((enum tree_code) (ptr)->base.code)) == NOP_EXPR || (((enum
tree_code) (ptr)->base.code)) == CONVERT_EXPR)
3403 || TREE_CODE (ptr)((enum tree_code) (ptr)->base.code) == VIEW_CONVERT_EXPR)
3404 && (!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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3404, __FUNCTION__))->type_common.lang_flag_5))
|| !CLASSTYPE_EMPTY_P (t)((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3404, __FUNCTION__))->type_with_lang_specific.lang_specific
))->empty_p)
))
3405 {
3406 /* If a warning is issued, mark it to avoid duplicates from
3407 the backend. This only needs to be done at
3408 warn_strict_aliasing > 2. */
3409 if (warn_strict_aliasingglobal_options.x_warn_strict_aliasing > 2
3410 && cp_strict_aliasing_warning (EXPR_LOCATION (ptr)((((ptr)) && ((tree_code_type[(int) (((enum tree_code
) ((ptr))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((ptr))->base.code))]) <= tcc_expression
)) ? (ptr)->exp.locus : ((location_t) 0))
,
3411 type, TREE_OPERAND (ptr, 0)(*((const_cast<tree*> (tree_operand_check ((ptr), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3411, __FUNCTION__)))))
))
3412 TREE_NO_WARNING (ptr)((ptr)->base.nowarning_flag) = 1;
3413 }
3414
3415 if (VOID_TYPE_P (t)(((enum tree_code) (t)->base.code) == VOID_TYPE))
3416 {
3417 /* A pointer to incomplete type (other than cv void) can be
3418 dereferenced [expr.unary.op]/1 */
3419 if (complain & tf_error)
3420 error_at (loc, "%qT is not a pointer-to-object type", type);
3421 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3422 }
3423 else if (do_fold && TREE_CODE (pointer)((enum tree_code) (pointer)->base.code) == ADDR_EXPR
3424 && same_type_p (t, TREE_TYPE (TREE_OPERAND (pointer, 0)))comptypes ((t), (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((pointer), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3424, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3424, __FUNCTION__))->typed.type)), 0)
)
3425 /* The POINTER was something like `&x'. We simplify `*&x' to
3426 `x'. */
3427 return TREE_OPERAND (pointer, 0)(*((const_cast<tree*> (tree_operand_check ((pointer), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3427, __FUNCTION__)))))
;
3428 else
3429 {
3430 tree ref = build1 (INDIRECT_REF, t, pointer);
3431
3432 /* We *must* set TREE_READONLY when dereferencing a pointer to const,
3433 so that we get the proper error message if the result is used
3434 to assign to. Also, &* is supposed to be a no-op. */
3435 TREE_READONLY (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3435, __FUNCTION__))->base.readonly_flag)
= CP_TYPE_CONST_P (t)((cp_type_quals (t) & TYPE_QUAL_CONST) != 0);
3436 TREE_THIS_VOLATILE (ref)((ref)->base.volatile_flag) = CP_TYPE_VOLATILE_P (t)((cp_type_quals (t) & TYPE_QUAL_VOLATILE) != 0);
3437 TREE_SIDE_EFFECTS (ref)((non_type_check ((ref), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3437, __FUNCTION__))->base.side_effects_flag)
3438 = (TREE_THIS_VOLATILE (ref)((ref)->base.volatile_flag) || TREE_SIDE_EFFECTS (pointer)((non_type_check ((pointer), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3438, __FUNCTION__))->base.side_effects_flag)
);
3439 return ref;
3440 }
3441 }
3442 else if (!(complain & tf_error))
3443 /* Don't emit any errors; we'll just return ERROR_MARK_NODE later. */
3444 ;
3445 /* `pointer' won't be an error_mark_node if we were given a
3446 pointer to member, so it's cool to check for this here. */
3447 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3447, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3447, __FUNCTION__))->type_common.lang_flag_2))))
)
3448 switch (errorstring)
3449 {
3450 case RO_ARRAY_INDEXING:
3451 error_at (loc,
3452 "invalid use of array indexing on pointer to member");
3453 break;
3454 case RO_UNARY_STAR:
3455 error_at (loc, "invalid use of unary %<*%> on pointer to member");
3456 break;
3457 case RO_IMPLICIT_CONVERSION:
3458 error_at (loc, "invalid use of implicit conversion on pointer "
3459 "to member");
3460 break;
3461 case RO_ARROW_STAR:
3462 error_at (loc, "left hand operand of %<->*%> must be a pointer to "
3463 "class, but is a pointer to member of type %qT", type);
3464 break;
3465 default:
3466 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3466, __FUNCTION__))
;
3467 }
3468 else if (pointer != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3469 invalid_indirection_error (loc, type, errorstring);
3470
3471 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3472}
3473
3474/* Entry point used by c-common, which expects folding. */
3475
3476tree
3477build_indirect_ref (location_t loc, tree ptr, ref_operator errorstring)
3478{
3479 return cp_build_indirect_ref_1 (loc, ptr, errorstring,
3480 tf_warning_or_error, true);
3481}
3482
3483/* Entry point used by internal indirection needs that don't correspond to any
3484 syntactic construct. */
3485
3486tree
3487cp_build_fold_indirect_ref (tree pointer)
3488{
3489 return cp_build_indirect_ref_1 (input_location, pointer, RO_NULL,
3490 tf_warning_or_error, true);
3491}
3492
3493/* Entry point used by indirection needs that correspond to some syntactic
3494 construct. */
3495
3496tree
3497cp_build_indirect_ref (location_t loc, tree ptr, ref_operator errorstring,
3498 tsubst_flags_t complain)
3499{
3500 return cp_build_indirect_ref_1 (loc, ptr, errorstring, complain, false);
3501}
3502
3503/* This handles expressions of the form "a[i]", which denotes
3504 an array reference.
3505
3506 This is logically equivalent in C to *(a+i), but we may do it differently.
3507 If A is a variable or a member, we generate a primitive ARRAY_REF.
3508 This avoids forcing the array out of registers, and can work on
3509 arrays that are not lvalues (for example, members of structures returned
3510 by functions).
3511
3512 If INDEX is of some user-defined type, it must be converted to
3513 integer type. Otherwise, to make a compatible PLUS_EXPR, it
3514 will inherit the type of the array, which will be some pointer type.
3515
3516 LOC is the location to use in building the array reference. */
3517
3518tree
3519cp_build_array_ref (location_t loc, tree array, tree idx,
3520 tsubst_flags_t complain)
3521{
3522 tree ret;
3523
3524 if (idx == 0)
3525 {
3526 if (complain & tf_error)
3527 error_at (loc, "subscript missing in array reference");
3528 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3529 }
3530
3531 if (TREE_TYPE (array)((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3531, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK]
3532 || TREE_TYPE (idx)((contains_struct_check ((idx), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3532, __FUNCTION__))->typed.type)
== error_mark_nodeglobal_trees[TI_ERROR_MARK])
3533 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3534
3535 /* If ARRAY is a COMPOUND_EXPR or COND_EXPR, move our reference
3536 inside it. */
3537 switch (TREE_CODE (array)((enum tree_code) (array)->base.code))
3538 {
3539 case COMPOUND_EXPR:
3540 {
3541 tree value = cp_build_array_ref (loc, TREE_OPERAND (array, 1)(*((const_cast<tree*> (tree_operand_check ((array), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3541, __FUNCTION__)))))
, idx,
3542 complain);
3543 ret = build2 (COMPOUND_EXPR, TREE_TYPE (value)((contains_struct_check ((value), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3543, __FUNCTION__))->typed.type)
,
3544 TREE_OPERAND (array, 0)(*((const_cast<tree*> (tree_operand_check ((array), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3544, __FUNCTION__)))))
, value);
3545 SET_EXPR_LOCATION (ret, loc)(expr_check (((ret)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3545, __FUNCTION__))->exp.locus = (loc)
;
3546 return ret;
3547 }
3548
3549 case COND_EXPR:
3550 ret = build_conditional_expr
3551 (loc, TREE_OPERAND (array, 0)(*((const_cast<tree*> (tree_operand_check ((array), (0)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3551, __FUNCTION__)))))
,
3552 cp_build_array_ref (loc, TREE_OPERAND (array, 1)(*((const_cast<tree*> (tree_operand_check ((array), (1)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3552, __FUNCTION__)))))
, idx,
3553 complain),
3554 cp_build_array_ref (loc, TREE_OPERAND (array, 2)(*((const_cast<tree*> (tree_operand_check ((array), (2)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3554, __FUNCTION__)))))
, idx,
3555 complain),
3556 complain);
3557 protected_set_expr_location (ret, loc);
3558 return ret;
3559
3560 default:
3561 break;
3562 }
3563
3564 bool non_lvalue = convert_vector_to_array_for_subscript (loc, &array, idx);
3565
3566 if (TREE_CODE (TREE_TYPE (array))((enum tree_code) (((contains_struct_check ((array), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3566, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE)
3567 {
3568 tree rval, type;
3569
3570 warn_array_subscript_with_type_char (loc, idx);
3571
3572 if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (idx))((((enum tree_code) (((contains_struct_check ((idx), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3572, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE
&& !((tree_check ((((contains_struct_check ((idx), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3572, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3572, __FUNCTION__, (ENUMERAL_TYPE)))->base.static_flag)
) || (((enum tree_code) (((contains_struct_check ((idx), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3572, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE
|| ((enum tree_code) (((contains_struct_check ((idx), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3572, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE
))
)
3573 {
3574 if (complain & tf_error)
3575 error_at (loc, "array subscript is not an integer");
3576 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3577 }
3578
3579 /* Apply integral promotions *after* noticing character types.
3580 (It is unclear why we do these promotions -- the standard
3581 does not say that we should. In fact, the natural thing would
3582 seem to be to convert IDX to ptrdiff_t; we're performing
3583 pointer arithmetic.) */
3584 idx = cp_perform_integral_promotions (idx, complain);
3585
3586 idx = maybe_fold_non_dependent_expr (idx, complain);
3587
3588 /* An array that is indexed by a non-constant
3589 cannot be stored in a register; we must be able to do
3590 address arithmetic on its address.
3591 Likewise an array of elements of variable size. */
3592 if (TREE_CODE (idx)((enum tree_code) (idx)->base.code) != INTEGER_CST
3593 || (COMPLETE_TYPE_P (TREE_TYPE (TREE_TYPE (array)))(((tree_class_check ((((contains_struct_check ((((contains_struct_check
((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3593, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3593, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3593, __FUNCTION__))->type_common.size) != (tree) __null
)
3594 && (TREE_CODE (TYPE_SIZE (TREE_TYPE (TREE_TYPE (array))))((enum tree_code) (((tree_class_check ((((contains_struct_check
((((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3594, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3594, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3594, __FUNCTION__))->type_common.size))->base.code)
3595 != INTEGER_CST)))
3596 {
3597 if (!cxx_mark_addressable (array, true))
3598 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3599 }
3600
3601 /* An array that is indexed by a constant value which is not within
3602 the array bounds cannot be stored in a register either; because we
3603 would get a crash in store_bit_field/extract_bit_field when trying
3604 to access a non-existent part of the register. */
3605 if (TREE_CODE (idx)((enum tree_code) (idx)->base.code) == INTEGER_CST
3606 && TYPE_DOMAIN (TREE_TYPE (array))((tree_check ((((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3606, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3606, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
3607 && ! int_fits_type_p (idx, TYPE_DOMAIN (TREE_TYPE (array))((tree_check ((((contains_struct_check ((array), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3607, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3607, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values
)
))
3608 {
3609 if (!cxx_mark_addressable (array))
3610 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3611 }
3612
3613 /* Note in C++ it is valid to subscript a `register' array, since
3614 it is valid to take the address of something with that
3615 storage specification. */
3616 if (extra_warningsglobal_options.x_extra_warnings)
3617 {
3618 tree foo = array;
3619 while (TREE_CODE (foo)((enum tree_code) (foo)->base.code) == COMPONENT_REF)
3620 foo = TREE_OPERAND (foo, 0)(*((const_cast<tree*> (tree_operand_check ((foo), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3620, __FUNCTION__)))))
;
3621 if (VAR_P (foo)(((enum tree_code) (foo)->base.code) == VAR_DECL) && DECL_REGISTER (foo)((contains_struct_check ((foo), (TS_DECL_WRTL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3621, __FUNCTION__))->decl_common.decl_flag_0)
3622 && (complain & tf_warning))
3623 warning_at (loc, OPT_Wextra,
3624 "subscripting array declared %<register%>");
3625 }
3626
3627 type = TREE_TYPE (TREE_TYPE (array))((contains_struct_check ((((contains_struct_check ((array), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3627, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3627, __FUNCTION__))->typed.type)
;
3628 rval = build4 (ARRAY_REF, type, array, idx, NULL_TREE(tree) __null, NULL_TREE(tree) __null);
3629 /* Array ref is const/volatile if the array elements are
3630 or if the array is.. */
3631 TREE_READONLY (rval)((non_type_check ((rval), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3631, __FUNCTION__))->base.readonly_flag)
3632 |= (CP_TYPE_CONST_P (type)((cp_type_quals (type) & TYPE_QUAL_CONST) != 0) | TREE_READONLY (array)((non_type_check ((array), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3632, __FUNCTION__))->base.readonly_flag)
);
3633 TREE_SIDE_EFFECTS (rval)((non_type_check ((rval), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3633, __FUNCTION__))->base.side_effects_flag)
3634 |= (CP_TYPE_VOLATILE_P (type)((cp_type_quals (type) & TYPE_QUAL_VOLATILE) != 0) | TREE_SIDE_EFFECTS (array)((non_type_check ((array), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3634, __FUNCTION__))->base.side_effects_flag)
);
3635 TREE_THIS_VOLATILE (rval)((rval)->base.volatile_flag)
3636 |= (CP_TYPE_VOLATILE_P (type)((cp_type_quals (type) & TYPE_QUAL_VOLATILE) != 0) | TREE_THIS_VOLATILE (array)((array)->base.volatile_flag));
3637 ret = require_complete_type_sfinae (rval, complain);
3638 protected_set_expr_location (ret, loc);
3639 if (non_lvalue)
3640 ret = non_lvalue_loc (loc, ret);
3641 return ret;
3642 }
3643
3644 {
3645 tree ar = cp_default_conversion (array, complain);
3646 tree ind = cp_default_conversion (idx, complain);
3647 tree first = NULL_TREE(tree) __null;
3648
3649 if (flag_strong_eval_orderglobal_options.x_flag_strong_eval_order == 2 && TREE_SIDE_EFFECTS (ind)((non_type_check ((ind), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3649, __FUNCTION__))->base.side_effects_flag)
)
3650 ar = first = save_expr (ar);
3651
3652 /* Put the integer in IND to simplify error checking. */
3653 if (TREE_CODE (TREE_TYPE (ar))((enum tree_code) (((contains_struct_check ((ar), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3653, __FUNCTION__))->typed.type))->base.code)
== INTEGER_TYPE)
3654 std::swap (ar, ind);
3655
3656 if (ar == error_mark_nodeglobal_trees[TI_ERROR_MARK] || ind == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3657 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3658
3659 if (!TYPE_PTR_P (TREE_TYPE (ar))(((enum tree_code) (((contains_struct_check ((ar), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3659, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE
)
)
3660 {
3661 if (complain & tf_error)
3662 error_at (loc, "subscripted value is neither array nor pointer");
3663 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3664 }
3665 if (TREE_CODE (TREE_TYPE (ind))((enum tree_code) (((contains_struct_check ((ind), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3665, __FUNCTION__))->typed.type))->base.code)
!= INTEGER_TYPE)
3666 {
3667 if (complain & tf_error)
3668 error_at (loc, "array subscript is not an integer");
3669 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3670 }
3671
3672 warn_array_subscript_with_type_char (loc, idx);
3673
3674 ret = cp_build_binary_op (input_location, PLUS_EXPR, ar, ind, complain);
3675 if (first)
3676 ret = build2_loc (loc, COMPOUND_EXPR, TREE_TYPE (ret)((contains_struct_check ((ret), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3676, __FUNCTION__))->typed.type)
, first, ret);
3677 ret = cp_build_indirect_ref (loc, ret, RO_ARRAY_INDEXING, complain);
3678 protected_set_expr_location (ret, loc);
3679 if (non_lvalue)
3680 ret = non_lvalue_loc (loc, ret);
3681 return ret;
3682 }
3683}
3684
3685/* Entry point for Obj-C++. */
3686
3687tree
3688build_array_ref (location_t loc, tree array, tree idx)
3689{
3690 return cp_build_array_ref (loc, array, idx, tf_warning_or_error);
3691}
3692
3693/* Resolve a pointer to member function. INSTANCE is the object
3694 instance to use, if the member points to a virtual member.
3695
3696 This used to avoid checking for virtual functions if basetype
3697 has no virtual functions, according to an earlier ANSI draft.
3698 With the final ISO C++ rules, such an optimization is
3699 incorrect: A pointer to a derived member can be static_cast
3700 to pointer-to-base-member, as long as the dynamic object
3701 later has the right member. So now we only do this optimization
3702 when we know the dynamic type of the object. */
3703
3704tree
3705get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function,
3706 tsubst_flags_t complain)
3707{
3708 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == OFFSET_REF)
3709 function = TREE_OPERAND (function, 1)(*((const_cast<tree*> (tree_operand_check ((function), (
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3709, __FUNCTION__)))))
;
3710
3711 if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function))(((enum tree_code) (((contains_struct_check ((function), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3711, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE
&& (((tree_class_check (((tree_check ((((contains_struct_check
((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3711, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3711, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3711, __FUNCTION__))->type_common.lang_flag_2)))
)
3712 {
3713 tree idx, delta, e1, e2, e3, vtbl;
3714 bool nonvirtual;
3715 tree fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function))(cp_build_qualified_type_real ((((contains_struct_check ((((tree_check3
((((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3715, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3715, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3715, __FUNCTION__))->typed.type)), (cp_type_quals (((contains_struct_check
((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3715, __FUNCTION__))->typed.type))), tf_warning_or_error
))
;
3716 tree basetype = TYPE_METHOD_BASETYPE (TREE_TYPE (fntype))((tree_check2 ((((contains_struct_check ((fntype), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3716, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3716, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval)
;
3717
3718 tree instance_ptr = *instance_ptrptr;
3719 tree instance_save_expr = 0;
3720 if (instance_ptr == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3721 {
3722 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == PTRMEM_CST)
3723 {
3724 /* Extracting the function address from a pmf is only
3725 allowed with -Wno-pmf-conversions. It only works for
3726 pmf constants. */
3727 e1 = build_addr_func (PTRMEM_CST_MEMBER (function)(((ptrmem_cst_t)(tree_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3727, __FUNCTION__, (PTRMEM_CST))))->member)
, complain);
3728 e1 = convert (fntype, e1);
3729 return e1;
3730 }
3731 else
3732 {
3733 if (complain & tf_error)
3734 error ("object missing in use of %qE", function);
3735 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3736 }
3737 }
3738
3739 /* True if we know that the dynamic type of the object doesn't have
3740 virtual functions, so we can assume the PFN field is a pointer. */
3741 nonvirtual = (COMPLETE_TYPE_P (basetype)(((tree_class_check ((basetype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3741, __FUNCTION__))->type_common.size) != (tree) __null
)
3742 && !TYPE_POLYMORPHIC_P (basetype)(((tree_not_check2 ((basetype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3742, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2))
3743 && resolves_to_fixed_type_p (instance_ptr, 0));
3744
3745 /* If we don't really have an object (i.e. in an ill-formed
3746 conversion from PMF to pointer), we can't resolve virtual
3747 functions anyway. */
3748 if (!nonvirtual && is_dummy_object (instance_ptr))
3749 nonvirtual = true;
3750
3751 if (TREE_SIDE_EFFECTS (instance_ptr)((non_type_check ((instance_ptr), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3751, __FUNCTION__))->base.side_effects_flag)
)
3752 instance_ptr = instance_save_expr = save_expr (instance_ptr);
3753
3754 if (TREE_SIDE_EFFECTS (function)((non_type_check ((function), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3754, __FUNCTION__))->base.side_effects_flag)
)
3755 function = save_expr (function);
3756
3757 /* Start by extracting all the information from the PMF itself. */
3758 e3 = pfn_from_ptrmemfunc (function);
3759 delta = delta_from_ptrmemfunc (function);
3760 idx = build1 (NOP_EXPR, vtable_index_typecp_global_trees[CPTI_VTABLE_INDEX_TYPE], e3);
3761 switch (TARGET_PTRMEMFUNC_VBIT_LOCATIONptrmemfunc_vbit_in_pfn)
3762 {
3763 int flag_sanitize_save;
3764 case ptrmemfunc_vbit_in_pfn:
3765 e1 = cp_build_binary_op (input_location,
3766 BIT_AND_EXPR, idx, integer_one_nodeglobal_trees[TI_INTEGER_ONE],
3767 complain);
3768 idx = cp_build_binary_op (input_location,
3769 MINUS_EXPR, idx, integer_one_nodeglobal_trees[TI_INTEGER_ONE],
3770 complain);
3771 if (idx == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3772 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3773 break;
3774
3775 case ptrmemfunc_vbit_in_delta:
3776 e1 = cp_build_binary_op (input_location,
3777 BIT_AND_EXPR, delta, integer_one_nodeglobal_trees[TI_INTEGER_ONE],
3778 complain);
3779 /* Don't instrument the RSHIFT_EXPR we're about to create because
3780 we're going to use DELTA number of times, and that wouldn't play
3781 well with SAVE_EXPRs therein. */
3782 flag_sanitize_save = flag_sanitizeglobal_options.x_flag_sanitize;
3783 flag_sanitizeglobal_options.x_flag_sanitize = 0;
3784 delta = cp_build_binary_op (input_location,
3785 RSHIFT_EXPR, delta, integer_one_nodeglobal_trees[TI_INTEGER_ONE],
3786 complain);
3787 flag_sanitizeglobal_options.x_flag_sanitize = flag_sanitize_save;
3788 if (delta == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3789 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3790 break;
3791
3792 default:
3793 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3793, __FUNCTION__))
;
3794 }
3795
3796 if (e1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3797 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3798
3799 /* Convert down to the right base before using the instance. A
3800 special case is that in a pointer to member of class C, C may
3801 be incomplete. In that case, the function will of course be
3802 a member of C, and no conversion is required. In fact,
3803 lookup_base will fail in that case, because incomplete
3804 classes do not have BINFOs. */
3805 if (!same_type_ignoring_top_level_qualifiers_p
3806 (basetype, TREE_TYPE (TREE_TYPE (instance_ptr))((contains_struct_check ((((contains_struct_check ((instance_ptr
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3806, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3806, __FUNCTION__))->typed.type)
))
3807 {
3808 basetype = lookup_base (TREE_TYPE (TREE_TYPE (instance_ptr))((contains_struct_check ((((contains_struct_check ((instance_ptr
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3808, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3808, __FUNCTION__))->typed.type)
,
3809 basetype, ba_check, NULL__null, complain);
3810 instance_ptr = build_base_path (PLUS_EXPR, instance_ptr, basetype,
3811 1, complain);
3812 if (instance_ptr == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3813 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3814 }
3815 /* ...and then the delta in the PMF. */
3816 instance_ptr = fold_build_pointer_plus (instance_ptr, delta)fold_build_pointer_plus_loc (((location_t) 0), instance_ptr, delta
)
;
3817
3818 /* Hand back the adjusted 'this' argument to our caller. */
3819 *instance_ptrptr = instance_ptr;
3820
3821 if (nonvirtual)
3822 /* Now just return the pointer. */
3823 return e3;
3824
3825 /* Next extract the vtable pointer from the object. */
3826 vtbl = build1 (NOP_EXPR, build_pointer_type (vtbl_ptr_type_nodecp_global_trees[CPTI_VTBL_PTR_TYPE]),
3827 instance_ptr);
3828 vtbl = cp_build_fold_indirect_ref (vtbl);
3829 if (vtbl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3830 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3831
3832 /* Finally, extract the function pointer from the vtable. */
3833 e2 = fold_build_pointer_plus_loc (input_location, vtbl, idx);
3834 e2 = cp_build_fold_indirect_ref (e2);
3835 if (e2 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3836 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3837 TREE_CONSTANT (e2)((non_type_check ((e2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3837, __FUNCTION__))->base.constant_flag)
= 1;
3838
3839 /* When using function descriptors, the address of the
3840 vtable entry is treated as a function pointer. */
3841 if (TARGET_VTABLE_USES_DESCRIPTORS0)
3842 e2 = build1 (NOP_EXPR, TREE_TYPE (e2)((contains_struct_check ((e2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3842, __FUNCTION__))->typed.type)
,
3843 cp_build_addr_expr (e2, complain));
3844
3845 e2 = fold_convert (TREE_TYPE (e3), e2)fold_convert_loc (((location_t) 0), ((contains_struct_check (
(e3), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3845, __FUNCTION__))->typed.type), e2)
;
3846 e1 = build_conditional_expr (input_location, e1, e2, e3, complain);
3847 if (e1 == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3848 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3849
3850 /* Make sure this doesn't get evaluated first inside one of the
3851 branches of the COND_EXPR. */
3852 if (instance_save_expr)
3853 e1 = build2 (COMPOUND_EXPR, TREE_TYPE (e1)((contains_struct_check ((e1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3853, __FUNCTION__))->typed.type)
,
3854 instance_save_expr, e1);
3855
3856 function = e1;
3857 }
3858 return function;
3859}
3860
3861/* Used by the C-common bits. */
3862tree
3863build_function_call (location_t /*loc*/,
3864 tree function, tree params)
3865{
3866 return cp_build_function_call (function, params, tf_warning_or_error);
3867}
3868
3869/* Used by the C-common bits. */
3870tree
3871build_function_call_vec (location_t /*loc*/, vec<location_t> /*arg_loc*/,
3872 tree function, vec<tree, va_gc> *params,
3873 vec<tree, va_gc> * /*origtypes*/, tree orig_function)
3874{
3875 vec<tree, va_gc> *orig_params = params;
3876 tree ret = cp_build_function_call_vec (function, &params,
3877 tf_warning_or_error, orig_function);
3878
3879 /* cp_build_function_call_vec can reallocate PARAMS by adding
3880 default arguments. That should never happen here. Verify
3881 that. */
3882 gcc_assert (params == orig_params)((void)(!(params == orig_params) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3882, __FUNCTION__), 0 : 0))
;
3883
3884 return ret;
3885}
3886
3887/* Build a function call using a tree list of arguments. */
3888
3889static tree
3890cp_build_function_call (tree function, tree params, tsubst_flags_t complain)
3891{
3892 tree ret;
3893
3894 releasing_vec vec;
3895 for (; params != NULL_TREE(tree) __null; params = TREE_CHAIN (params)((contains_struct_check ((params), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3895, __FUNCTION__))->common.chain)
)
3896 vec_safe_push (vec, TREE_VALUE (params)((tree_check ((params), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3896, __FUNCTION__, (TREE_LIST)))->list.value)
);
3897 ret = cp_build_function_call_vec (function, &vec, complain);
3898 return ret;
3899}
3900
3901/* Build a function call using varargs. */
3902
3903tree
3904cp_build_function_call_nary (tree function, tsubst_flags_t complain, ...)
3905{
3906 va_list args;
3907 tree ret, t;
3908
3909 releasing_vec vec;
1
Calling default constructor for 'releasing_vec'
3
Returning from default constructor for 'releasing_vec'
3910 va_start (args, complain)__builtin_va_start(args, complain);
3911 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))
4
Assuming 't' is equal to NULL_TREE
5
Loop condition is false. Execution continues on line 3913
3912 vec_safe_push (vec, t);
3913 va_end (args)__builtin_va_end(args);
3914 ret = cp_build_function_call_vec (function, &vec, complain);
6
Calling 'cp_build_function_call_vec'
3915 return ret;
3916}
3917
3918/* Build a function call using a vector of arguments.
3919 If FUNCTION is the result of resolving an overloaded target built-in,
3920 ORIG_FNDECL is the original function decl, otherwise it is null.
3921 PARAMS may be NULL if there are no parameters. This changes the
3922 contents of PARAMS. */
3923
3924tree
3925cp_build_function_call_vec (tree function, vec<tree, va_gc> **params,
3926 tsubst_flags_t complain, tree orig_fndecl)
3927{
3928 tree fntype, fndecl;
3929 int is_method;
3930 tree original = function;
3931 int nargs;
3932 tree *argarray;
3933 tree parm_types;
3934 vec<tree, va_gc> *allocated = NULL__null;
3935 tree ret;
3936
3937 /* For Objective-C, convert any calls via a cast to OBJC_TYPE_REF
3938 expressions, like those used for ObjC messenger dispatches. */
3939 if (params
6.1
'params' is not equal to NULL
6.1
'params' is not equal to NULL
6.1
'params' is not equal to NULL
!= NULL__null && !vec_safe_is_empty (*params))
7
Calling 'vec_safe_is_empty<tree_node *, va_gc>'
10
Returning from 'vec_safe_is_empty<tree_node *, va_gc>'
11
Taking false branch
3940 function = objc_rewrite_function_call (function, (**params)[0]);
3941
3942 /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
3943 Strip such NOP_EXPRs, since FUNCTION is used in non-lvalue context. */
3944 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == NOP_EXPR
12
Assuming field 'code' is not equal to NOP_EXPR
3945 && TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3945, __FUNCTION__))->typed.type)
== TREE_TYPE (TREE_OPERAND (function, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((function), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3945, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3945, __FUNCTION__))->typed.type)
)
3946 function = TREE_OPERAND (function, 0)(*((const_cast<tree*> (tree_operand_check ((function), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3946, __FUNCTION__)))))
;
3947
3948 if (TREE_CODE (function)((enum tree_code) (function)->base.code) == FUNCTION_DECL)
13
Assuming field 'code' is not equal to FUNCTION_DECL
14
Taking false branch
3949 {
3950 if (!mark_used (function, complain))
3951 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3952 fndecl = function;
3953
3954 /* Convert anything with function type to a pointer-to-function. */
3955 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((function
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__); &lt->u.fn; })->thunk_p)) &&
((((contains_struct_check ((function), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__))->decl_common.lang_specific) ? ((contains_struct_check
((function), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__))->decl_minimal.name) != (tree) __null
&& ((tree_check ((((contains_struct_check ((function
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3955, __FUNCTION__, (IDENTIFIER_NODE))) == global_trees[TI_MAIN_IDENTIFIER
]) && flag_hosted)
)
3956 {
3957 if (complain & tf_error)
3958 pedwarn (input_location, OPT_Wpedantic,
3959 "ISO C++ forbids calling %<::main%> from within program");
3960 else
3961 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3962 }
3963 function = build_addr_func (function, complain);
3964 }
3965 else
3966 {
3967 fndecl = NULL_TREE(tree) __null;
3968
3969 function = build_addr_func (function, complain);
3970 }
3971
3972 if (function == error_mark_nodeglobal_trees[TI_ERROR_MARK])
15
Assuming the condition is false
16
Taking false branch
3973 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3974
3975 fntype = TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3975, __FUNCTION__))->typed.type)
;
3976
3977 if (TYPE_PTRMEMFUNC_P (fntype)(((enum tree_code) (fntype)->base.code) == RECORD_TYPE &&
(((tree_class_check (((tree_check ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3977, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3977, __FUNCTION__))->type_common.lang_flag_2)))
)
17
Assuming field 'code' is not equal to RECORD_TYPE
3978 {
3979 if (complain & tf_error)
3980 error ("must use %<.*%> or %<->*%> to call pointer-to-member "
3981 "function in %<%E (...)%>, e.g. %<(... ->* %E) (...)%>",
3982 original, original);
3983 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3984 }
3985
3986 is_method = (TYPE_PTR_P (fntype)(((enum tree_code) (fntype)->base.code) == POINTER_TYPE)
18
Assuming field 'code' is not equal to POINTER_TYPE
3987 && TREE_CODE (TREE_TYPE (fntype))((enum tree_code) (((contains_struct_check ((fntype), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3987, __FUNCTION__))->typed.type))->base.code)
== METHOD_TYPE);
3988
3989 if (!(TYPE_PTRFN_P (fntype)((((enum tree_code) (fntype)->base.code) == POINTER_TYPE) &&
((enum tree_code) (((contains_struct_check ((fntype), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 3989, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
)
20
Taking false branch
3990 || is_method
18.2
'is_method' is 0
18.2
'is_method' is 0
18.2
'is_method' is 0
3991 || TREE_CODE (function)((enum tree_code) (function)->base.code) == TEMPLATE_ID_EXPR))
19
Assuming field 'code' is equal to TEMPLATE_ID_EXPR
3992 { 3993 if (complain & tf_error) 3994 { 3995 if (!flag_diagnostics_show_caretglobal_options.x_flag_diagnostics_show_caret) 3996 error_at (input_location, 3997 "%qE cannot be used as a function", original); 3998 else if (DECL_P (original)(tree_code_type[(int) (((enum tree_code) (original)->base.
code))] == tcc_declaration)
) 3999 error_at (input_location, 4000 "%qD cannot be used as a function", original); 4001 else 4002 error_at (input_location, 4003 "expression cannot be used as a function"); 4004 } 4005 4006 return error_mark_nodeglobal_trees[TI_ERROR_MARK]; 4007 } 4008 4009 /* fntype now gets the type of function pointed to. */ 4010 fntype = TREE_TYPE (fntype)((contains_struct_check ((fntype), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4010, __FUNCTION__))->typed.type)
; 4011 parm_types = TYPE_ARG_TYPES (fntype)((tree_check2 ((fntype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4011, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
; 4012 4013 if (params
20.1
'params' is not equal to NULL
20.1
'params' is not equal to NULL
20.1
'params' is not equal to NULL
== NULL__null)
21
Taking false branch
4014 { 4015 allocated = make_tree_vector (); 4016 params = &allocated; 4017 } 4018 4019 nargs = convert_arguments (parm_types, params, fndecl, LOOKUP_NORMAL((1 << 0)), 4020 complain); 4021 if (nargs
21.1
'nargs' is >= 0
21.1
'nargs' is >= 0
21.1
'nargs' is >= 0
< 0)
22
Taking false branch
4022 return error_mark_nodeglobal_trees[TI_ERROR_MARK]; 4023 4024 argarray = (*params)->address ();
23
Called C++ object pointer is null
4025 4026 /* Check for errors in format strings and inappropriately 4027 null parameters. */ 4028 bool warned_p = check_function_arguments (input_location, fndecl, fntype, 4029 nargs, argarray, NULL__null); 4030 4031 ret = build_cxx_call (function, nargs, argarray, complain, orig_fndecl); 4032 4033 if (warned_p) 4034 { 4035 tree c = extract_call_expr (ret); 4036 if (TREE_CODE (c)((enum tree_code) (c)->base.code) == CALL_EXPR) 4037 TREE_NO_WARNING (c)((c)->base.nowarning_flag) = 1; 4038 } 4039 4040 if (allocated != NULL__null) 4041 release_tree_vector (allocated); 4042 4043 return ret; 4044} 4045
4046/* Subroutine of convert_arguments. 4047 Print an error message about a wrong number of arguments. */ 4048 4049static void 4050error_args_num (location_t loc, tree fndecl, bool too_many_p) 4051{ 4052 if (fndecl) 4053 { 4054 if (TREE_CODE (TREE_TYPE (fndecl))((enum tree_code) (((contains_struct_check ((fndecl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4054, __FUNCTION__))->typed.type))->base.code)
== METHOD_TYPE) 4055 { 4056 if (DECL_NAME (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4056, __FUNCTION__))->decl_minimal.name)
== NULL_TREE(tree) __null 4057 || IDENTIFIER_HAS_TYPE_VALUE (DECL_NAME (fndecl))(identifier_type_value (((contains_struct_check ((fndecl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4057, __FUNCTION__))->decl_minimal.name)) ? 1 : 0)
) 4058 error_at (loc, 4059 too_many_p 4060 ? G_("too many arguments to constructor %q#D")"too many arguments to constructor %q#D" 4061 : G_("too few arguments to constructor %q#D")"too few arguments to constructor %q#D", 4062 fndecl); 4063 else 4064 error_at (loc, 4065 too_many_p 4066 ? G_("too many arguments to member function %q#D")"too many arguments to member function %q#D" 4067 : G_("too few arguments to member function %q#D")"too few arguments to member function %q#D", 4068 fndecl); 4069 } 4070 else 4071 error_at (loc, 4072 too_many_p 4073 ? G_("too many arguments to function %q#D")"too many arguments to function %q#D" 4074 : G_("too few arguments to function %q#D")"too few arguments to function %q#D", 4075 fndecl); 4076 if (!DECL_IS_UNDECLARED_BUILTIN (fndecl)(((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4076, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
) 4077 inform (DECL_SOURCE_LOCATION (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4077, __FUNCTION__))->decl_minimal.locus)
, "declared here"); 4078 } 4079 else 4080 { 4081 if (c_dialect_objc ()((c_language & clk_objc) != 0) && objc_message_selector ()) 4082 error_at (loc, 4083 too_many_p 4084 ? G_("too many arguments to method %q#D")"too many arguments to method %q#D" 4085 : G_("too few arguments to method %q#D")"too few arguments to method %q#D", 4086 objc_message_selector ()); 4087 else 4088 error_at (loc, too_many_p ? G_("too many arguments to function")"too many arguments to function" 4089 : G_("too few arguments to function")"too few arguments to function"); 4090 } 4091} 4092 4093/* Convert the actual parameter expressions in the list VALUES to the 4094 types in the list TYPELIST. The converted expressions are stored 4095 back in the VALUES vector. 4096 If parmdecls is exhausted, or when an element has NULL as its type, 4097 perform the default conversions. 4098 4099 NAME is an IDENTIFIER_NODE or 0. It is used only for error messages. 4100 4101 This is also where warnings about wrong number of args are generated. 4102 4103 Returns the actual number of arguments processed (which might be less 4104 than the length of the vector), or -1 on error. 4105 4106 In C++, unspecified trailing parameters can be filled in with their 4107 default arguments, if such were specified. Do so here. */ 4108 4109static int 4110convert_arguments (tree typelist, vec<tree, va_gc> **values, tree fndecl, 4111 int flags, tsubst_flags_t complain) 4112{ 4113 tree typetail; 4114 unsigned int i; 4115 4116 /* Argument passing is always copy-initialization. */ 4117 flags |= LOOKUP_ONLYCONVERTING(1 << 2); 4118 4119 for (i = 0, typetail = typelist; 4120 i < vec_safe_length (*values); 4121 i++) 4122 { 4123 tree type = typetail ? TREE_VALUE (typetail)((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4123, __FUNCTION__, (TREE_LIST)))->list.value)
: 0; 4124 tree val = (**values)[i]; 4125 4126 if (val == error_mark_nodeglobal_trees[TI_ERROR_MARK] || type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4127 return -1; 4128 4129 if (type == void_type_nodeglobal_trees[TI_VOID_TYPE]) 4130 { 4131 if (complain & tf_error) 4132 { 4133 error_args_num (input_location, fndecl, /*too_many_p=*/true); 4134 return i; 4135 } 4136 else 4137 return -1; 4138 } 4139 4140 /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue. 4141 Strip such NOP_EXPRs, since VAL is used in non-lvalue context. */ 4142 if (TREE_CODE (val)((enum tree_code) (val)->base.code) == NOP_EXPR 4143 && TREE_TYPE (val)((contains_struct_check ((val), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4143, __FUNCTION__))->typed.type)
== TREE_TYPE (TREE_OPERAND (val, 0))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
((val), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4143, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4143, __FUNCTION__))->typed.type)
4144 && (type == 0 || !TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE))) 4145 val = TREE_OPERAND (val, 0)(*((const_cast<tree*> (tree_operand_check ((val), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4145, __FUNCTION__)))))
; 4146 4147 if (type == 0 || !TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE)) 4148 { 4149 if (TREE_CODE (TREE_TYPE (val))((enum tree_code) (((contains_struct_check ((val), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4149, __FUNCTION__))->typed.type))->base.code)
== ARRAY_TYPE 4150 || FUNC_OR_METHOD_TYPE_P (TREE_TYPE (val))(((enum tree_code) (((contains_struct_check ((val), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4150, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
|| ((enum tree_code) (((contains_struct_check ((val), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4150, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
) 4151 val = decay_conversion (val, complain); 4152 } 4153 4154 if (val == error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4155 return -1; 4156 4157 if (type != 0) 4158 { 4159 /* Formal parm type is specified by a function prototype. */ 4160 tree parmval; 4161 4162 if (!COMPLETE_TYPE_P (complete_type (type))(((tree_class_check ((complete_type (type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4162, __FUNCTION__))->type_common.size) != (tree) __null
)
) 4163 { 4164 if (complain & tf_error) 4165 { 4166 location_t loc = EXPR_LOC_OR_LOC (val, input_location)((((IS_ADHOC_LOC (((((val)) && ((tree_code_type[(int)
(((enum tree_code) ((val))->base.code))]) >= tcc_reference
&& (tree_code_type[(int) (((enum tree_code) ((val))->
base.code))]) <= tcc_expression)) ? (val)->exp.locus : (
(location_t) 0)))) ? get_location_from_adhoc_loc (line_table,
((((val)) && ((tree_code_type[(int) (((enum tree_code
) ((val))->base.code))]) >= tcc_reference && (tree_code_type
[(int) (((enum tree_code) ((val))->base.code))]) <= tcc_expression
)) ? (val)->exp.locus : ((location_t) 0))) : (((((val)) &&
((tree_code_type[(int) (((enum tree_code) ((val))->base.code
))]) >= tcc_reference && (tree_code_type[(int) (((
enum tree_code) ((val))->base.code))]) <= tcc_expression
)) ? (val)->exp.locus : ((location_t) 0)))) != ((location_t
) 0)) ? (val)->exp.locus : (input_location))
; 4167 if (fndecl) 4168 { 4169 auto_diagnostic_group d; 4170 error_at (loc, 4171 "parameter %P of %qD has incomplete type %qT", 4172 i, fndecl, type); 4173 inform (get_fndecl_argument_location (fndecl, i), 4174 " declared here"); 4175 } 4176 else 4177 error_at (loc, "parameter %P has incomplete type %qT", i, 4178 type); 4179 } 4180 parmval = error_mark_nodeglobal_trees[TI_ERROR_MARK]; 4181 } 4182 else 4183 { 4184 parmval = convert_for_initialization 4185 (NULL_TREE(tree) __null, type, val, flags, 4186 ICR_ARGPASS, fndecl, i, complain); 4187 parmval = convert_for_arg_passing (type, parmval, complain); 4188 } 4189 4190 if (parmval == error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4191 return -1; 4192 4193 (**values)[i] = parmval; 4194 } 4195 else 4196 { 4197 if (fndecl && magic_varargs_p (fndecl)) 4198 /* Don't do ellipsis conversion for __built_in_constant_p 4199 as this will result in spurious errors for non-trivial 4200 types. */ 4201 val = require_complete_type_sfinae (val, complain); 4202 else 4203 val = convert_arg_to_ellipsis (val, complain); 4204 4205 (**values)[i] = val; 4206 } 4207 4208 if (typetail) 4209 typetail = TREE_CHAIN (typetail)((contains_struct_check ((typetail), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4209, __FUNCTION__))->common.chain)
; 4210 } 4211 4212 if (typetail != 0 && typetail != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) 4213 { 4214 /* See if there are default arguments that can be used. Because 4215 we hold default arguments in the FUNCTION_TYPE (which is so 4216 wrong), we can see default parameters here from deduced 4217 contexts (and via typeof) for indirect function calls. 4218 Fortunately we know whether we have a function decl to 4219 provide default arguments in a language conformant 4220 manner. */ 4221 if (fndecl && TREE_PURPOSE (typetail)((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4221, __FUNCTION__, (TREE_LIST)))->list.purpose)
4222 && TREE_CODE (TREE_PURPOSE (typetail))((enum tree_code) (((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4222, __FUNCTION__, (TREE_LIST)))->list.purpose))->base
.code)
!= DEFERRED_PARSE) 4223 { 4224 for (; typetail != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; ++i) 4225 { 4226 /* After DR777, with explicit template args we can end up with a 4227 default argument followed by no default argument. */ 4228 if (!TREE_PURPOSE (typetail)((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4228, __FUNCTION__, (TREE_LIST)))->list.purpose)
) 4229 break; 4230 tree parmval 4231 = convert_default_arg (TREE_VALUE (typetail)((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4231, __FUNCTION__, (TREE_LIST)))->list.value)
, 4232 TREE_PURPOSE (typetail)((tree_check ((typetail), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4232, __FUNCTION__, (TREE_LIST)))->list.purpose)
, 4233 fndecl, i, complain); 4234 4235 if (parmval == error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4236 return -1; 4237 4238 vec_safe_push (*values, parmval); 4239 typetail = TREE_CHAIN (typetail)((contains_struct_check ((typetail), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4239, __FUNCTION__))->common.chain)
; 4240 /* ends with `...'. */ 4241 if (typetail == NULL_TREE(tree) __null) 4242 break; 4243 } 4244 } 4245 4246 if (typetail && typetail != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) 4247 { 4248 if (complain & tf_error) 4249 error_args_num (input_location, fndecl, /*too_many_p=*/false); 4250 return -1; 4251 } 4252 } 4253 4254 return (int) i; 4255} 4256
4257/* Build a binary-operation expression, after performing default 4258 conversions on the operands. CODE is the kind of expression to 4259 build. ARG1 and ARG2 are the arguments. ARG1_CODE and ARG2_CODE 4260 are the tree codes which correspond to ARG1 and ARG2 when issuing 4261 warnings about possibly misplaced parentheses. They may differ 4262 from the TREE_CODE of ARG1 and ARG2 if the parser has done constant 4263 folding (e.g., if the parser sees "a | 1 + 1", it may call this 4264 routine with ARG2 being an INTEGER_CST and ARG2_CODE == PLUS_EXPR). 4265 To avoid issuing any parentheses warnings, pass ARG1_CODE and/or 4266 ARG2_CODE as ERROR_MARK. */ 4267 4268tree 4269build_x_binary_op (const op_location_t &loc, enum tree_code code, tree arg1, 4270 enum tree_code arg1_code, tree arg2, 4271 enum tree_code arg2_code, tree *overload_p, 4272 tsubst_flags_t complain) 4273{ 4274 tree orig_arg1; 4275 tree orig_arg2; 4276 tree expr; 4277 tree overload = NULL_TREE(tree) __null; 4278 4279 orig_arg1 = arg1; 4280 orig_arg2 = arg2; 4281 4282 if (processing_template_declscope_chain->x_processing_template_decl) 4283 { 4284 if (type_dependent_expression_p (arg1) 4285 || type_dependent_expression_p (arg2)) 4286 { 4287 expr = build_min_nt_loc (loc, code, arg1, arg2); 4288 maybe_save_operator_binding (expr); 4289 return expr; 4290 } 4291 arg1 = build_non_dependent_expr (arg1); 4292 arg2 = build_non_dependent_expr (arg2); 4293 } 4294 4295 if (code == DOTSTAR_EXPR) 4296 expr = build_m_component_ref (arg1, arg2, complain); 4297 else 4298 expr = build_new_op (loc, code, LOOKUP_NORMAL((1 << 0)), arg1, arg2, NULL_TREE(tree) __null, 4299 &overload, complain); 4300 4301 if (overload_p != NULL__null) 4302 *overload_p = overload; 4303 4304 /* Check for cases such as x+y<<z which users are likely to 4305 misinterpret. But don't warn about obj << x + y, since that is a 4306 common idiom for I/O. */ 4307 if (warn_parenthesesglobal_options.x_warn_parentheses 4308 && (complain & tf_warning) 4309 && !processing_template_declscope_chain->x_processing_template_decl 4310 && !error_operand_p (arg1)((arg1) == global_trees[TI_ERROR_MARK] || ((arg1) && (
(contains_struct_check (((arg1)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4310, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK
]))
4311 && !error_operand_p (arg2)((arg2) == global_trees[TI_ERROR_MARK] || ((arg2) && (
(contains_struct_check (((arg2)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4311, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK
]))
4312 && (code != LSHIFT_EXPR 4313 || !CLASS_TYPE_P (TREE_TYPE (arg1))(((((enum tree_code) (((contains_struct_check ((arg1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4313, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((arg1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4313, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((arg1
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4313, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4313, __FUNCTION__))->type_common.lang_flag_5))
)) 4314 warn_about_parentheses (loc, code, arg1_code, orig_arg1, 4315 arg2_code, orig_arg2); 4316 4317 if (processing_template_declscope_chain->x_processing_template_decl && expr != error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4318 { 4319 if (overload != NULL_TREE(tree) __null) 4320 return (build_min_non_dep_op_overload 4321 (code, expr, overload, orig_arg1, orig_arg2)); 4322 4323 return build_min_non_dep (code, expr, orig_arg1, orig_arg2); 4324 } 4325 4326 return expr; 4327} 4328 4329/* Build and return an ARRAY_REF expression. */ 4330 4331tree 4332build_x_array_ref (location_t loc, tree arg1, tree arg2, 4333 tsubst_flags_t complain) 4334{ 4335 tree orig_arg1 = arg1; 4336 tree orig_arg2 = arg2; 4337 tree expr; 4338 tree overload = NULL_TREE(tree) __null; 4339 4340 if (processing_template_declscope_chain->x_processing_template_decl) 4341 { 4342 if (type_dependent_expression_p (arg1) 4343 || type_dependent_expression_p (arg2)) 4344 return build_min_nt_loc (loc, ARRAY_REF, arg1, arg2, 4345 NULL_TREE(tree) __null, NULL_TREE(tree) __null); 4346 arg1 = build_non_dependent_expr (arg1); 4347 arg2 = build_non_dependent_expr (arg2); 4348 } 4349 4350 expr = build_new_op (loc, ARRAY_REF, LOOKUP_NORMAL((1 << 0)), arg1, arg2, 4351 NULL_TREE(tree) __null, &overload, complain); 4352 4353 if (processing_template_declscope_chain->x_processing_template_decl && expr != error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4354 { 4355 if (overload != NULL_TREE(tree) __null) 4356 return (build_min_non_dep_op_overload 4357 (ARRAY_REF, expr, overload, orig_arg1, orig_arg2)); 4358 4359 return build_min_non_dep (ARRAY_REF, expr, orig_arg1, orig_arg2, 4360 NULL_TREE(tree) __null, NULL_TREE(tree) __null); 4361 } 4362 return expr; 4363} 4364 4365/* Return whether OP is an expression of enum type cast to integer 4366 type. In C++ even unsigned enum types are cast to signed integer 4367 types. We do not want to issue warnings about comparisons between 4368 signed and unsigned types when one of the types is an enum type. 4369 Those warnings are always false positives in practice. */ 4370 4371static bool 4372enum_cast_to_int (tree op) 4373{ 4374 if (CONVERT_EXPR_P (op)((((enum tree_code) (op)->base.code)) == NOP_EXPR || (((enum
tree_code) (op)->base.code)) == CONVERT_EXPR)
4375 && TREE_TYPE (op)((contains_struct_check ((op), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4375, __FUNCTION__))->typed.type)
== integer_type_nodeinteger_types[itk_int] 4376 && TREE_CODE (TREE_TYPE (TREE_OPERAND (op, 0)))((enum tree_code) (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((op), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4376, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4376, __FUNCTION__))->typed.type))->base.code)
== ENUMERAL_TYPE 4377 && TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 0)))((tree_class_check ((((contains_struct_check (((*((const_cast
<tree*> (tree_operand_check ((op), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4377, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4377, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4377, __FUNCTION__))->base.u.bits.unsigned_flag)
) 4378 return true; 4379 4380 /* The cast may have been pushed into a COND_EXPR. */ 4381 if (TREE_CODE (op)((enum tree_code) (op)->base.code) == COND_EXPR) 4382 return (enum_cast_to_int (TREE_OPERAND (op, 1)(*((const_cast<tree*> (tree_operand_check ((op), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4382, __FUNCTION__)))))
) 4383 || enum_cast_to_int (TREE_OPERAND (op, 2)(*((const_cast<tree*> (tree_operand_check ((op), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4383, __FUNCTION__)))))
)); 4384 4385 return false; 4386} 4387 4388/* For the c-common bits. */ 4389tree 4390build_binary_op (location_t location, enum tree_code code, tree op0, tree op1, 4391 bool /*convert_p*/) 4392{ 4393 return cp_build_binary_op (location, code, op0, op1, tf_warning_or_error); 4394} 4395 4396/* Build a vector comparison of ARG0 and ARG1 using CODE opcode 4397 into a value of TYPE type. Comparison is done via VEC_COND_EXPR. */ 4398 4399static tree 4400build_vec_cmp (tree_code code, tree type, 4401 tree arg0, tree arg1) 4402{ 4403 tree zero_vec = build_zero_cst (type); 4404 tree minus_one_vec = build_minus_one_cst (type); 4405 tree cmp_type = truth_type_for (type); 4406 tree cmp = build2 (code, cmp_type, arg0, arg1); 4407 return build3 (VEC_COND_EXPR, type, cmp, minus_one_vec, zero_vec); 4408} 4409 4410/* Possibly warn about an address never being NULL. */ 4411 4412static void 4413warn_for_null_address (location_t location, tree op, tsubst_flags_t complain) 4414{ 4415 if (!warn_addressglobal_options.x_warn_address 4416 || (complain & tf_warning) == 0 4417 || c_inhibit_evaluation_warnings != 0 4418 || TREE_NO_WARNING (op)((op)->base.nowarning_flag)) 4419 return; 4420 4421 tree cop = fold_for_warn (op); 4422 4423 if (TREE_CODE (cop)((enum tree_code) (cop)->base.code) == ADDR_EXPR 4424 && decl_with_nonnull_addr_p (TREE_OPERAND (cop, 0)(*((const_cast<tree*> (tree_operand_check ((cop), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4424, __FUNCTION__)))))
) 4425 && !TREE_NO_WARNING (cop)((cop)->base.nowarning_flag)) 4426 warning_at (location, OPT_Waddress, "the address of %qD will never " 4427 "be NULL", TREE_OPERAND (cop, 0)(*((const_cast<tree*> (tree_operand_check ((cop), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4427, __FUNCTION__)))))
); 4428 4429 if (CONVERT_EXPR_P (op)((((enum tree_code) (op)->base.code)) == NOP_EXPR || (((enum
tree_code) (op)->base.code)) == CONVERT_EXPR)
4430 && TYPE_REF_P (TREE_TYPE (TREE_OPERAND (op, 0)))(((enum tree_code) (((contains_struct_check (((*((const_cast<
tree*> (tree_operand_check ((op), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4430, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4430, __FUNCTION__))->typed.type))->base.code) == REFERENCE_TYPE
)
) 4431 { 4432 tree inner_op = op; 4433 STRIP_NOPS (inner_op)(inner_op) = tree_strip_nop_conversions ((const_cast<union
tree_node *> (((inner_op)))))
; 4434 4435 if (DECL_P (inner_op)(tree_code_type[(int) (((enum tree_code) (inner_op)->base.
code))] == tcc_declaration)
) 4436 warning_at (location, OPT_Waddress, 4437 "the compiler can assume that the address of " 4438 "%qD will never be NULL", inner_op); 4439 } 4440} 4441 4442/* Warn about [expr.arith.conv]/2: If one operand is of enumeration type and 4443 the other operand is of a different enumeration type or a floating-point 4444 type, this behavior is deprecated ([depr.arith.conv.enum]). CODE is the 4445 code of the binary operation, TYPE0 and TYPE1 are the types of the operands, 4446 and LOC is the location for the whole binary expression. 4447 TODO: Consider combining this with -Wenum-compare in build_new_op_1. */ 4448 4449static void 4450do_warn_enum_conversions (location_t loc, enum tree_code code, tree type0, 4451 tree type1) 4452{ 4453 if (TREE_CODE (type0)((enum tree_code) (type0)->base.code) == ENUMERAL_TYPE 4454 && TREE_CODE (type1)((enum tree_code) (type1)->base.code) == ENUMERAL_TYPE 4455 && TYPE_MAIN_VARIANT (type0)((tree_class_check ((type0), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4455, __FUNCTION__))->type_common.main_variant)
!= TYPE_MAIN_VARIANT (type1)((tree_class_check ((type1), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4455, __FUNCTION__))->type_common.main_variant)
) 4456 { 4457 /* In C++20, -Wdeprecated-enum-enum-conversion is on by default. 4458 Otherwise, warn if -Wenum-conversion is on. */ 4459 enum opt_code opt; 4460 if (warn_deprecated_enum_enum_convglobal_options.x_warn_deprecated_enum_enum_conv) 4461 opt = OPT_Wdeprecated_enum_enum_conversion; 4462 else if (warn_enum_conversionglobal_options.x_warn_enum_conversion) 4463 opt = OPT_Wenum_conversion; 4464 else 4465 return; 4466 4467 switch (code) 4468 { 4469 case GT_EXPR: 4470 case LT_EXPR: 4471 case GE_EXPR: 4472 case LE_EXPR: 4473 case EQ_EXPR: 4474 case NE_EXPR: 4475 /* Comparisons are handled by -Wenum-compare. */ 4476 return; 4477 case SPACESHIP_EXPR: 4478 /* This is invalid, don't warn. */ 4479 return; 4480 case BIT_AND_EXPR: 4481 case BIT_IOR_EXPR: 4482 case BIT_XOR_EXPR: 4483 warning_at (loc, opt, "bitwise operation between different " 4484 "enumeration types %qT and %qT is deprecated", 4485 type0, type1); 4486 return; 4487 default: 4488 warning_at (loc, opt, "arithmetic between different enumeration " 4489 "types %qT and %qT is deprecated", type0, type1); 4490 return; 4491 } 4492 } 4493 else if ((TREE_CODE (type0)((enum tree_code) (type0)->base.code) == ENUMERAL_TYPE 4494 && TREE_CODE (type1)((enum tree_code) (type1)->base.code) == REAL_TYPE) 4495 || (TREE_CODE (type0)((enum tree_code) (type0)->base.code) == REAL_TYPE 4496 && TREE_CODE (type1)((enum tree_code) (type1)->base.code) == ENUMERAL_TYPE)) 4497 { 4498 const bool enum_first_p = TREE_CODE (type0)((enum tree_code) (type0)->base.code) == ENUMERAL_TYPE; 4499 /* In C++20, -Wdeprecated-enum-float-conversion is on by default. 4500 Otherwise, warn if -Wenum-conversion is on. */ 4501 enum opt_code opt; 4502 if (warn_deprecated_enum_float_convglobal_options.x_warn_deprecated_enum_float_conv) 4503 opt = OPT_Wdeprecated_enum_float_conversion; 4504 else if (warn_enum_conversionglobal_options.x_warn_enum_conversion) 4505 opt = OPT_Wenum_conversion; 4506 else 4507 return; 4508 4509 switch (code) 4510 { 4511 case GT_EXPR: 4512 case LT_EXPR: 4513 case GE_EXPR: 4514 case LE_EXPR: 4515 case EQ_EXPR: 4516 case NE_EXPR: 4517 if (enum_first_p) 4518 warning_at (loc, opt, "comparison of enumeration type %qT with " 4519 "floating-point type %qT is deprecated", 4520 type0, type1); 4521 else 4522 warning_at (loc, opt, "comparison of floating-point type %qT " 4523 "with enumeration type %qT is deprecated", 4524 type0, type1); 4525 return; 4526 case SPACESHIP_EXPR: 4527 /* This is invalid, don't warn. */ 4528 return; 4529 default: 4530 if (enum_first_p) 4531 warning_at (loc, opt, "arithmetic between enumeration type %qT " 4532 "and floating-point type %qT is deprecated", 4533 type0, type1); 4534 else 4535 warning_at (loc, opt, "arithmetic between floating-point type %qT " 4536 "and enumeration type %qT is deprecated", 4537 type0, type1); 4538 return; 4539 } 4540 } 4541} 4542 4543/* Build a binary-operation expression without default conversions. 4544 CODE is the kind of expression to build. 4545 LOCATION is the location_t of the operator in the source code. 4546 This function differs from `build' in several ways: 4547 the data type of the result is computed and recorded in it, 4548 warnings are generated if arg data types are invalid, 4549 special handling for addition and subtraction of pointers is known, 4550 and some optimization is done (operations on narrow ints 4551 are done in the narrower type when that gives the same result). 4552 Constant folding is also done before the result is returned. 4553 4554 Note that the operands will never have enumeral types 4555 because either they have just had the default conversions performed 4556 or they have both just been converted to some other type in which 4557 the arithmetic is to be done. 4558 4559 C++: must do special pointer arithmetic when implementing 4560 multiple inheritance, and deal with pointer to member functions. */ 4561 4562tree 4563cp_build_binary_op (const op_location_t &location, 4564 enum tree_code code, tree orig_op0, tree orig_op1, 4565 tsubst_flags_t complain) 4566{ 4567 tree op0, op1; 4568 enum tree_code code0, code1; 4569 tree type0, type1; 4570 const char *invalid_op_diag; 4571 4572 /* Expression code to give to the expression when it is built. 4573 Normally this is CODE, which is what the caller asked for, 4574 but in some special cases we change it. */ 4575 enum tree_code resultcode = code; 4576 4577 /* Data type in which the computation is to be performed. 4578 In the simplest cases this is the common type of the arguments. */ 4579 tree result_type = NULL_TREE(tree) __null; 4580 4581 /* Nonzero means operands have already been type-converted 4582 in whatever way is necessary. 4583 Zero means they need to be converted to RESULT_TYPE. */ 4584 int converted = 0; 4585 4586 /* Nonzero means create the expression with this type, rather than 4587 RESULT_TYPE. */ 4588 tree build_type = 0; 4589 4590 /* Nonzero means after finally constructing the expression 4591 convert it to this type. */ 4592 tree final_type = 0; 4593 4594 tree result, result_ovl; 4595 4596 /* Nonzero if this is an operation like MIN or MAX which can 4597 safely be computed in short if both args are promoted shorts. 4598 Also implies COMMON. 4599 -1 indicates a bitwise operation; this makes a difference 4600 in the exact conditions for when it is safe to do the operation 4601 in a narrower mode. */ 4602 int shorten = 0; 4603 4604 /* Nonzero if this is a comparison operation; 4605 if both args are promoted shorts, compare the original shorts. 4606 Also implies COMMON. */ 4607 int short_compare = 0; 4608 4609 /* Nonzero if this is a right-shift operation, which can be computed on the 4610 original short and then promoted if the operand is a promoted short. */ 4611 int short_shift = 0; 4612 4613 /* Nonzero means set RESULT_TYPE to the common type of the args. */ 4614 int common = 0; 4615 4616 /* True if both operands have arithmetic type. */ 4617 bool arithmetic_types_p; 4618 4619 /* Remember whether we're doing / or %. */ 4620 bool doing_div_or_mod = false; 4621 4622 /* Remember whether we're doing << or >>. */ 4623 bool doing_shift = false; 4624 4625 /* Tree holding instrumentation expression. */ 4626 tree instrument_expr = NULL_TREE(tree) __null; 4627 4628 /* Apply default conversions. */ 4629 op0 = resolve_nondeduced_context (orig_op0, complain); 4630 op1 = resolve_nondeduced_context (orig_op1, complain); 4631 4632 if (code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR 4633 || code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR 4634 || code == TRUTH_XOR_EXPR) 4635 { 4636 if (!really_overloaded_fn (op0) && !VOID_TYPE_P (TREE_TYPE (op0))(((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4636, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
) 4637 op0 = decay_conversion (op0, complain); 4638 if (!really_overloaded_fn (op1) && !VOID_TYPE_P (TREE_TYPE (op1))(((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4638, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
) 4639 op1 = decay_conversion (op1, complain); 4640 } 4641 else 4642 { 4643 if (!really_overloaded_fn (op0) && !VOID_TYPE_P (TREE_TYPE (op0))(((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4643, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
) 4644 op0 = cp_default_conversion (op0, complain); 4645 if (!really_overloaded_fn (op1) && !VOID_TYPE_P (TREE_TYPE (op1))(((enum tree_code) (((contains_struct_check ((op1), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4645, __FUNCTION__))->typed.type))->base.code) == VOID_TYPE
)
) 4646 op1 = cp_default_conversion (op1, complain); 4647 } 4648 4649 /* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */ 4650 STRIP_TYPE_NOPS (op0)while ((((((enum tree_code) (op0)->base.code)) == NOP_EXPR
|| (((enum tree_code) (op0)->base.code)) == CONVERT_EXPR)
|| ((enum tree_code) (op0)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(op0), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4650, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4650, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((op0), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4650, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4650, __FUNCTION__))->typed.type))) (op0) = (*((const_cast
<tree*> (tree_operand_check ((op0), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4650, __FUNCTION__)))))
; 4651 STRIP_TYPE_NOPS (op1)while ((((((enum tree_code) (op1)->base.code)) == NOP_EXPR
|| (((enum tree_code) (op1)->base.code)) == CONVERT_EXPR)
|| ((enum tree_code) (op1)->base.code) == NON_LVALUE_EXPR
) && (*((const_cast<tree*> (tree_operand_check (
(op1), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4651, __FUNCTION__))))) != global_trees[TI_ERROR_MARK] &&
(((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4651, __FUNCTION__))->typed.type) == ((contains_struct_check
(((*((const_cast<tree*> (tree_operand_check ((op1), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4651, __FUNCTION__)))))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4651, __FUNCTION__))->typed.type))) (op1) = (*((const_cast
<tree*> (tree_operand_check ((op1), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4651, __FUNCTION__)))))
; 4652 4653 /* DTRT if one side is an overloaded function, but complain about it. */ 4654 if (type_unknown_p (op0)) 4655 { 4656 tree t = instantiate_type (TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4656, __FUNCTION__))->typed.type)
, op0, tf_none); 4657 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4658 { 4659 if (complain & tf_error) 4660 permerror (location, 4661 "assuming cast to type %qT from overloaded function", 4662 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4662, __FUNCTION__))->typed.type)
); 4663 op0 = t; 4664 } 4665 } 4666 if (type_unknown_p (op1)) 4667 { 4668 tree t = instantiate_type (TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4668, __FUNCTION__))->typed.type)
, op1, tf_none); 4669 if (t != error_mark_nodeglobal_trees[TI_ERROR_MARK]) 4670 { 4671 if (complain & tf_error) 4672 permerror (location, 4673 "assuming cast to type %qT from overloaded function", 4674 TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4674, __FUNCTION__))->typed.type)
); 4675 op1 = t; 4676 } 4677 } 4678 4679 type0 = TREE_TYPE (op0)((contains_struct_check ((op0), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4679, __FUNCTION__))->typed.type)
; 4680 type1 = TREE_TYPE (op1)((contains_struct_check ((op1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/typeck.c"
, 4680, __FUNCTION__))->typed.type)
; 4681 4682 /* The expression codes of the data types of the arguments tell us 4683 whether the arguments are integers, floating, pointers, etc. */ 4684 code0 = TREE_CODE (type0)((enum tree_code) (type0)->base.code); 4685 code1 = TREE_CODE (type1)((enum tree_code) (type1)->base.code); 4686 4687 /* If an error was already reported for one of the arguments, 4688 avoid reporting another error. */ 4689 if (code0 == ERROR_MARK || code1 == ERROR_MARK) 4690 return error_mark_nodeglobal_trees[TI_ERROR_MARK]; 4691 4692 if ((invalid_op_diag 4693 = targetm.invalid_binary_op (code, type0, type1))) 4694 { 4695 if (complain & tf_error) 4696 error (invalid_op_diag); 4697 return error_mark_node