File: | build/gcc/cp/method.cc |
Warning: | line 2119, column 8 Called C++ object pointer is null |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Handle the hair of processing (but not expanding) inline functions. | ||||
2 | Also manage function and variable name overloading. | ||||
3 | Copyright (C) 1987-2023 Free Software Foundation, Inc. | ||||
4 | Contributed by Michael Tiemann (tiemann@cygnus.com) | ||||
5 | |||||
6 | This file is part of GCC. | ||||
7 | |||||
8 | GCC is free software; you can redistribute it and/or modify | ||||
9 | it under the terms of the GNU General Public License as published by | ||||
10 | the Free Software Foundation; either version 3, or (at your option) | ||||
11 | any later version. | ||||
12 | |||||
13 | GCC is distributed in the hope that it will be useful, | ||||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
16 | GNU General Public License for more details. | ||||
17 | |||||
18 | You should have received a copy of the GNU General Public License | ||||
19 | along with GCC; see the file COPYING3. If not see | ||||
20 | <http://www.gnu.org/licenses/>. */ | ||||
21 | |||||
22 | |||||
23 | /* Handle method declarations. */ | ||||
24 | #include "config.h" | ||||
25 | #include "system.h" | ||||
26 | #include "coretypes.h" | ||||
27 | #include "target.h" | ||||
28 | #include "cp-tree.h" | ||||
29 | #include "stringpool.h" | ||||
30 | #include "cgraph.h" | ||||
31 | #include "varasm.h" | ||||
32 | #include "toplev.h" | ||||
33 | #include "intl.h" | ||||
34 | #include "common/common-target.h" | ||||
35 | |||||
36 | static void do_build_copy_assign (tree); | ||||
37 | static void do_build_copy_constructor (tree); | ||||
38 | static tree make_alias_for_thunk (tree); | ||||
39 | |||||
40 | /* Called once to initialize method.cc. */ | ||||
41 | |||||
42 | void | ||||
43 | init_method (void) | ||||
44 | { | ||||
45 | init_mangle (); | ||||
46 | } | ||||
47 | |||||
48 | /* Return a this or result adjusting thunk to FUNCTION. THIS_ADJUSTING | ||||
49 | indicates whether it is a this or result adjusting thunk. | ||||
50 | FIXED_OFFSET and VIRTUAL_OFFSET indicate how to do the adjustment | ||||
51 | (see thunk_adjust). VIRTUAL_OFFSET can be NULL, but FIXED_OFFSET | ||||
52 | never is. VIRTUAL_OFFSET is the /index/ into the vtable for this | ||||
53 | adjusting thunks, we scale it to a byte offset. For covariant | ||||
54 | thunks VIRTUAL_OFFSET is the virtual binfo. You must post process | ||||
55 | the returned thunk with finish_thunk. */ | ||||
56 | |||||
57 | tree | ||||
58 | make_thunk (tree function, bool this_adjusting, | ||||
59 | tree fixed_offset, tree virtual_offset) | ||||
60 | { | ||||
61 | HOST_WIDE_INTlong d; | ||||
62 | tree thunk; | ||||
63 | |||||
64 | gcc_assert (TREE_CODE (function) == FUNCTION_DECL)((void)(!(((enum tree_code) (function)->base.code) == FUNCTION_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 64, __FUNCTION__), 0 : 0)); | ||||
65 | /* We can have this thunks to covariant thunks, but not vice versa. */ | ||||
66 | gcc_assert (!DECL_THIS_THUNK_P (function))((void)(!(!((((enum tree_code) (function)->base.code) == FUNCTION_DECL && ((contains_struct_check ((function), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__))->decl_common.lang_specific); if (!((( enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__); <->u.fn; })->thunk_p) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__))->decl_common.lang_specific); if (!((( enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__); <->u.fn; })->this_thunk_p)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 66, __FUNCTION__), 0 : 0)); | ||||
67 | gcc_assert (!DECL_RESULT_THUNK_P (function) || this_adjusting)((void)(!(!((((enum tree_code) (function)->base.code) == FUNCTION_DECL && ((contains_struct_check ((function), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__))->decl_common.lang_specific); if (!((( enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__); <->u.fn; })->thunk_p) && !__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__))->decl_common.lang_specific); if (!((( enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__); <->u.fn; })->this_thunk_p) || this_adjusting) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 67, __FUNCTION__), 0 : 0)); | ||||
68 | |||||
69 | /* Scale the VIRTUAL_OFFSET to be in terms of bytes. */ | ||||
70 | if (this_adjusting && virtual_offset) | ||||
71 | virtual_offset | ||||
72 | = size_binop (MULT_EXPR,size_binop_loc (((location_t) 0), MULT_EXPR, virtual_offset, convert (sizetype_tab[(int) stk_ssizetype], ((tree_class_check ((cp_global_trees [CPTI_VTABLE_ENTRY_TYPE]), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 75, __FUNCTION__))->type_common.size_unit))) | ||||
73 | virtual_offset,size_binop_loc (((location_t) 0), MULT_EXPR, virtual_offset, convert (sizetype_tab[(int) stk_ssizetype], ((tree_class_check ((cp_global_trees [CPTI_VTABLE_ENTRY_TYPE]), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 75, __FUNCTION__))->type_common.size_unit))) | ||||
74 | convert (ssizetype,size_binop_loc (((location_t) 0), MULT_EXPR, virtual_offset, convert (sizetype_tab[(int) stk_ssizetype], ((tree_class_check ((cp_global_trees [CPTI_VTABLE_ENTRY_TYPE]), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 75, __FUNCTION__))->type_common.size_unit))) | ||||
75 | TYPE_SIZE_UNIT (vtable_entry_type)))size_binop_loc (((location_t) 0), MULT_EXPR, virtual_offset, convert (sizetype_tab[(int) stk_ssizetype], ((tree_class_check ((cp_global_trees [CPTI_VTABLE_ENTRY_TYPE]), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 75, __FUNCTION__))->type_common.size_unit))); | ||||
76 | |||||
77 | d = tree_to_shwi (fixed_offset); | ||||
78 | |||||
79 | /* See if we already have the thunk in question. For this_adjusting | ||||
80 | thunks VIRTUAL_OFFSET will be an INTEGER_CST, for covariant thunks it | ||||
81 | will be a BINFO. */ | ||||
82 | for (thunk = DECL_THUNKS (function)(((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__))->decl_common.virtual_flag) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__))->decl_common.lang_specific); if (!((( enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__); <->u.fn; })->context : (tree ) __null); thunk; thunk = DECL_CHAIN (thunk)(((contains_struct_check (((contains_struct_check ((thunk), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 82, __FUNCTION__))->common.chain))) | ||||
83 | if (DECL_THIS_THUNK_P (thunk)((((enum tree_code) (thunk)->base.code) == FUNCTION_DECL && ((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__))->decl_common.lang_specific); if (!((( enum tree_code) (thunk)->base.code) == FUNCTION_DECL || (( (enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__); <->u.fn; })->thunk_p) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__))->decl_common.lang_specific); if (!((( enum tree_code) (thunk)->base.code) == FUNCTION_DECL || (( (enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 83, __FUNCTION__); <->u.fn; })->this_thunk_p) == this_adjusting | ||||
84 | && THUNK_FIXED_OFFSET (thunk)(((contains_struct_check ((__extension__ ({ __typeof (thunk) const __t = (thunk); if (((enum tree_code) (__t)->base.code) != FUNCTION_DECL || !__t->decl_common.lang_specific || !__t-> decl_common.lang_specific->u.fn.thunk_p) tree_check_failed (__t, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 84, __FUNCTION__, 0); __t; })), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 84, __FUNCTION__))->decl_common.lang_specific)->u.fn. u5.fixed_offset) == d | ||||
85 | && !virtual_offset == !THUNK_VIRTUAL_OFFSET (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__))->decl_common.lang_specific); if (!((( (enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == VAR_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL ) || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FIELD_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONST_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TYPE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == USING_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONCEPT_DECL )) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 85, __FUNCTION__); <->u.min; })->access) | ||||
86 | && (!virtual_offset | ||||
87 | || (this_adjusting | ||||
88 | ? tree_int_cst_equal (THUNK_VIRTUAL_OFFSET (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__))->decl_common.lang_specific); if (!((( (enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == VAR_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL ) || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FIELD_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONST_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TYPE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == USING_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONCEPT_DECL )) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 88, __FUNCTION__); <->u.min; })->access), | ||||
89 | virtual_offset) | ||||
90 | : THUNK_VIRTUAL_OFFSET (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__))->decl_common.lang_specific); if (!((( (enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == VAR_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL ) || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FIELD_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONST_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TYPE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == USING_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONCEPT_DECL )) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 90, __FUNCTION__); <->u.min; })->access) == virtual_offset))) | ||||
91 | return thunk; | ||||
92 | |||||
93 | /* All thunks must be created before FUNCTION is actually emitted; | ||||
94 | the ABI requires that all thunks be emitted together with the | ||||
95 | function to which they transfer control. */ | ||||
96 | gcc_assert (!TREE_ASM_WRITTEN (function))((void)(!(!((function)->base.asm_written_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 96, __FUNCTION__), 0 : 0)); | ||||
97 | /* Likewise, we can only be adding thunks to a function declared in | ||||
98 | the class currently being laid out. */ | ||||
99 | gcc_assert (TYPE_SIZE (DECL_CONTEXT (function))((void)(!(((tree_class_check ((((contains_struct_check ((function ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 99, __FUNCTION__))->decl_minimal.context)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 99, __FUNCTION__))->type_common.size) && ((((tree_class_check ((((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 100, __FUNCTION__))->decl_minimal.context)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 100, __FUNCTION__))->type_with_lang_specific.lang_specific ))->being_defined)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 100, __FUNCTION__), 0 : 0)) | ||||
100 | && TYPE_BEING_DEFINED (DECL_CONTEXT (function)))((void)(!(((tree_class_check ((((contains_struct_check ((function ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 99, __FUNCTION__))->decl_minimal.context)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 99, __FUNCTION__))->type_common.size) && ((((tree_class_check ((((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 100, __FUNCTION__))->decl_minimal.context)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 100, __FUNCTION__))->type_with_lang_specific.lang_specific ))->being_defined)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 100, __FUNCTION__), 0 : 0)); | ||||
101 | |||||
102 | thunk = build_decl (DECL_SOURCE_LOCATION (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 102, __FUNCTION__))->decl_minimal.locus), | ||||
103 | FUNCTION_DECL, NULL_TREE(tree) __null, TREE_TYPE (function)((contains_struct_check ((function), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 103, __FUNCTION__))->typed.type)); | ||||
104 | DECL_LANG_SPECIFIC (thunk)((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 104, __FUNCTION__))->decl_common.lang_specific) = DECL_LANG_SPECIFIC (function)((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 104, __FUNCTION__))->decl_common.lang_specific); | ||||
105 | cxx_dup_lang_specific_decl (thunk); | ||||
106 | DECL_VIRTUAL_P (thunk)((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 106, __FUNCTION__))->decl_common.virtual_flag) = true; | ||||
107 | SET_DECL_THUNKS (thunk, NULL_TREE)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 107, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 107, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 107, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 107, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 107, __FUNCTION__); <->u.fn; })->context = ((tree ) __null)); | ||||
108 | |||||
109 | DECL_CONTEXT (thunk)((contains_struct_check ((thunk), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 109, __FUNCTION__))->decl_minimal.context) = DECL_CONTEXT (function)((contains_struct_check ((function), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 109, __FUNCTION__))->decl_minimal.context); | ||||
110 | TREE_READONLY (thunk)((non_type_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 110, __FUNCTION__))->base.readonly_flag) = TREE_READONLY (function)((non_type_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 110, __FUNCTION__))->base.readonly_flag); | ||||
111 | TREE_THIS_VOLATILE (thunk)((thunk)->base.volatile_flag) = TREE_THIS_VOLATILE (function)((function)->base.volatile_flag); | ||||
112 | TREE_PUBLIC (thunk)((thunk)->base.public_flag) = TREE_PUBLIC (function)((function)->base.public_flag); | ||||
113 | SET_DECL_THUNK_P (thunk, this_adjusting)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__); <->u.fn; })->thunk_p = 1, __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 113, __FUNCTION__); <->u.fn; })->this_thunk_p = (this_adjusting)); | ||||
114 | THUNK_TARGET (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 114, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 114, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 114, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 114, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 114, __FUNCTION__); <->u.fn; })->befriending_classes ) = function; | ||||
115 | THUNK_FIXED_OFFSET (thunk)(((contains_struct_check ((__extension__ ({ __typeof (thunk) const __t = (thunk); if (((enum tree_code) (__t)->base.code) != FUNCTION_DECL || !__t->decl_common.lang_specific || !__t-> decl_common.lang_specific->u.fn.thunk_p) tree_check_failed (__t, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 115, __FUNCTION__, 0); __t; })), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 115, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.fixed_offset) = d; | ||||
116 | THUNK_VIRTUAL_OFFSET (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__))->decl_common.lang_specific); if (!(( ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == VAR_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL ) || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FIELD_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONST_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TYPE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == USING_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONCEPT_DECL )) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 116, __FUNCTION__); <->u.min; })->access) = virtual_offset; | ||||
117 | THUNK_ALIAS (thunk)(((contains_struct_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 117, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 117, __FUNCTION__))->decl_common.lang_specific)->u.min .template_info) = NULL_TREE(tree) __null; | ||||
118 | |||||
119 | DECL_INTERFACE_KNOWN (thunk)((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 119, __FUNCTION__))->decl_common.lang_flag_5) = 1; | ||||
120 | DECL_NOT_REALLY_EXTERN (thunk)(((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 120, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 1; | ||||
121 | DECL_COMDAT (thunk)((contains_struct_check ((thunk), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 121, __FUNCTION__))->decl_with_vis.comdat_flag) = DECL_COMDAT (function)((contains_struct_check ((function), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 121, __FUNCTION__))->decl_with_vis.comdat_flag); | ||||
122 | DECL_SAVED_AUTO_RETURN_TYPE (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (FUNCTION_DECL))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL || (((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 122, __FUNCTION__); <->u.fn; }) ->u.saved_auto_return_type ) = NULL__null; | ||||
123 | /* The thunk itself is not a constructor or destructor, even if | ||||
124 | the thing it is thunking to is. */ | ||||
125 | DECL_CXX_DESTRUCTOR_P (thunk)((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 125, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) = 0; | ||||
126 | DECL_CXX_CONSTRUCTOR_P (thunk)((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 126, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) = 0; | ||||
127 | DECL_EXTERNAL (thunk)((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 127, __FUNCTION__))->decl_common.decl_flag_1) = 1; | ||||
128 | DECL_ARTIFICIAL (thunk)((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 128, __FUNCTION__))->decl_common.artificial_flag) = 1; | ||||
129 | /* The THUNK is not a pending inline, even if the FUNCTION is. */ | ||||
130 | DECL_PENDING_INLINE_P (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 130, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 130, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 130, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 130, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 130, __FUNCTION__); <->u.fn; })->pending_inline_p ) = 0; | ||||
131 | DECL_DECLARED_INLINE_P (thunk)((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 131, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) = 0; | ||||
132 | /* Nor is it a template instantiation. */ | ||||
133 | DECL_USE_TEMPLATE (thunk)(((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 133, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) = 0; | ||||
134 | DECL_TEMPLATE_INFO (thunk)(((contains_struct_check ((template_info_decl_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 134, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 134, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info) = NULL__null; | ||||
135 | |||||
136 | /* Add it to the list of thunks associated with FUNCTION. */ | ||||
137 | DECL_CHAIN (thunk)(((contains_struct_check (((contains_struct_check ((thunk), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__))->common.chain)) = DECL_THUNKS (function)(((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__))->decl_common.virtual_flag) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 137, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
138 | SET_DECL_THUNKS (function, thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 138, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 138, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 138, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 138, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 138, __FUNCTION__); <->u.fn; })->context = (thunk )); | ||||
139 | |||||
140 | return thunk; | ||||
141 | } | ||||
142 | |||||
143 | /* Finish THUNK, a thunk decl. */ | ||||
144 | |||||
145 | void | ||||
146 | finish_thunk (tree thunk) | ||||
147 | { | ||||
148 | tree function, name; | ||||
149 | tree fixed_offset = ssize_int (THUNK_FIXED_OFFSET (thunk))size_int_kind ((((contains_struct_check ((__extension__ ({ __typeof (thunk) const __t = (thunk); if (((enum tree_code) (__t)-> base.code) != FUNCTION_DECL || !__t->decl_common.lang_specific || !__t->decl_common.lang_specific->u.fn.thunk_p) tree_check_failed (__t, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 149, __FUNCTION__, 0); __t; })), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 149, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.fixed_offset), stk_ssizetype); | ||||
150 | tree virtual_offset = THUNK_VIRTUAL_OFFSET (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__))->decl_common.lang_specific); if (!(( ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == VAR_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL ) || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FIELD_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONST_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TYPE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == USING_DECL || ((enum tree_code) ((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONCEPT_DECL )) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 150, __FUNCTION__); <->u.min; })->access); | ||||
151 | |||||
152 | gcc_assert (!DECL_NAME (thunk) && DECL_THUNK_P (thunk))((void)(!(!((contains_struct_check ((thunk), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__))->decl_minimal.name) && (((enum tree_code) (thunk)->base.code) == FUNCTION_DECL && ((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__); <->u.fn; })->thunk_p)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 152, __FUNCTION__), 0 : 0)); | ||||
153 | if (virtual_offset && DECL_RESULT_THUNK_P (thunk)((((enum tree_code) (thunk)->base.code) == FUNCTION_DECL && ((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__); <->u.fn; })->thunk_p) && !__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 153, __FUNCTION__); <->u.fn; })->this_thunk_p)) | ||||
154 | virtual_offset = BINFO_VPTR_FIELD (virtual_offset)((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 154, __FUNCTION__, (TREE_BINFO)))->binfo.vptr_field); | ||||
155 | function = THUNK_TARGET (thunk)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 155, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 155, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 155, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 155, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 155, __FUNCTION__); <->u.fn; })->befriending_classes ); | ||||
156 | name = mangle_thunk (function, DECL_THIS_THUNK_P (thunk)((((enum tree_code) (thunk)->base.code) == FUNCTION_DECL && ((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__); <->u.fn; })->thunk_p) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 156, __FUNCTION__); <->u.fn; })->this_thunk_p), | ||||
157 | fixed_offset, virtual_offset, thunk); | ||||
158 | |||||
159 | /* We can end up with declarations of (logically) different | ||||
160 | covariant thunks, that do identical adjustments. The two thunks | ||||
161 | will be adjusting between within different hierarchies, which | ||||
162 | happen to have the same layout. We must nullify one of them to | ||||
163 | refer to the other. */ | ||||
164 | if (DECL_RESULT_THUNK_P (thunk)((((enum tree_code) (thunk)->base.code) == FUNCTION_DECL && ((contains_struct_check ((thunk), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__); <->u.fn; })->thunk_p) && !__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 164, __FUNCTION__); <->u.fn; })->this_thunk_p)) | ||||
165 | { | ||||
166 | tree cov_probe; | ||||
167 | |||||
168 | for (cov_probe = DECL_THUNKS (function)(((contains_struct_check ((function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 168, __FUNCTION__))->decl_common.virtual_flag) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 168, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 168, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 168, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 168, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 168, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
169 | cov_probe; cov_probe = DECL_CHAIN (cov_probe)(((contains_struct_check (((contains_struct_check ((cov_probe ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 169, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 169, __FUNCTION__))->common.chain))) | ||||
170 | if (DECL_NAME (cov_probe)((contains_struct_check ((cov_probe), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 170, __FUNCTION__))->decl_minimal.name) == name) | ||||
171 | { | ||||
172 | gcc_assert (!DECL_THUNKS (thunk))((void)(!(!(((contains_struct_check ((thunk), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 172, __FUNCTION__))->decl_common.virtual_flag) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (thunk)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 172, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 172, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (thunk)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 172, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 172, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 172, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 172, __FUNCTION__), 0 : 0)); | ||||
173 | THUNK_ALIAS (thunk)(((contains_struct_check (((tree_check ((thunk), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 173, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 173, __FUNCTION__))->decl_common.lang_specific)->u.min .template_info) = (THUNK_ALIAS (cov_probe)(((contains_struct_check (((tree_check ((cov_probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 173, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 173, __FUNCTION__))->decl_common.lang_specific)->u.min .template_info) | ||||
174 | ? THUNK_ALIAS (cov_probe)(((contains_struct_check (((tree_check ((cov_probe), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 174, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 174, __FUNCTION__))->decl_common.lang_specific)->u.min .template_info) : cov_probe); | ||||
175 | break; | ||||
176 | } | ||||
177 | } | ||||
178 | |||||
179 | DECL_NAME (thunk)((contains_struct_check ((thunk), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 179, __FUNCTION__))->decl_minimal.name) = name; | ||||
180 | SET_DECL_ASSEMBLER_NAME (thunk, name)overwrite_decl_assembler_name (thunk, name); | ||||
181 | } | ||||
182 | |||||
183 | static GTY (()) int thunk_labelno; | ||||
184 | |||||
185 | /* Create a static alias to target. */ | ||||
186 | |||||
187 | tree | ||||
188 | make_alias_for (tree target, tree newid) | ||||
189 | { | ||||
190 | tree alias = build_decl (DECL_SOURCE_LOCATION (target)((contains_struct_check ((target), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 190, __FUNCTION__))->decl_minimal.locus), | ||||
191 | TREE_CODE (target)((enum tree_code) (target)->base.code), newid, TREE_TYPE (target)((contains_struct_check ((target), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 191, __FUNCTION__))->typed.type)); | ||||
192 | DECL_LANG_SPECIFIC (alias)((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 192, __FUNCTION__))->decl_common.lang_specific) = DECL_LANG_SPECIFIC (target)((contains_struct_check ((target), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 192, __FUNCTION__))->decl_common.lang_specific); | ||||
193 | cxx_dup_lang_specific_decl (alias); | ||||
194 | DECL_CONTEXT (alias)((contains_struct_check ((alias), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 194, __FUNCTION__))->decl_minimal.context) = DECL_CONTEXT (target)((contains_struct_check ((target), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 194, __FUNCTION__))->decl_minimal.context); | ||||
195 | TREE_READONLY (alias)((non_type_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 195, __FUNCTION__))->base.readonly_flag) = TREE_READONLY (target)((non_type_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 195, __FUNCTION__))->base.readonly_flag); | ||||
196 | TREE_THIS_VOLATILE (alias)((alias)->base.volatile_flag) = TREE_THIS_VOLATILE (target)((target)->base.volatile_flag); | ||||
197 | TREE_PUBLIC (alias)((alias)->base.public_flag) = 0; | ||||
198 | DECL_INTERFACE_KNOWN (alias)((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 198, __FUNCTION__))->decl_common.lang_flag_5) = 1; | ||||
199 | if (DECL_LANG_SPECIFIC (alias)((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 199, __FUNCTION__))->decl_common.lang_specific)) | ||||
200 | { | ||||
201 | DECL_NOT_REALLY_EXTERN (alias)(((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 201, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 1; | ||||
202 | DECL_USE_TEMPLATE (alias)(((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 202, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) = 0; | ||||
203 | DECL_TEMPLATE_INFO (alias)(((contains_struct_check ((template_info_decl_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 203, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 203, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info) = NULL__null; | ||||
204 | } | ||||
205 | DECL_EXTERNAL (alias)((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 205, __FUNCTION__))->decl_common.decl_flag_1) = 0; | ||||
206 | DECL_ARTIFICIAL (alias)((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 206, __FUNCTION__))->decl_common.artificial_flag) = 1; | ||||
207 | DECL_TEMPLATE_INSTANTIATED (alias)((contains_struct_check (((tree_check2 ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 207, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 207, __FUNCTION__))->decl_common.lang_flag_1) = 0; | ||||
208 | if (TREE_CODE (alias)((enum tree_code) (alias)->base.code) == FUNCTION_DECL) | ||||
209 | { | ||||
210 | DECL_SAVED_AUTO_RETURN_TYPE (alias)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) ((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (TEMPLATE_DECL))))))))->result : (tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (FUNCTION_DECL))))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) ((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL || (((enum tree_code) ((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check (((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 210, __FUNCTION__); <->u.fn; }) ->u.saved_auto_return_type ) = NULL__null; | ||||
211 | DECL_CXX_DESTRUCTOR_P (alias)((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 211, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) = 0; | ||||
212 | DECL_CXX_CONSTRUCTOR_P (alias)((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 212, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) = 0; | ||||
213 | DECL_PENDING_INLINE_P (alias)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (alias)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 213, __FUNCTION__, (TEMPLATE_DECL))))))))->result : alias )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 213, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (alias)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (alias)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 213, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((alias ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 213, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 213, __FUNCTION__); <->u.fn; })->pending_inline_p ) = 0; | ||||
214 | DECL_DECLARED_INLINE_P (alias)((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 214, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) = 0; | ||||
215 | DECL_INITIAL (alias)((contains_struct_check ((alias), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 215, __FUNCTION__))->decl_common.initial) = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
216 | DECL_ARGUMENTS (alias)((tree_check ((alias), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 216, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = copy_list (DECL_ARGUMENTS (target)((tree_check ((target), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 216, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )); | ||||
217 | } | ||||
218 | else | ||||
219 | TREE_STATIC (alias)((alias)->base.static_flag) = 1; | ||||
220 | TREE_ADDRESSABLE (alias)((alias)->base.addressable_flag) = 1; | ||||
221 | TREE_USED (alias)((alias)->base.used_flag) = 1; | ||||
222 | SET_DECL_ASSEMBLER_NAME (alias, DECL_NAME (alias))overwrite_decl_assembler_name (alias, ((contains_struct_check ((alias), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 222, __FUNCTION__))->decl_minimal.name)); | ||||
223 | return alias; | ||||
224 | } | ||||
225 | |||||
226 | static tree | ||||
227 | make_alias_for_thunk (tree function) | ||||
228 | { | ||||
229 | tree alias; | ||||
230 | char buf[256]; | ||||
231 | |||||
232 | targetm.asm_out.generate_internal_label (buf, "LTHUNK", thunk_labelno); | ||||
233 | thunk_labelno++; | ||||
234 | |||||
235 | alias = make_alias_for (function, get_identifier (buf)(__builtin_constant_p (buf) ? get_identifier_with_length ((buf ), strlen (buf)) : get_identifier (buf))); | ||||
236 | |||||
237 | if (!flag_syntax_onlyglobal_options.x_flag_syntax_only) | ||||
238 | { | ||||
239 | struct cgraph_node *funcn, *aliasn; | ||||
240 | funcn = cgraph_node::get (function); | ||||
241 | gcc_checking_assert (funcn)((void)(!(funcn) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 241, __FUNCTION__), 0 : 0)); | ||||
242 | aliasn = cgraph_node::create_same_body_alias (alias, function); | ||||
243 | DECL_ASSEMBLER_NAME (function)decl_assembler_name (function); | ||||
244 | gcc_assert (aliasn != NULL)((void)(!(aliasn != __null) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 244, __FUNCTION__), 0 : 0)); | ||||
245 | } | ||||
246 | |||||
247 | return alias; | ||||
248 | } | ||||
249 | |||||
250 | /* Emit the definition of a C++ multiple inheritance or covariant | ||||
251 | return vtable thunk. If EMIT_P is nonzero, the thunk is emitted | ||||
252 | immediately. */ | ||||
253 | |||||
254 | void | ||||
255 | use_thunk (tree thunk_fndecl, bool emit_p) | ||||
256 | { | ||||
257 | tree a, t, function, alias; | ||||
258 | tree virtual_offset; | ||||
259 | HOST_WIDE_INTlong fixed_offset, virtual_value; | ||||
260 | bool this_adjusting = DECL_THIS_THUNK_P (thunk_fndecl)((((enum tree_code) (thunk_fndecl)->base.code) == FUNCTION_DECL && ((contains_struct_check ((thunk_fndecl), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk_fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk_fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk_fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (thunk_fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__); <->u.fn; })->thunk_p) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk_fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk_fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk_fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (thunk_fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 260, __FUNCTION__); <->u.fn; })->this_thunk_p); | ||||
261 | struct cgraph_node *funcn, *thunk_node; | ||||
262 | |||||
263 | /* We should have called finish_thunk to give it a name. */ | ||||
264 | gcc_assert (DECL_NAME (thunk_fndecl))((void)(!(((contains_struct_check ((thunk_fndecl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 264, __FUNCTION__))->decl_minimal.name)) ? fancy_abort ( "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 264, __FUNCTION__), 0 : 0)); | ||||
265 | |||||
266 | /* We should never be using an alias, always refer to the | ||||
267 | aliased thunk. */ | ||||
268 | gcc_assert (!THUNK_ALIAS (thunk_fndecl))((void)(!(!(((contains_struct_check (((tree_check ((thunk_fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 268, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 268, __FUNCTION__))->decl_common.lang_specific)->u.min .template_info)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 268, __FUNCTION__), 0 : 0)); | ||||
269 | |||||
270 | if (TREE_ASM_WRITTEN (thunk_fndecl)((thunk_fndecl)->base.asm_written_flag)) | ||||
271 | return; | ||||
272 | |||||
273 | function = THUNK_TARGET (thunk_fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (thunk_fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 273, __FUNCTION__, (TEMPLATE_DECL))))))))->result : thunk_fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 273, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (thunk_fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (thunk_fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 273, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((thunk_fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 273, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 273, __FUNCTION__); <->u.fn; })->befriending_classes ); | ||||
274 | if (DECL_RESULT (thunk_fndecl)((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 274, __FUNCTION__, (FUNCTION_DECL)))->decl_non_common.result )) | ||||
275 | /* We already turned this thunk into an ordinary function. | ||||
276 | There's no need to process this thunk again. */ | ||||
277 | return; | ||||
278 | |||||
279 | if (DECL_THUNK_P (function)(((enum tree_code) (function)->base.code) == FUNCTION_DECL && ((contains_struct_check ((function), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 279, __FUNCTION__))->decl_common.lang_specific) && __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (function)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 279, __FUNCTION__, (TEMPLATE_DECL))))))))->result : function )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 279, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (function)->base.code) == FUNCTION_DECL || (((enum tree_code) (function)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 279, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((function ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 279, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 279, __FUNCTION__); <->u.fn; })->thunk_p)) | ||||
280 | /* The target is itself a thunk, process it now. */ | ||||
281 | use_thunk (function, emit_p); | ||||
282 | |||||
283 | /* Thunks are always addressable; they only appear in vtables. */ | ||||
284 | TREE_ADDRESSABLE (thunk_fndecl)((thunk_fndecl)->base.addressable_flag) = 1; | ||||
285 | |||||
286 | /* Figure out what function is being thunked to. It's referenced in | ||||
287 | this translation unit. */ | ||||
288 | TREE_ADDRESSABLE (function)((function)->base.addressable_flag) = 1; | ||||
289 | mark_used (function); | ||||
290 | if (!emit_p) | ||||
291 | return; | ||||
292 | |||||
293 | if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function)1) | ||||
294 | alias = make_alias_for_thunk (function); | ||||
295 | else | ||||
296 | alias = function; | ||||
297 | |||||
298 | fixed_offset = THUNK_FIXED_OFFSET (thunk_fndecl)(((contains_struct_check ((__extension__ ({ __typeof (thunk_fndecl ) const __t = (thunk_fndecl); if (((enum tree_code) (__t)-> base.code) != FUNCTION_DECL || !__t->decl_common.lang_specific || !__t->decl_common.lang_specific->u.fn.thunk_p) tree_check_failed (__t, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 298, __FUNCTION__, 0); __t; })), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 298, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.fixed_offset); | ||||
299 | virtual_offset = THUNK_VIRTUAL_OFFSET (thunk_fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__))->decl_common.lang_specific); if (!(( ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == VAR_DECL || ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FUNCTION_DECL ) || ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == FIELD_DECL || ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONST_DECL || ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TYPE_DECL || ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == TEMPLATE_DECL || ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == USING_DECL || ((enum tree_code) ((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__, (FUNCTION_DECL))))->base.code) == CONCEPT_DECL )) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 299, __FUNCTION__); <->u.min; })->access); | ||||
300 | |||||
301 | if (virtual_offset) | ||||
302 | { | ||||
303 | if (!this_adjusting) | ||||
304 | virtual_offset = BINFO_VPTR_FIELD (virtual_offset)((tree_check ((virtual_offset), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 304, __FUNCTION__, (TREE_BINFO)))->binfo.vptr_field); | ||||
305 | virtual_value = tree_to_shwi (virtual_offset); | ||||
306 | gcc_assert (virtual_value)((void)(!(virtual_value) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 306, __FUNCTION__), 0 : 0)); | ||||
307 | } | ||||
308 | else | ||||
309 | virtual_value = 0; | ||||
310 | |||||
311 | /* And, if we need to emit the thunk, it's used. */ | ||||
312 | mark_used (thunk_fndecl); | ||||
313 | /* This thunk is actually defined. */ | ||||
314 | DECL_EXTERNAL (thunk_fndecl)((contains_struct_check ((thunk_fndecl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 314, __FUNCTION__))->decl_common.decl_flag_1) = 0; | ||||
315 | /* The linkage of the function may have changed. FIXME in linkage | ||||
316 | rewrite. */ | ||||
317 | gcc_assert (DECL_INTERFACE_KNOWN (function))((void)(!(((contains_struct_check ((function), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 317, __FUNCTION__))->decl_common.lang_flag_5)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 317, __FUNCTION__), 0 : 0)); | ||||
318 | TREE_PUBLIC (thunk_fndecl)((thunk_fndecl)->base.public_flag) = TREE_PUBLIC (function)((function)->base.public_flag); | ||||
319 | DECL_VISIBILITY (thunk_fndecl)((contains_struct_check ((thunk_fndecl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 319, __FUNCTION__))->decl_with_vis.visibility) = DECL_VISIBILITY (function)((contains_struct_check ((function), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 319, __FUNCTION__))->decl_with_vis.visibility); | ||||
320 | DECL_VISIBILITY_SPECIFIED (thunk_fndecl)((contains_struct_check ((thunk_fndecl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 320, __FUNCTION__))->decl_with_vis.visibility_specified) | ||||
321 | = DECL_VISIBILITY_SPECIFIED (function)((contains_struct_check ((function), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 321, __FUNCTION__))->decl_with_vis.visibility_specified); | ||||
322 | DECL_COMDAT (thunk_fndecl)((contains_struct_check ((thunk_fndecl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 322, __FUNCTION__))->decl_with_vis.comdat_flag) = DECL_COMDAT (function)((contains_struct_check ((function), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 322, __FUNCTION__))->decl_with_vis.comdat_flag); | ||||
323 | DECL_WEAK (thunk_fndecl)((contains_struct_check ((thunk_fndecl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 323, __FUNCTION__))->decl_with_vis.weak_flag) = DECL_WEAK (function)((contains_struct_check ((function), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 323, __FUNCTION__))->decl_with_vis.weak_flag); | ||||
324 | |||||
325 | if (flag_syntax_onlyglobal_options.x_flag_syntax_only) | ||||
326 | { | ||||
327 | TREE_ASM_WRITTEN (thunk_fndecl)((thunk_fndecl)->base.asm_written_flag) = 1; | ||||
328 | return; | ||||
329 | } | ||||
330 | |||||
331 | push_to_top_level (); | ||||
332 | |||||
333 | if (TARGET_USE_LOCAL_THUNK_ALIAS_P (function)1 | ||||
334 | && targetm_common.have_named_sections) | ||||
335 | { | ||||
336 | tree fn = function; | ||||
337 | struct symtab_node *symbol; | ||||
338 | |||||
339 | if ((symbol = symtab_node::get (function)) | ||||
340 | && symbol->alias) | ||||
341 | { | ||||
342 | if (symbol->analyzed) | ||||
343 | fn = symtab_node::get (function)->ultimate_alias_target ()->decl; | ||||
344 | else | ||||
345 | fn = symtab_node::get (function)->alias_target; | ||||
346 | } | ||||
347 | resolve_unique_section (fn, 0, flag_function_sectionsglobal_options.x_flag_function_sections); | ||||
348 | |||||
349 | if (DECL_SECTION_NAME (fn)decl_section_name (fn) != NULL__null && DECL_ONE_ONLY (fn)(decl_comdat_group (fn) != (tree) __null && (((fn)-> base.public_flag) || ((contains_struct_check ((fn), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 349, __FUNCTION__))->decl_common.decl_flag_1)))) | ||||
350 | { | ||||
351 | resolve_unique_section (thunk_fndecl, 0, flag_function_sectionsglobal_options.x_flag_function_sections); | ||||
352 | |||||
353 | /* Output the thunk into the same section as function. */ | ||||
354 | set_decl_section_name (thunk_fndecl, fn); | ||||
355 | symtab_node::get (thunk_fndecl)->implicit_section | ||||
356 | = symtab_node::get (fn)->implicit_section; | ||||
357 | } | ||||
358 | } | ||||
359 | |||||
360 | /* Set up cloned argument trees for the thunk. */ | ||||
361 | t = NULL_TREE(tree) __null; | ||||
362 | for (a = DECL_ARGUMENTS (function)((tree_check ((function), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 362, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); a; a = DECL_CHAIN (a)(((contains_struct_check (((contains_struct_check ((a), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 362, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 362, __FUNCTION__))->common.chain))) | ||||
363 | { | ||||
364 | tree x = copy_node (a); | ||||
365 | DECL_CHAIN (x)(((contains_struct_check (((contains_struct_check ((x), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 365, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 365, __FUNCTION__))->common.chain)) = t; | ||||
366 | DECL_CONTEXT (x)((contains_struct_check ((x), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 366, __FUNCTION__))->decl_minimal.context) = thunk_fndecl; | ||||
367 | SET_DECL_RTL (x, NULL)set_decl_rtl (x, __null); | ||||
368 | DECL_HAS_VALUE_EXPR_P (x)((tree_check3 ((x), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 368, __FUNCTION__, (VAR_DECL), (PARM_DECL), (RESULT_DECL))) ->decl_common.decl_flag_2) = 0; | ||||
369 | TREE_ADDRESSABLE (x)((x)->base.addressable_flag) = 0; | ||||
370 | t = x; | ||||
371 | } | ||||
372 | a = nreverse (t); | ||||
373 | DECL_ARGUMENTS (thunk_fndecl)((tree_check ((thunk_fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 373, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = a; | ||||
374 | TREE_ASM_WRITTEN (thunk_fndecl)((thunk_fndecl)->base.asm_written_flag) = 1; | ||||
375 | funcn = cgraph_node::get (function); | ||||
376 | gcc_checking_assert (funcn)((void)(!(funcn) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 376, __FUNCTION__), 0 : 0)); | ||||
377 | thunk_node = funcn->create_thunk (thunk_fndecl, function, | ||||
378 | this_adjusting, fixed_offset, virtual_value, | ||||
379 | 0, virtual_offset, alias); | ||||
380 | if (DECL_ONE_ONLY (function)(decl_comdat_group (function) != (tree) __null && ((( function)->base.public_flag) || ((contains_struct_check (( function), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 380, __FUNCTION__))->decl_common.decl_flag_1)))) | ||||
381 | thunk_node->add_to_same_comdat_group (funcn); | ||||
382 | |||||
383 | pop_from_top_level (); | ||||
384 | } | ||||
385 | |||||
386 | /* Code for synthesizing methods which have default semantics defined. */ | ||||
387 | |||||
388 | /* True iff CTYPE has a trivial SFK. */ | ||||
389 | |||||
390 | static bool | ||||
391 | type_has_trivial_fn (tree ctype, special_function_kind sfk) | ||||
392 | { | ||||
393 | switch (sfk) | ||||
394 | { | ||||
395 | case sfk_constructor: | ||||
396 | return !TYPE_HAS_COMPLEX_DFLT (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 396, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt); | ||||
397 | case sfk_copy_constructor: | ||||
398 | return !TYPE_HAS_COMPLEX_COPY_CTOR (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 398, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_ctor); | ||||
399 | case sfk_move_constructor: | ||||
400 | return !TYPE_HAS_COMPLEX_MOVE_CTOR (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 400, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_ctor); | ||||
401 | case sfk_copy_assignment: | ||||
402 | return !TYPE_HAS_COMPLEX_COPY_ASSIGN (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 402, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign); | ||||
403 | case sfk_move_assignment: | ||||
404 | return !TYPE_HAS_COMPLEX_MOVE_ASSIGN (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 404, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign); | ||||
405 | case sfk_destructor: | ||||
406 | case sfk_virtual_destructor: | ||||
407 | return !TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 407, __FUNCTION__))->type_common.lang_flag_4)); | ||||
408 | case sfk_inheriting_constructor: | ||||
409 | case sfk_comparison: | ||||
410 | return false; | ||||
411 | default: | ||||
412 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 412, __FUNCTION__)); | ||||
413 | } | ||||
414 | } | ||||
415 | |||||
416 | /* Note that CTYPE has a non-trivial SFK even though we previously thought | ||||
417 | it was trivial. */ | ||||
418 | |||||
419 | static void | ||||
420 | type_set_nontrivial_flag (tree ctype, special_function_kind sfk) | ||||
421 | { | ||||
422 | switch (sfk) | ||||
423 | { | ||||
424 | case sfk_constructor: | ||||
425 | TYPE_HAS_COMPLEX_DFLT (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 425, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_dflt) = true; | ||||
426 | return; | ||||
427 | case sfk_copy_constructor: | ||||
428 | TYPE_HAS_COMPLEX_COPY_CTOR (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 428, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_ctor) = true; | ||||
429 | return; | ||||
430 | case sfk_move_constructor: | ||||
431 | TYPE_HAS_COMPLEX_MOVE_CTOR (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 431, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_ctor) = true; | ||||
432 | return; | ||||
433 | case sfk_copy_assignment: | ||||
434 | TYPE_HAS_COMPLEX_COPY_ASSIGN (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 434, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_copy_assign) = true; | ||||
435 | return; | ||||
436 | case sfk_move_assignment: | ||||
437 | TYPE_HAS_COMPLEX_MOVE_ASSIGN (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 437, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_complex_move_assign) = true; | ||||
438 | return; | ||||
439 | case sfk_destructor: | ||||
440 | TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 440, __FUNCTION__))->type_common.lang_flag_4)) = true; | ||||
441 | return; | ||||
442 | case sfk_inheriting_constructor: | ||||
443 | default: | ||||
444 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 444, __FUNCTION__)); | ||||
445 | } | ||||
446 | } | ||||
447 | |||||
448 | /* True iff FN is a trivial defaulted member function ([cd]tor, op=). */ | ||||
449 | |||||
450 | bool | ||||
451 | trivial_fn_p (tree fn) | ||||
452 | { | ||||
453 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL) | ||||
454 | return false; | ||||
455 | if (!DECL_DEFAULTED_FN (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 455, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 455, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 455, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 455, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 455, __FUNCTION__); <->u.fn; })->defaulted_p)) | ||||
456 | return false; | ||||
457 | |||||
458 | /* If fn is a clone, get the primary variant. */ | ||||
459 | if (tree prim = DECL_CLONED_FUNCTION (fn)(((contains_struct_check (((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 459, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 459, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)) | ||||
460 | fn = prim; | ||||
461 | return type_has_trivial_fn (DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 461, __FUNCTION__))->decl_minimal.context), special_function_p (fn)); | ||||
462 | } | ||||
463 | |||||
464 | /* PARM is a PARM_DECL for a function which we want to forward to another | ||||
465 | function without changing its value category, a la std::forward. */ | ||||
466 | |||||
467 | tree | ||||
468 | forward_parm (tree parm) | ||||
469 | { | ||||
470 | tree exp = convert_from_reference (parm); | ||||
471 | tree type = TREE_TYPE (parm)((contains_struct_check ((parm), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 471, __FUNCTION__))->typed.type); | ||||
472 | if (DECL_PACK_P (parm)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (parm)->base.code))] == tcc_declaration) && (((enum tree_code) (((contains_struct_check ((parm), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 472, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION || ((enum tree_code) (((contains_struct_check ((parm), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 472, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION ))) | ||||
473 | type = PACK_EXPANSION_PATTERN (type)(((enum tree_code) ((tree_check2 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 473, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION ))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 473, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((type), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 473, __FUNCTION__)))))); | ||||
474 | if (!TYPE_REF_P (type)(((enum tree_code) (type)->base.code) == REFERENCE_TYPE)) | ||||
475 | type = cp_build_reference_type (type, /*rval=*/true); | ||||
476 | warning_sentinel w (warn_useless_castglobal_options.x_warn_useless_cast); | ||||
477 | exp = build_static_cast (input_location, type, exp, | ||||
478 | tf_warning_or_error); | ||||
479 | if (DECL_PACK_P (parm)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (parm)->base.code))] == tcc_declaration) && (((enum tree_code) (((contains_struct_check ((parm), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 479, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION || ((enum tree_code) (((contains_struct_check ((parm), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 479, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION ))) | ||||
480 | exp = make_pack_expansion (exp); | ||||
481 | return exp; | ||||
482 | } | ||||
483 | |||||
484 | /* Strip all inheriting constructors, if any, to return the original | ||||
485 | constructor from a (possibly indirect) base class. */ | ||||
486 | |||||
487 | tree | ||||
488 | strip_inheriting_ctors (tree dfn) | ||||
489 | { | ||||
490 | if (!flag_new_inheriting_ctorsglobal_options.x_flag_new_inheriting_ctors) | ||||
491 | return dfn; | ||||
492 | tree fn = dfn; | ||||
493 | while (tree inh = DECL_INHERITED_CTOR (fn)((((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code ) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 493, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) | ||||
494 | fn = OVL_FIRST (inh)ovl_first (inh); | ||||
495 | |||||
496 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL | ||||
497 | && TREE_CODE (dfn)((enum tree_code) (dfn)->base.code) == FUNCTION_DECL) | ||||
498 | fn = DECL_TEMPLATE_RESULT (fn)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 498, __FUNCTION__, (TEMPLATE_DECL))))))))->result; | ||||
499 | return fn; | ||||
500 | } | ||||
501 | |||||
502 | /* Find the binfo for the base subobject of BINFO being initialized by | ||||
503 | inherited constructor FNDECL (a member of a direct base of BINFO). */ | ||||
504 | |||||
505 | static tree inherited_ctor_binfo (tree, tree); | ||||
506 | static tree | ||||
507 | inherited_ctor_binfo_1 (tree binfo, tree fndecl) | ||||
508 | { | ||||
509 | tree base = DECL_CONTEXT (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 509, __FUNCTION__))->decl_minimal.context); | ||||
510 | tree base_binfo; | ||||
511 | for (int i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 511, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(base_binfo))); i++) | ||||
512 | if (BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 512, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 512, __FUNCTION__))->typed.type) == base) | ||||
513 | return inherited_ctor_binfo (base_binfo, fndecl); | ||||
514 | |||||
515 | gcc_unreachable()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 515, __FUNCTION__)); | ||||
516 | } | ||||
517 | |||||
518 | /* Find the binfo for the base subobject of BINFO being initialized by | ||||
519 | inheriting constructor FNDECL (a member of BINFO), or BINFO if FNDECL is not | ||||
520 | an inheriting constructor. */ | ||||
521 | |||||
522 | static tree | ||||
523 | inherited_ctor_binfo (tree binfo, tree fndecl) | ||||
524 | { | ||||
525 | tree inh = DECL_INHERITED_CTOR (fndecl)((((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code ) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 525, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
526 | if (!inh) | ||||
527 | return binfo; | ||||
528 | |||||
529 | tree results = NULL_TREE(tree) __null; | ||||
530 | for (ovl_iterator iter (inh); iter; ++iter) | ||||
531 | { | ||||
532 | tree one = inherited_ctor_binfo_1 (binfo, *iter); | ||||
533 | if (!results) | ||||
534 | results = one; | ||||
535 | else if (one != results) | ||||
536 | results = tree_cons (NULL_TREE(tree) __null, one, results); | ||||
537 | } | ||||
538 | return results; | ||||
539 | } | ||||
540 | |||||
541 | /* Find the binfo for the base subobject being initialized by inheriting | ||||
542 | constructor FNDECL, or NULL_TREE if FNDECL is not an inheriting | ||||
543 | constructor. */ | ||||
544 | |||||
545 | tree | ||||
546 | inherited_ctor_binfo (tree fndecl) | ||||
547 | { | ||||
548 | if (!DECL_INHERITED_CTOR (fndecl)((((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code ) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 548, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) | ||||
549 | return NULL_TREE(tree) __null; | ||||
550 | tree binfo = TYPE_BINFO (DECL_CONTEXT (fndecl))((tree_check3 ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 550, __FUNCTION__))->decl_minimal.context)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 550, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); | ||||
551 | return inherited_ctor_binfo (binfo, fndecl); | ||||
552 | } | ||||
553 | |||||
554 | |||||
555 | /* True if we should omit all user-declared parameters from a base | ||||
556 | construtor built from complete constructor FN. | ||||
557 | That's when the ctor is inherited from a virtual base. */ | ||||
558 | |||||
559 | bool | ||||
560 | base_ctor_omit_inherited_parms (tree comp_ctor) | ||||
561 | { | ||||
562 | gcc_checking_assert (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (comp_ctor))((void)(!((((contains_struct_check ((comp_ctor), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 562, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER])) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 562, __FUNCTION__), 0 : 0)); | ||||
563 | |||||
564 | if (!flag_new_inheriting_ctorsglobal_options.x_flag_new_inheriting_ctors) | ||||
565 | /* We only optimize away the parameters in the new model. */ | ||||
566 | return false; | ||||
567 | |||||
568 | if (!CLASSTYPE_VBASECLASSES (DECL_CONTEXT (comp_ctor))((((tree_class_check ((((contains_struct_check ((comp_ctor), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 568, __FUNCTION__))->decl_minimal.context)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 568, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases)) | ||||
569 | return false; | ||||
570 | |||||
571 | if (FUNCTION_FIRST_USER_PARMTYPE (comp_ctor)skip_artificial_parms_for ((comp_ctor), ((tree_check2 ((((contains_struct_check ((comp_ctor), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 571, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 571, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)) == void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) | ||||
572 | /* No user-declared parameters to omit. */ | ||||
573 | return false; | ||||
574 | |||||
575 | for (tree binfo = inherited_ctor_binfo (comp_ctor); | ||||
576 | binfo; | ||||
577 | binfo = BINFO_INHERITANCE_CHAIN (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 577, __FUNCTION__, (TREE_BINFO)))->binfo.inheritance)) | ||||
578 | if (BINFO_VIRTUAL_P (binfo)((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 578, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) | ||||
579 | return true; | ||||
580 | |||||
581 | return false; | ||||
582 | } | ||||
583 | |||||
584 | |||||
585 | /* True if we should omit all user-declared parameters from constructor FN, | ||||
586 | because it is a base clone of a ctor inherited from a virtual base. */ | ||||
587 | |||||
588 | bool | ||||
589 | ctor_omit_inherited_parms (tree fn) | ||||
590 | { | ||||
591 | gcc_checking_assert (TREE_CODE (fn) == FUNCTION_DECL)((void)(!(((enum tree_code) (fn)->base.code) == FUNCTION_DECL ) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 591, __FUNCTION__), 0 : 0)); | ||||
592 | |||||
593 | if (!DECL_BASE_CONSTRUCTOR_P (fn)(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 593, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_BASE_CTOR_IDENTIFIER])) | ||||
594 | return false; | ||||
595 | |||||
596 | return base_ctor_omit_inherited_parms (DECL_CLONED_FUNCTION (fn)(((contains_struct_check (((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 596, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 596, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function)); | ||||
597 | } | ||||
598 | |||||
599 | /* True iff constructor(s) INH inherited into BINFO initializes INIT_BINFO. | ||||
600 | This can be true for multiple virtual bases as well as one direct | ||||
601 | non-virtual base. */ | ||||
602 | |||||
603 | static bool | ||||
604 | binfo_inherited_from (tree binfo, tree init_binfo, tree inh) | ||||
605 | { | ||||
606 | /* inh is an OVERLOAD if we inherited the same constructor along | ||||
607 | multiple paths, check all of them. */ | ||||
608 | for (ovl_iterator iter (inh); iter; ++iter) | ||||
609 | { | ||||
610 | tree fn = *iter; | ||||
611 | tree base = DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 611, __FUNCTION__))->decl_minimal.context); | ||||
612 | tree base_binfo = NULL_TREE(tree) __null; | ||||
613 | for (int i = 0; BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 613, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(base_binfo))); i++) | ||||
614 | if (BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 614, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 614, __FUNCTION__))->typed.type) == base) | ||||
615 | break; | ||||
616 | if (base_binfo == init_binfo | ||||
617 | || (flag_new_inheriting_ctorsglobal_options.x_flag_new_inheriting_ctors | ||||
618 | && binfo_inherited_from (base_binfo, init_binfo, | ||||
619 | DECL_INHERITED_CTOR (fn)((((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code ) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)) , (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 619, __FUNCTION__); <->u.fn; })->context : (tree ) __null)))) | ||||
620 | return true; | ||||
621 | } | ||||
622 | return false; | ||||
623 | } | ||||
624 | |||||
625 | /* Subroutine of do_build_copy_constructor: Add a mem-initializer for BINFO | ||||
626 | given the parameter or parameters PARM, possibly inherited constructor | ||||
627 | base INH, or move flag MOVE_P. */ | ||||
628 | |||||
629 | static tree | ||||
630 | add_one_base_init (tree binfo, tree parm, bool move_p, tree inh, | ||||
631 | tree member_init_list) | ||||
632 | { | ||||
633 | tree init; | ||||
634 | if (inh) | ||||
635 | { | ||||
636 | /* An inheriting constructor only has a mem-initializer for | ||||
637 | the base it inherits from. */ | ||||
638 | if (!binfo_inherited_from (TYPE_BINFO (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 638, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), binfo, inh)) | ||||
639 | return member_init_list; | ||||
640 | |||||
641 | tree *p = &init; | ||||
642 | init = NULL_TREE(tree) __null; | ||||
643 | for (; parm; parm = DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 643, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 643, __FUNCTION__))->common.chain))) | ||||
644 | { | ||||
645 | tree exp = forward_parm (parm); | ||||
646 | *p = build_tree_list (NULL_TREE(tree) __null, exp); | ||||
647 | p = &TREE_CHAIN (*p)((contains_struct_check ((*p), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 647, __FUNCTION__))->common.chain); | ||||
648 | } | ||||
649 | } | ||||
650 | else | ||||
651 | { | ||||
652 | init = build_base_path (PLUS_EXPR, parm, binfo, 1, | ||||
653 | tf_warning_or_error); | ||||
654 | if (move_p) | ||||
655 | init = move (init); | ||||
656 | init = build_tree_list (NULL_TREE(tree) __null, init); | ||||
657 | } | ||||
658 | return tree_cons (binfo, init, member_init_list); | ||||
659 | } | ||||
660 | |||||
661 | /* Generate code for default X(X&) or X(X&&) constructor or an inheriting | ||||
662 | constructor. */ | ||||
663 | |||||
664 | static void | ||||
665 | do_build_copy_constructor (tree fndecl) | ||||
666 | { | ||||
667 | tree parm = FUNCTION_FIRST_USER_PARM (fndecl)skip_artificial_parms_for ((fndecl), ((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 667, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )); | ||||
668 | bool move_p = DECL_MOVE_CONSTRUCTOR_P (fndecl)(((tree_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 668, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 668, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) && move_fn_p (fndecl)); | ||||
669 | bool trivial = trivial_fn_p (fndecl); | ||||
670 | tree inh = DECL_INHERITED_CTOR (fndecl)((((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code ) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 670, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
671 | |||||
672 | if (!inh) | ||||
673 | parm = convert_from_reference (parm); | ||||
674 | |||||
675 | if (trivial) | ||||
676 | { | ||||
677 | if (is_empty_class (current_class_typescope_chain->class_type)) | ||||
678 | /* Don't copy the padding byte; it might not have been allocated | ||||
679 | if *this is a base subobject. */; | ||||
680 | else if (tree_int_cst_equal (TYPE_SIZE (current_class_type)((tree_class_check ((scope_chain->class_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 680, __FUNCTION__))->type_common.size), | ||||
681 | CLASSTYPE_SIZE (current_class_type)((tree_class_check ((((((tree_class_check ((scope_chain->class_type ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 681, __FUNCTION__))->type_with_lang_specific.lang_specific ))->as_base)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 681, __FUNCTION__))->type_common.size))) | ||||
682 | { | ||||
683 | tree t = cp_build_init_expr (current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ref : &scope_chain ->x_current_class_ref)), parm); | ||||
684 | finish_expr_stmt (t); | ||||
685 | } | ||||
686 | else | ||||
687 | { | ||||
688 | /* We must only copy the non-tail padding parts. */ | ||||
689 | tree base_size = CLASSTYPE_SIZE_UNIT (current_class_type)((tree_class_check ((((((tree_class_check ((scope_chain->class_type ), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 689, __FUNCTION__))->type_with_lang_specific.lang_specific ))->as_base)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 689, __FUNCTION__))->type_common.size_unit); | ||||
690 | base_size = size_binop (MINUS_EXPR, base_size, size_int (1))size_binop_loc (((location_t) 0), MINUS_EXPR, base_size, size_int_kind (1, stk_sizetype)); | ||||
691 | tree array_type = build_array_type (unsigned_char_type_nodeinteger_types[itk_unsigned_char], | ||||
692 | build_index_type (base_size)); | ||||
693 | tree alias_set = build_int_cst (TREE_TYPE (current_class_ptr)((contains_struct_check (((*((cfun + 0) && ((cfun + 0 )->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain->x_current_class_ptr))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 693, __FUNCTION__))->typed.type), 0); | ||||
694 | tree lhs = build2 (MEM_REF, array_type, | ||||
695 | current_class_ptr(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ptr : &scope_chain ->x_current_class_ptr)), alias_set); | ||||
696 | tree rhs = build2 (MEM_REF, array_type, | ||||
697 | TREE_OPERAND (parm, 0)(*((const_cast<tree*> (tree_operand_check ((parm), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 697, __FUNCTION__))))), alias_set); | ||||
698 | tree t = cp_build_init_expr (lhs, rhs); | ||||
699 | finish_expr_stmt (t); | ||||
700 | } | ||||
701 | } | ||||
702 | else | ||||
703 | { | ||||
704 | tree member_init_list = NULL_TREE(tree) __null; | ||||
705 | int i; | ||||
706 | tree binfo, base_binfo; | ||||
707 | vec<tree, va_gc> *vbases; | ||||
708 | |||||
709 | /* Initialize all the base-classes with the parameter converted | ||||
710 | to their type so that we get their copy constructor and not | ||||
711 | another constructor that takes current_class_type. We must | ||||
712 | deal with the binfo's directly as a direct base might be | ||||
713 | inaccessible due to ambiguity. */ | ||||
714 | for (vbases = CLASSTYPE_VBASECLASSES (current_class_type)((((tree_class_check ((scope_chain->class_type), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 714, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases), i = 0; | ||||
715 | vec_safe_iterate (vbases, i, &binfo); i++) | ||||
716 | { | ||||
717 | member_init_list = add_one_base_init (binfo, parm, move_p, inh, | ||||
718 | member_init_list); | ||||
719 | } | ||||
720 | |||||
721 | for (binfo = TYPE_BINFO (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 721, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), i = 0; | ||||
722 | BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 722, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(base_binfo))); i++) | ||||
723 | { | ||||
724 | if (BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 724, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) | ||||
725 | continue; | ||||
726 | member_init_list = add_one_base_init (base_binfo, parm, move_p, | ||||
727 | inh, member_init_list); | ||||
728 | } | ||||
729 | |||||
730 | if (!inh) | ||||
731 | { | ||||
732 | int cvquals = cp_type_quals (TREE_TYPE (parm)((contains_struct_check ((parm), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 732, __FUNCTION__))->typed.type)); | ||||
733 | |||||
734 | for (tree fields = TYPE_FIELDS (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 734, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | ||||
735 | fields; fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 735, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 735, __FUNCTION__))->common.chain))) | ||||
736 | { | ||||
737 | tree field = fields; | ||||
738 | tree expr_type; | ||||
739 | |||||
740 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL) | ||||
741 | continue; | ||||
742 | |||||
743 | expr_type = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 743, __FUNCTION__))->typed.type); | ||||
744 | if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 744, __FUNCTION__))->decl_minimal.name)) | ||||
745 | { | ||||
746 | if (VFIELD_NAME_P (DECL_NAME (field))(!strncmp (((const char *) (tree_check ((((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 746, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 746, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ), "_vptr.", sizeof("_vptr.")-1))) | ||||
747 | continue; | ||||
748 | } | ||||
749 | else if (ANON_AGGR_TYPE_P (expr_type)((((((enum tree_code) (expr_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (expr_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((expr_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 749, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((expr_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 749, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr) && TYPE_FIELDS (expr_type)((tree_check3 ((expr_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 749, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)) | ||||
750 | /* Just use the field; anonymous types can't have | ||||
751 | nontrivial copy ctors or assignment ops or this | ||||
752 | function would be deleted. */; | ||||
753 | else | ||||
754 | continue; | ||||
755 | |||||
756 | /* Compute the type of "init->field". If the copy-constructor | ||||
757 | parameter is, for example, "const S&", and the type of | ||||
758 | the field is "T", then the type will usually be "const | ||||
759 | T". (There are no cv-qualified variants of reference | ||||
760 | types.) */ | ||||
761 | if (!TYPE_REF_P (expr_type)(((enum tree_code) (expr_type)->base.code) == REFERENCE_TYPE )) | ||||
762 | { | ||||
763 | int quals = cvquals; | ||||
764 | |||||
765 | if (DECL_MUTABLE_P (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 765, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 765, __FUNCTION__))->decl_common.lang_flag_0))) | ||||
766 | quals &= ~TYPE_QUAL_CONST; | ||||
767 | quals |= cp_type_quals (expr_type); | ||||
768 | expr_type = cp_build_qualified_type (expr_type, quals); | ||||
769 | } | ||||
770 | |||||
771 | tree init = build3 (COMPONENT_REF, expr_type, parm, field, NULL_TREE(tree) __null); | ||||
772 | if (move_p && !TYPE_REF_P (expr_type)(((enum tree_code) (expr_type)->base.code) == REFERENCE_TYPE ) | ||||
773 | /* 'move' breaks bit-fields, and has no effect for scalars. */ | ||||
774 | && !scalarish_type_p (expr_type)) | ||||
775 | init = move (init); | ||||
776 | init = build_tree_list (NULL_TREE(tree) __null, init); | ||||
777 | |||||
778 | member_init_list = tree_cons (field, init, member_init_list); | ||||
779 | } | ||||
780 | } | ||||
781 | |||||
782 | finish_mem_initializers (member_init_list); | ||||
783 | } | ||||
784 | } | ||||
785 | |||||
786 | static void | ||||
787 | do_build_copy_assign (tree fndecl) | ||||
788 | { | ||||
789 | tree parm = DECL_CHAIN (DECL_ARGUMENTS (fndecl))(((contains_struct_check (((contains_struct_check ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 789, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 789, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 789, __FUNCTION__))->common.chain)); | ||||
790 | tree compound_stmt; | ||||
791 | bool move_p = move_fn_p (fndecl); | ||||
792 | bool trivial = trivial_fn_p (fndecl); | ||||
793 | int flags = LOOKUP_NORMAL((1 << 0)) | LOOKUP_NONVIRTUAL(1 << 1) | LOOKUP_DEFAULTED(((((((1 << 6) << 1) << 1) << 1) << 1) << 1) << 1); | ||||
794 | |||||
795 | compound_stmt = begin_compound_stmt (0); | ||||
796 | parm = convert_from_reference (parm); | ||||
797 | |||||
798 | if (trivial | ||||
799 | && is_empty_class (current_class_typescope_chain->class_type)) | ||||
800 | /* Don't copy the padding byte; it might not have been allocated | ||||
801 | if *this is a base subobject. */; | ||||
802 | else if (trivial) | ||||
803 | { | ||||
804 | tree t = build2 (MODIFY_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ref : &scope_chain ->x_current_class_ref)), parm); | ||||
805 | finish_expr_stmt (t); | ||||
806 | } | ||||
807 | else | ||||
808 | { | ||||
809 | tree fields; | ||||
810 | int cvquals = cp_type_quals (TREE_TYPE (parm)((contains_struct_check ((parm), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 810, __FUNCTION__))->typed.type)); | ||||
811 | int i; | ||||
812 | tree binfo, base_binfo; | ||||
813 | |||||
814 | /* Assign to each of the direct base classes. */ | ||||
815 | for (binfo = TYPE_BINFO (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 815, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), i = 0; | ||||
816 | BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 816, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(base_binfo))); i++) | ||||
817 | { | ||||
818 | tree converted_parm; | ||||
819 | |||||
820 | /* We must convert PARM directly to the base class | ||||
821 | explicitly since the base class may be ambiguous. */ | ||||
822 | converted_parm = build_base_path (PLUS_EXPR, parm, base_binfo, 1, | ||||
823 | tf_warning_or_error); | ||||
824 | if (move_p) | ||||
825 | converted_parm = move (converted_parm); | ||||
826 | /* Call the base class assignment operator. */ | ||||
827 | releasing_vec parmvec (make_tree_vector_single (converted_parm)); | ||||
828 | finish_expr_stmt | ||||
829 | (build_special_member_call (current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ref : &scope_chain ->x_current_class_ref)), | ||||
830 | assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier), | ||||
831 | &parmvec, | ||||
832 | base_binfo, | ||||
833 | flags, | ||||
834 | tf_warning_or_error)); | ||||
835 | } | ||||
836 | |||||
837 | /* Assign to each of the non-static data members. */ | ||||
838 | for (fields = TYPE_FIELDS (current_class_type)((tree_check3 ((scope_chain->class_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 838, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | ||||
839 | fields; | ||||
840 | fields = DECL_CHAIN (fields)(((contains_struct_check (((contains_struct_check ((fields), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 840, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 840, __FUNCTION__))->common.chain))) | ||||
841 | { | ||||
842 | tree comp = current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ref : &scope_chain ->x_current_class_ref)); | ||||
843 | tree init = parm; | ||||
844 | tree field = fields; | ||||
845 | tree expr_type; | ||||
846 | int quals; | ||||
847 | |||||
848 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL || DECL_ARTIFICIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 848, __FUNCTION__))->decl_common.artificial_flag)) | ||||
849 | continue; | ||||
850 | |||||
851 | expr_type = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 851, __FUNCTION__))->typed.type); | ||||
852 | |||||
853 | if (CP_TYPE_CONST_P (expr_type)((cp_type_quals (expr_type) & TYPE_QUAL_CONST) != 0)) | ||||
854 | { | ||||
855 | error ("non-static const member %q#D, cannot use default " | ||||
856 | "assignment operator", field); | ||||
857 | continue; | ||||
858 | } | ||||
859 | else if (TYPE_REF_P (expr_type)(((enum tree_code) (expr_type)->base.code) == REFERENCE_TYPE )) | ||||
860 | { | ||||
861 | error ("non-static reference member %q#D, cannot use " | ||||
862 | "default assignment operator", field); | ||||
863 | continue; | ||||
864 | } | ||||
865 | |||||
866 | if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 866, __FUNCTION__))->decl_minimal.name)) | ||||
867 | { | ||||
868 | if (VFIELD_NAME_P (DECL_NAME (field))(!strncmp (((const char *) (tree_check ((((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 868, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 868, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ), "_vptr.", sizeof("_vptr.")-1))) | ||||
869 | continue; | ||||
870 | } | ||||
871 | else if (ANON_AGGR_TYPE_P (expr_type)((((((enum tree_code) (expr_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (expr_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((expr_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 871, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((expr_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 871, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr) | ||||
872 | && TYPE_FIELDS (expr_type)((tree_check3 ((expr_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 872, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) != NULL_TREE(tree) __null) | ||||
873 | /* Just use the field; anonymous types can't have | ||||
874 | nontrivial copy ctors or assignment ops or this | ||||
875 | function would be deleted. */; | ||||
876 | else | ||||
877 | continue; | ||||
878 | |||||
879 | comp = build3 (COMPONENT_REF, expr_type, comp, field, NULL_TREE(tree) __null); | ||||
880 | |||||
881 | /* Compute the type of init->field */ | ||||
882 | quals = cvquals; | ||||
883 | if (DECL_MUTABLE_P (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 883, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 883, __FUNCTION__))->decl_common.lang_flag_0))) | ||||
884 | quals &= ~TYPE_QUAL_CONST; | ||||
885 | expr_type = cp_build_qualified_type (expr_type, quals); | ||||
886 | |||||
887 | init = build3 (COMPONENT_REF, expr_type, init, field, NULL_TREE(tree) __null); | ||||
888 | if (move_p && !TYPE_REF_P (expr_type)(((enum tree_code) (expr_type)->base.code) == REFERENCE_TYPE ) | ||||
889 | /* 'move' breaks bit-fields, and has no effect for scalars. */ | ||||
890 | && !scalarish_type_p (expr_type)) | ||||
891 | init = move (init); | ||||
892 | |||||
893 | if (DECL_NAME (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 893, __FUNCTION__))->decl_minimal.name)) | ||||
894 | init = cp_build_modify_expr (input_location, comp, NOP_EXPR, init, | ||||
895 | tf_warning_or_error); | ||||
896 | else | ||||
897 | init = build2 (MODIFY_EXPR, TREE_TYPE (comp)((contains_struct_check ((comp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 897, __FUNCTION__))->typed.type), comp, init); | ||||
898 | finish_expr_stmt (init); | ||||
899 | } | ||||
900 | } | ||||
901 | finish_return_stmt (current_class_ref(*((cfun + 0) && ((cfun + 0)->language) ? &((cfun + 0)->language)->x_current_class_ref : &scope_chain ->x_current_class_ref))); | ||||
902 | finish_compound_stmt (compound_stmt); | ||||
903 | } | ||||
904 | |||||
905 | /* C++20 <compare> comparison category types. */ | ||||
906 | |||||
907 | enum comp_cat_tag | ||||
908 | { | ||||
909 | cc_partial_ordering, | ||||
910 | cc_weak_ordering, | ||||
911 | cc_strong_ordering, | ||||
912 | cc_last | ||||
913 | }; | ||||
914 | |||||
915 | /* Names of the comparison categories and their value members, to be indexed by | ||||
916 | comp_cat_tag enumerators. genericize_spaceship below relies on the ordering | ||||
917 | of the members. */ | ||||
918 | |||||
919 | struct comp_cat_info_t | ||||
920 | { | ||||
921 | const char *name; | ||||
922 | const char *members[4]; | ||||
923 | }; | ||||
924 | static const comp_cat_info_t comp_cat_info[cc_last] | ||||
925 | = { | ||||
926 | { "partial_ordering", { "equivalent", "greater", "less", "unordered" } }, | ||||
927 | { "weak_ordering", { "equivalent", "greater", "less" } }, | ||||
928 | { "strong_ordering", { "equal", "greater", "less" } } | ||||
929 | }; | ||||
930 | |||||
931 | /* A cache of the category types to speed repeated lookups. */ | ||||
932 | |||||
933 | static GTY((deletable)) tree comp_cat_cache[cc_last]; | ||||
934 | |||||
935 | /* Look up one of the result variables in the comparison category type. */ | ||||
936 | |||||
937 | static tree | ||||
938 | lookup_comparison_result (tree type, const char *name_str, | ||||
939 | tsubst_flags_t complain = tf_warning_or_error) | ||||
940 | { | ||||
941 | tree name = get_identifier (name_str)(__builtin_constant_p (name_str) ? get_identifier_with_length ((name_str), strlen (name_str)) : get_identifier (name_str)); | ||||
942 | tree decl = lookup_qualified_name (type, name); | ||||
943 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != VAR_DECL) | ||||
944 | { | ||||
945 | if (complain & tf_error) | ||||
946 | { | ||||
947 | auto_diagnostic_group d; | ||||
948 | if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK] || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_LIST) | ||||
949 | qualified_name_lookup_error (type, name, decl, input_location); | ||||
950 | else | ||||
951 | error ("%qD is not a static data member", decl); | ||||
952 | inform (input_location, "determining value of %qs", "operator<=>"); | ||||
953 | } | ||||
954 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
955 | } | ||||
956 | return decl; | ||||
957 | } | ||||
958 | |||||
959 | /* Look up a <compare> comparison category type in std. */ | ||||
960 | |||||
961 | static tree | ||||
962 | lookup_comparison_category (comp_cat_tag tag, | ||||
963 | tsubst_flags_t complain = tf_warning_or_error) | ||||
964 | { | ||||
965 | if (tree cached = comp_cat_cache[tag]) | ||||
966 | return cached; | ||||
967 | |||||
968 | tree name = get_identifier (comp_cat_info[tag].name)(__builtin_constant_p (comp_cat_info[tag].name) ? get_identifier_with_length ((comp_cat_info[tag].name), strlen (comp_cat_info[tag].name) ) : get_identifier (comp_cat_info[tag].name)); | ||||
969 | tree decl = lookup_qualified_name (std_nodecp_global_trees[CPTI_STD], name); | ||||
970 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) != TYPE_DECL) | ||||
971 | { | ||||
972 | if (complain & tf_error) | ||||
973 | { | ||||
974 | auto_diagnostic_group d; | ||||
975 | if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK] || TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TREE_LIST) | ||||
976 | qualified_name_lookup_error (std_nodecp_global_trees[CPTI_STD], name, decl, input_location); | ||||
977 | else | ||||
978 | error ("%qD is not a type", decl); | ||||
979 | inform (input_location, "forming type of %qs", "operator<=>"); | ||||
980 | } | ||||
981 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
982 | } | ||||
983 | /* Also make sure we can look up the value members now, since we won't | ||||
984 | really use them until genericize time. */ | ||||
985 | tree type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 985, __FUNCTION__))->typed.type); | ||||
986 | for (int i = 0; i < 4; ++i) | ||||
987 | { | ||||
988 | const char *p = comp_cat_info[tag].members[i]; | ||||
989 | if (!p) break; | ||||
990 | if (lookup_comparison_result (type, p, complain) | ||||
991 | == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
992 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
993 | } | ||||
994 | return comp_cat_cache[tag] = type; | ||||
995 | } | ||||
996 | |||||
997 | /* Wrapper that takes the tag rather than the type. */ | ||||
998 | |||||
999 | static tree | ||||
1000 | lookup_comparison_result (comp_cat_tag tag, const char *name_str, | ||||
1001 | tsubst_flags_t complain = tf_warning_or_error) | ||||
1002 | { | ||||
1003 | tree type = lookup_comparison_category (tag, complain); | ||||
1004 | return lookup_comparison_result (type, name_str, complain); | ||||
1005 | } | ||||
1006 | |||||
1007 | /* Wrapper that takes the index into the members array instead of the name. */ | ||||
1008 | |||||
1009 | static tree | ||||
1010 | lookup_comparison_result (comp_cat_tag tag, tree type, int idx) | ||||
1011 | { | ||||
1012 | const char *name_str = comp_cat_info[tag].members[idx]; | ||||
1013 | if (!name_str) | ||||
1014 | return NULL_TREE(tree) __null; | ||||
1015 | return lookup_comparison_result (type, name_str); | ||||
1016 | } | ||||
1017 | |||||
1018 | /* Does TYPE correspond to TAG? */ | ||||
1019 | |||||
1020 | static bool | ||||
1021 | is_cat (tree type, comp_cat_tag tag) | ||||
1022 | { | ||||
1023 | tree name = TYPE_LINKAGE_IDENTIFIER (type)((((tree_class_check ((((tree_class_check ((type), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1023, __FUNCTION__))->type_common.name))); | ||||
1024 | return id_equal (name, comp_cat_info[tag].name); | ||||
1025 | } | ||||
1026 | |||||
1027 | /* Return the comp_cat_tag for TYPE. */ | ||||
1028 | |||||
1029 | static comp_cat_tag | ||||
1030 | cat_tag_for (tree type) | ||||
1031 | { | ||||
1032 | if (!CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1032, __FUNCTION__))->type_common.lang_flag_5)) || !decl_in_std_namespace_p (TYPE_MAIN_DECL (type)((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1032, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1032, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1032, __FUNCTION__))->common.chain))))) | ||||
1033 | return cc_last; | ||||
1034 | for (int i = 0; i < cc_last; ++i) | ||||
1035 | { | ||||
1036 | comp_cat_tag tag = (comp_cat_tag)i; | ||||
1037 | if (is_cat (type, tag)) | ||||
1038 | return tag; | ||||
1039 | } | ||||
1040 | return cc_last; | ||||
1041 | } | ||||
1042 | |||||
1043 | /* Return the comparison category tag of a <=> expression with non-class type | ||||
1044 | OPTYPE. */ | ||||
1045 | |||||
1046 | static comp_cat_tag | ||||
1047 | spaceship_comp_cat (tree optype) | ||||
1048 | { | ||||
1049 | if (INTEGRAL_OR_ENUMERATION_TYPE_P (optype)(((enum tree_code) (optype)->base.code) == ENUMERAL_TYPE || (((enum tree_code) (optype)->base.code) == BOOLEAN_TYPE || ((enum tree_code) (optype)->base.code) == INTEGER_TYPE)) || TYPE_PTROBV_P (optype)((((enum tree_code) (optype)->base.code) == POINTER_TYPE) && !(((enum tree_code) (((contains_struct_check ((optype), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1049, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE || ((enum tree_code) (((contains_struct_check ((optype), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1049, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE ))) | ||||
1050 | return cc_strong_ordering; | ||||
1051 | else if (TREE_CODE (optype)((enum tree_code) (optype)->base.code) == REAL_TYPE) | ||||
1052 | return cc_partial_ordering; | ||||
1053 | |||||
1054 | /* ??? should vector <=> produce a vector of one of the above? */ | ||||
1055 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1055, __FUNCTION__)); | ||||
1056 | } | ||||
1057 | |||||
1058 | /* Return the comparison category type of a <=> expression with non-class type | ||||
1059 | OPTYPE. */ | ||||
1060 | |||||
1061 | tree | ||||
1062 | spaceship_type (tree optype, tsubst_flags_t complain) | ||||
1063 | { | ||||
1064 | comp_cat_tag tag = spaceship_comp_cat (optype); | ||||
1065 | return lookup_comparison_category (tag, complain); | ||||
1066 | } | ||||
1067 | |||||
1068 | /* Turn <=> with type TYPE and operands OP0 and OP1 into GENERIC. | ||||
1069 | This is also used by build_comparison_op for fallback to op< and op== | ||||
1070 | in a defaulted op<=>. */ | ||||
1071 | |||||
1072 | tree | ||||
1073 | genericize_spaceship (location_t loc, tree type, tree op0, tree op1) | ||||
1074 | { | ||||
1075 | /* ??? maybe optimize based on knowledge of representation? */ | ||||
1076 | comp_cat_tag tag = cat_tag_for (type); | ||||
1077 | |||||
1078 | if (tag == cc_last && is_auto (type)) | ||||
1079 | { | ||||
1080 | /* build_comparison_op is checking to see if we want to suggest changing | ||||
1081 | the op<=> return type from auto to a specific comparison category; any | ||||
1082 | category will do for now. */ | ||||
1083 | tag = cc_strong_ordering; | ||||
1084 | type = lookup_comparison_category (tag, tf_none); | ||||
1085 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1086 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
1087 | } | ||||
1088 | |||||
1089 | gcc_checking_assert (tag < cc_last)((void)(!(tag < cc_last) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1089, __FUNCTION__), 0 : 0)); | ||||
1090 | |||||
1091 | tree r; | ||||
1092 | bool scalar = SCALAR_TYPE_P (TREE_TYPE (op0))((((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == OFFSET_TYPE ) || ((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == ENUMERAL_TYPE || ((((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == BOOLEAN_TYPE || ((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == INTEGER_TYPE ) || ((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == REAL_TYPE || ((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == COMPLEX_TYPE ) || (((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == POINTER_TYPE ) || (((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == RECORD_TYPE && (((tree_class_check (((tree_check ((((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__, (RECORD_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->type_common.lang_flag_2))) || (((enum tree_code) (((contains_struct_check ((op0), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1092, __FUNCTION__))->typed.type))->base.code) == NULLPTR_TYPE )); | ||||
1093 | if (scalar) | ||||
1094 | { | ||||
1095 | op0 = save_expr (op0); | ||||
1096 | op1 = save_expr (op1); | ||||
1097 | } | ||||
1098 | |||||
1099 | tree gt = lookup_comparison_result (tag, type, 1); | ||||
1100 | |||||
1101 | int flags = LOOKUP_NORMAL((1 << 0)); | ||||
1102 | tsubst_flags_t complain = tf_none; | ||||
1103 | tree comp; | ||||
1104 | |||||
1105 | if (tag == cc_partial_ordering) | ||||
1106 | { | ||||
1107 | /* op0 == op1 ? equivalent : op0 < op1 ? less : | ||||
1108 | op1 < op0 ? greater : unordered */ | ||||
1109 | tree uo = lookup_comparison_result (tag, type, 3); | ||||
1110 | if (scalar) | ||||
1111 | { | ||||
1112 | /* For scalars use the low level operations; using build_new_op causes | ||||
1113 | trouble with constexpr eval in the middle of genericize (100367). */ | ||||
1114 | comp = fold_build2 (LT_EXPR, boolean_type_node, op1, op0)fold_build2_loc (((location_t) 0), LT_EXPR, global_trees[TI_BOOLEAN_TYPE ], op1, op0 ); | ||||
1115 | r = fold_build3 (COND_EXPR, type, comp, gt, uo)fold_build3_loc (((location_t) 0), COND_EXPR, type, comp, gt, uo ); | ||||
1116 | } | ||||
1117 | else | ||||
1118 | { | ||||
1119 | comp = build_new_op (loc, LT_EXPR, flags, op1, op0, complain); | ||||
1120 | r = build_conditional_expr (loc, comp, gt, uo, complain); | ||||
1121 | } | ||||
1122 | } | ||||
1123 | else | ||||
1124 | /* op0 == op1 ? equal : op0 < op1 ? less : greater */ | ||||
1125 | r = gt; | ||||
1126 | |||||
1127 | tree lt = lookup_comparison_result (tag, type, 2); | ||||
1128 | if (scalar) | ||||
1129 | { | ||||
1130 | comp = fold_build2 (LT_EXPR, boolean_type_node, op0, op1)fold_build2_loc (((location_t) 0), LT_EXPR, global_trees[TI_BOOLEAN_TYPE ], op0, op1 ); | ||||
1131 | r = fold_build3 (COND_EXPR, type, comp, lt, r)fold_build3_loc (((location_t) 0), COND_EXPR, type, comp, lt, r ); | ||||
1132 | } | ||||
1133 | else | ||||
1134 | { | ||||
1135 | comp = build_new_op (loc, LT_EXPR, flags, op0, op1, complain); | ||||
1136 | r = build_conditional_expr (loc, comp, lt, r, complain); | ||||
1137 | } | ||||
1138 | |||||
1139 | tree eq = lookup_comparison_result (tag, type, 0); | ||||
1140 | if (scalar) | ||||
1141 | { | ||||
1142 | comp = fold_build2 (EQ_EXPR, boolean_type_node, op0, op1)fold_build2_loc (((location_t) 0), EQ_EXPR, global_trees[TI_BOOLEAN_TYPE ], op0, op1 ); | ||||
1143 | r = fold_build3 (COND_EXPR, type, comp, eq, r)fold_build3_loc (((location_t) 0), COND_EXPR, type, comp, eq, r ); | ||||
1144 | } | ||||
1145 | else | ||||
1146 | { | ||||
1147 | comp = build_new_op (loc, EQ_EXPR, flags, op0, op1, complain); | ||||
1148 | r = build_conditional_expr (loc, comp, eq, r, complain); | ||||
1149 | } | ||||
1150 | |||||
1151 | return r; | ||||
1152 | } | ||||
1153 | |||||
1154 | /* Check that the signature of a defaulted comparison operator is | ||||
1155 | well-formed. */ | ||||
1156 | |||||
1157 | static bool | ||||
1158 | early_check_defaulted_comparison (tree fn) | ||||
1159 | { | ||||
1160 | location_t loc = DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1160, __FUNCTION__))->decl_minimal.locus); | ||||
1161 | tree ctx; | ||||
1162 | if (DECL_CLASS_SCOPE_P (fn)(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1162, __FUNCTION__))->decl_minimal.context) && ( tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1162, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) | ||||
1163 | ctx = DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1163, __FUNCTION__))->decl_minimal.context); | ||||
1164 | else | ||||
1165 | ctx = DECL_FRIEND_CONTEXT (fn)(((((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && !((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__))->decl_common.virtual_flag) && !((tree_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1165, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
1166 | bool ok = true; | ||||
1167 | |||||
1168 | if (cxx_dialect < cxx20) | ||||
1169 | { | ||||
1170 | error_at (loc, "defaulted %qD only available with %<-std=c++20%> or " | ||||
1171 | "%<-std=gnu++20%>", fn); | ||||
1172 | return false; | ||||
1173 | } | ||||
1174 | |||||
1175 | if (!DECL_OVERLOADED_OPERATOR_IS (fn, SPACESHIP_EXPR)((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1175, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1175, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1175, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1175, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1175, __FUNCTION__); <->u.fn; })->ovl_op_code) == OVL_OP_SPACESHIP_EXPR) | ||||
1176 | && !same_type_p (TREE_TYPE (TREE_TYPE (fn)), boolean_type_node)comptypes ((((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1176, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1176, __FUNCTION__))->typed.type)), (global_trees[TI_BOOLEAN_TYPE ]), 0)) | ||||
1177 | { | ||||
1178 | diagnostic_t kind = DK_UNSPECIFIED; | ||||
1179 | int opt = 0; | ||||
1180 | if (is_auto (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1180, __FUNCTION__))->typed.type))) | ||||
1181 | kind = DK_PEDWARN; | ||||
1182 | else | ||||
1183 | kind = DK_ERROR; | ||||
1184 | emit_diagnostic (kind, loc, opt, | ||||
1185 | "defaulted %qD must return %<bool%>", fn); | ||||
1186 | if (kind == DK_ERROR) | ||||
1187 | ok = false; | ||||
1188 | } | ||||
1189 | |||||
1190 | bool mem = DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1190, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE ); | ||||
1191 | if (mem && type_memfn_quals (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1191, __FUNCTION__))->typed.type)) != TYPE_QUAL_CONST) | ||||
1192 | { | ||||
1193 | error_at (loc, "defaulted %qD must be %<const%>", fn); | ||||
1194 | ok = false; | ||||
1195 | } | ||||
1196 | if (mem && type_memfn_rqual (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1196, __FUNCTION__))->typed.type)) == REF_QUAL_RVALUE) | ||||
1197 | { | ||||
1198 | error_at (loc, "defaulted %qD must not have %<&&%> ref-qualifier", fn); | ||||
1199 | ok = false; | ||||
1200 | } | ||||
1201 | tree parmnode = FUNCTION_FIRST_USER_PARMTYPE (fn)skip_artificial_parms_for ((fn), ((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1201, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1201, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | ||||
1202 | bool saw_byval = false; | ||||
1203 | bool saw_byref = mem; | ||||
1204 | bool saw_bad = false; | ||||
1205 | for (; parmnode != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; parmnode = TREE_CHAIN (parmnode)((contains_struct_check ((parmnode), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1205, __FUNCTION__))->common.chain)) | ||||
1206 | { | ||||
1207 | tree parmtype = TREE_VALUE (parmnode)((tree_check ((parmnode), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1207, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
1208 | if (CLASS_TYPE_P (parmtype)(((((enum tree_code) (parmtype)->base.code)) == RECORD_TYPE || (((enum tree_code) (parmtype)->base.code)) == UNION_TYPE ) && ((tree_class_check ((parmtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1208, __FUNCTION__))->type_common.lang_flag_5))) | ||||
1209 | saw_byval = true; | ||||
1210 | else if (TREE_CODE (parmtype)((enum tree_code) (parmtype)->base.code) == REFERENCE_TYPE | ||||
1211 | && !TYPE_REF_IS_RVALUE (parmtype)((tree_check ((parmtype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1211, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag ) | ||||
1212 | && TYPE_QUALS (TREE_TYPE (parmtype))((int) ((((tree_class_check ((((contains_struct_check ((parmtype ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->base.readonly_flag) * TYPE_QUAL_CONST ) | (((tree_class_check ((((contains_struct_check ((parmtype) , (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->base.volatile_flag) * TYPE_QUAL_VOLATILE ) | (((tree_class_check ((((contains_struct_check ((parmtype) , (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->base.u.bits.atomic_flag) * TYPE_QUAL_ATOMIC ) | (((tree_class_check ((((contains_struct_check ((parmtype) , (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->type_common.restrict_flag) * TYPE_QUAL_RESTRICT ) | (((((tree_class_check ((((contains_struct_check ((parmtype ), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1212, __FUNCTION__))->base.u.bits.address_space) & 0xFF ) << 8)))) == TYPE_QUAL_CONST) | ||||
1213 | { | ||||
1214 | saw_byref = true; | ||||
1215 | parmtype = TREE_TYPE (parmtype)((contains_struct_check ((parmtype), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1215, __FUNCTION__))->typed.type); | ||||
1216 | } | ||||
1217 | else | ||||
1218 | saw_bad = true; | ||||
1219 | |||||
1220 | if (!saw_bad && !ctx) | ||||
1221 | { | ||||
1222 | /* Defaulted outside the class body. */ | ||||
1223 | ctx = TYPE_MAIN_VARIANT (parmtype)((tree_class_check ((parmtype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1223, __FUNCTION__))->type_common.main_variant); | ||||
1224 | if (!is_friend (ctx, fn)) | ||||
1225 | error_at (loc, "defaulted %qD is not a friend of %qT", fn, ctx); | ||||
1226 | } | ||||
1227 | else if (!same_type_ignoring_top_level_qualifiers_p (parmtype, ctx)) | ||||
1228 | saw_bad = true; | ||||
1229 | } | ||||
1230 | |||||
1231 | if (saw_bad || (saw_byval && saw_byref)) | ||||
1232 | { | ||||
1233 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1233, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) | ||||
1234 | error_at (loc, "defaulted member %qD must have parameter type " | ||||
1235 | "%<const %T&%>", fn, ctx); | ||||
1236 | else if (saw_bad) | ||||
1237 | error_at (loc, "defaulted %qD must have parameters of either type " | ||||
1238 | "%<const %T&%> or %qT", fn, ctx, ctx); | ||||
1239 | else | ||||
1240 | error_at (loc, "defaulted %qD must have parameters of either type " | ||||
1241 | "%<const %T&%> or %qT, not both", fn, ctx, ctx); | ||||
1242 | ok = false; | ||||
1243 | } | ||||
1244 | |||||
1245 | /* We still need to deduce deleted/constexpr/noexcept and maybe return. */ | ||||
1246 | DECL_MAYBE_DELETED (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1246, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1246, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1246, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1246, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1246, __FUNCTION__); <->u.fn; })->maybe_deleted ) = ok; | ||||
1247 | |||||
1248 | return ok; | ||||
1249 | } | ||||
1250 | |||||
1251 | /* Subroutine of build_comparison_op. Given the vec of memberwise | ||||
1252 | comparisons COMPS, calculate the overall comparison category for | ||||
1253 | operator<=>. */ | ||||
1254 | |||||
1255 | static tree | ||||
1256 | common_comparison_type (vec<tree> &comps) | ||||
1257 | { | ||||
1258 | tree seen[cc_last] = {}; | ||||
1259 | |||||
1260 | for (unsigned i = 0; i < comps.length(); ++i) | ||||
1261 | { | ||||
1262 | tree comp = comps[i]; | ||||
1263 | if (TREE_CODE (comp)((enum tree_code) (comp)->base.code) == TREE_LIST) | ||||
1264 | comp = TREE_VALUE (comp)((tree_check ((comp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1264, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
1265 | tree ctype = TREE_TYPE (comp)((contains_struct_check ((comp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1265, __FUNCTION__))->typed.type); | ||||
1266 | comp_cat_tag tag = cat_tag_for (ctype); | ||||
1267 | /* build_comparison_op already checked this. */ | ||||
1268 | gcc_checking_assert (tag < cc_last)((void)(!(tag < cc_last) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1268, __FUNCTION__), 0 : 0)); | ||||
1269 | seen[tag] = ctype; | ||||
1270 | } | ||||
1271 | |||||
1272 | /* Otherwise, if at least one T i is std::partial_ordering, U is | ||||
1273 | std::partial_ordering. */ | ||||
1274 | if (tree t = seen[cc_partial_ordering]) return t; | ||||
1275 | |||||
1276 | /* Otherwise, if at least one T i is std::weak_ordering, U is | ||||
1277 | std::weak_ordering. */ | ||||
1278 | if (tree t = seen[cc_weak_ordering]) return t; | ||||
1279 | |||||
1280 | /* Otherwise, U is std::strong_ordering. */ | ||||
1281 | if (tree t = seen[cc_strong_ordering]) return t; | ||||
1282 | return lookup_comparison_category (cc_strong_ordering); | ||||
1283 | } | ||||
1284 | |||||
1285 | /* Data structure for build_comparison_op. */ | ||||
1286 | |||||
1287 | struct comp_info | ||||
1288 | { | ||||
1289 | tree fndecl; | ||||
1290 | location_t loc; | ||||
1291 | tsubst_flags_t complain; | ||||
1292 | tree_code code; | ||||
1293 | comp_cat_tag retcat; | ||||
1294 | bool first_time; | ||||
1295 | bool constexp; | ||||
1296 | bool was_constexp; | ||||
1297 | bool noex; | ||||
1298 | |||||
1299 | comp_info (tree fndecl, tsubst_flags_t complain) | ||||
1300 | : fndecl (fndecl), complain (complain) | ||||
1301 | { | ||||
1302 | loc = DECL_SOURCE_LOCATION (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1302, __FUNCTION__))->decl_minimal.locus); | ||||
1303 | |||||
1304 | first_time = DECL_MAYBE_DELETED (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1304, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1304, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1304, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1304, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1304, __FUNCTION__); <->u.fn; })->maybe_deleted ); | ||||
1305 | DECL_MAYBE_DELETED (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1305, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1305, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1305, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1305, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1305, __FUNCTION__); <->u.fn; })->maybe_deleted ) = false; | ||||
1306 | |||||
1307 | /* Do we want to try to set constexpr? */ | ||||
1308 | was_constexp = DECL_DECLARED_CONSTEXPR_P (fndecl)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1308, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1308, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1308, __FUNCTION__))->decl_common.lang_flag_8); | ||||
1309 | constexp = first_time; | ||||
1310 | if (constexp) | ||||
1311 | /* Set this for var_in_constexpr_fn. */ | ||||
1312 | DECL_DECLARED_CONSTEXPR_P (fndecl)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1312, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1312, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1312, __FUNCTION__))->decl_common.lang_flag_8) = true; | ||||
1313 | |||||
1314 | /* Do we want to try to set noexcept? */ | ||||
1315 | noex = first_time; | ||||
1316 | if (noex) | ||||
1317 | { | ||||
1318 | tree raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fndecl))((tree_class_check (((tree_check2 ((((contains_struct_check ( (fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1318, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1318, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1318, __FUNCTION__))->type_non_common.lang_1); | ||||
1319 | if (raises && !UNEVALUATED_NOEXCEPT_SPEC_P (raises)(((raises) && (((tree_check ((raises), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1319, __FUNCTION__, (TREE_LIST)))->list.purpose)) && (((enum tree_code) (((tree_check ((raises), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1319, __FUNCTION__, (TREE_LIST)))->list.purpose))->base .code) == DEFERRED_NOEXCEPT)) && (((struct tree_deferred_noexcept *)(tree_check ((((tree_check ((raises), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1319, __FUNCTION__, (TREE_LIST)))->list.purpose)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1319, __FUNCTION__, (DEFERRED_NOEXCEPT))))->pattern) == ( tree) __null)) | ||||
1320 | /* There was an explicit exception-specification. */ | ||||
1321 | noex = false; | ||||
1322 | } | ||||
1323 | } | ||||
1324 | |||||
1325 | /* EXPR is an expression built as part of the function body. | ||||
1326 | Adjust the properties appropriately. */ | ||||
1327 | void check (tree expr) | ||||
1328 | { | ||||
1329 | if (expr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1330 | DECL_DELETED_FN (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1330, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1330, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1330, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1330, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1330, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = true; | ||||
1331 | if ((constexp || was_constexp) | ||||
1332 | && !potential_rvalue_constant_expression (expr)) | ||||
1333 | { | ||||
1334 | if (was_constexp) | ||||
1335 | require_potential_rvalue_constant_expression_fncheck (expr); | ||||
1336 | else | ||||
1337 | constexp = false; | ||||
1338 | } | ||||
1339 | if (noex && !expr_noexcept_p (expr, tf_none)) | ||||
1340 | noex = false; | ||||
1341 | } | ||||
1342 | |||||
1343 | ~comp_info () | ||||
1344 | { | ||||
1345 | if (first_time) | ||||
1346 | { | ||||
1347 | DECL_DECLARED_CONSTEXPR_P (fndecl)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1347, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1347, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1347, __FUNCTION__))->decl_common.lang_flag_8) = constexp || was_constexp; | ||||
1348 | tree raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fndecl))((tree_class_check (((tree_check2 ((((contains_struct_check ( (fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1348, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1348, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1348, __FUNCTION__))->type_non_common.lang_1); | ||||
1349 | if (!raises || UNEVALUATED_NOEXCEPT_SPEC_P (raises)(((raises) && (((tree_check ((raises), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1349, __FUNCTION__, (TREE_LIST)))->list.purpose)) && (((enum tree_code) (((tree_check ((raises), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1349, __FUNCTION__, (TREE_LIST)))->list.purpose))->base .code) == DEFERRED_NOEXCEPT)) && (((struct tree_deferred_noexcept *)(tree_check ((((tree_check ((raises), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1349, __FUNCTION__, (TREE_LIST)))->list.purpose)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1349, __FUNCTION__, (DEFERRED_NOEXCEPT))))->pattern) == ( tree) __null)) | ||||
1350 | { | ||||
1351 | raises = noex ? noexcept_true_speccp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC] : noexcept_false_speccp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC]; | ||||
1352 | TREE_TYPE (fndecl)((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1352, __FUNCTION__))->typed.type) = build_exception_variant (TREE_TYPE (fndecl)((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1352, __FUNCTION__))->typed.type), | ||||
1353 | raises); | ||||
1354 | } | ||||
1355 | } | ||||
1356 | } | ||||
1357 | }; | ||||
1358 | |||||
1359 | /* Subroutine of build_comparison_op, to compare a single subobject. */ | ||||
1360 | |||||
1361 | static tree | ||||
1362 | do_one_comp (location_t loc, const comp_info &info, tree sub, tree lhs, tree rhs) | ||||
1363 | { | ||||
1364 | const tree_code code = info.code; | ||||
1365 | const tree fndecl = info.fndecl; | ||||
1366 | const comp_cat_tag retcat = info.retcat; | ||||
1367 | const tsubst_flags_t complain = info.complain; | ||||
1368 | |||||
1369 | tree overload = NULL_TREE(tree) __null; | ||||
1370 | int flags = LOOKUP_NORMAL((1 << 0)) | LOOKUP_NONVIRTUAL(1 << 1) | LOOKUP_DEFAULTED(((((((1 << 6) << 1) << 1) << 1) << 1) << 1) << 1); | ||||
1371 | /* If we have an explicit comparison category return type we can fall back | ||||
1372 | to </=, so don't give an error yet if <=> lookup fails. */ | ||||
1373 | bool tentative = retcat != cc_last; | ||||
1374 | tree comp = build_new_op (loc, code, flags, lhs, rhs, | ||||
1375 | NULL_TREE(tree) __null, NULL_TREE(tree) __null, &overload, | ||||
1376 | tentative ? tf_none : complain); | ||||
1377 | |||||
1378 | if (code != SPACESHIP_EXPR) | ||||
1379 | return comp; | ||||
1380 | |||||
1381 | tree rettype = TREE_TYPE (TREE_TYPE (fndecl))((contains_struct_check ((((contains_struct_check ((fndecl), ( TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1381, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1381, __FUNCTION__))->typed.type); | ||||
1382 | |||||
1383 | if (comp == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1384 | { | ||||
1385 | if (overload == NULL_TREE(tree) __null && (tentative || complain)) | ||||
1386 | { | ||||
1387 | /* No viable <=>, try using op< and op==. */ | ||||
1388 | tree lteq = genericize_spaceship (loc, rettype, lhs, rhs); | ||||
1389 | if (lteq != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1390 | { | ||||
1391 | /* We found usable < and ==. */ | ||||
1392 | if (retcat != cc_last) | ||||
1393 | /* Return type is a comparison category, use them. */ | ||||
1394 | comp = lteq; | ||||
1395 | else if (complain & tf_error) | ||||
1396 | /* Return type is auto, suggest changing it. */ | ||||
1397 | inform (info.loc, "changing the return type from %qs " | ||||
1398 | "to a comparison category type will allow the " | ||||
1399 | "comparison to use %qs and %qs", "auto", | ||||
1400 | "operator<", "operator=="); | ||||
1401 | } | ||||
1402 | else if (tentative && complain) | ||||
1403 | /* No usable < and ==, give an error for op<=>. */ | ||||
1404 | build_new_op (loc, code, flags, lhs, rhs, complain); | ||||
1405 | } | ||||
1406 | if (comp == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1407 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
1408 | } | ||||
1409 | |||||
1410 | if (FNDECL_USED_AUTO (fndecl)((tree_not_check2 (((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1410, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1410, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2) | ||||
1411 | && cat_tag_for (TREE_TYPE (comp)((contains_struct_check ((comp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1411, __FUNCTION__))->typed.type)) == cc_last) | ||||
1412 | { | ||||
1413 | /* The operator function is defined as deleted if ... Ri is not a | ||||
1414 | comparison category type. */ | ||||
1415 | if (complain & tf_error) | ||||
1416 | inform (loc, | ||||
1417 | "three-way comparison of %qD has type %qT, not a " | ||||
1418 | "comparison category type", sub, TREE_TYPE (comp)((contains_struct_check ((comp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1418, __FUNCTION__))->typed.type)); | ||||
1419 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
1420 | } | ||||
1421 | else if (!FNDECL_USED_AUTO (fndecl)((tree_not_check2 (((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1421, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1421, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2) | ||||
1422 | && !can_convert (rettype, TREE_TYPE (comp)((contains_struct_check ((comp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1422, __FUNCTION__))->typed.type), complain)) | ||||
1423 | { | ||||
1424 | if (complain & tf_error) | ||||
1425 | error_at (loc, | ||||
1426 | "three-way comparison of %qD has type %qT, which " | ||||
1427 | "does not convert to %qT", | ||||
1428 | sub, TREE_TYPE (comp)((contains_struct_check ((comp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1428, __FUNCTION__))->typed.type), rettype); | ||||
1429 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
1430 | } | ||||
1431 | |||||
1432 | return comp; | ||||
1433 | } | ||||
1434 | |||||
1435 | /* Build up the definition of a defaulted comparison operator. Unlike other | ||||
1436 | defaulted functions that use synthesized_method_walk to determine whether | ||||
1437 | the function is e.g. deleted, for comparisons we use the same code. We try | ||||
1438 | to use synthesize_method at the earliest opportunity and bail out if the | ||||
1439 | function ends up being deleted. */ | ||||
1440 | |||||
1441 | void | ||||
1442 | build_comparison_op (tree fndecl, bool defining, tsubst_flags_t complain) | ||||
1443 | { | ||||
1444 | comp_info info (fndecl, complain); | ||||
1445 | |||||
1446 | if (!defining && !(complain & tf_error) && !DECL_MAYBE_DELETED (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1446, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1446, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1446, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1446, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1446, __FUNCTION__); <->u.fn; })->maybe_deleted )) | ||||
1447 | return; | ||||
1448 | |||||
1449 | int flags = LOOKUP_NORMAL((1 << 0)); | ||||
1450 | const ovl_op_info_t *op = IDENTIFIER_OVL_OP_INFO (DECL_NAME (fndecl))(&ovl_op_info[((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1450, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1450, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1450, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)][((tree_check ((((contains_struct_check ((fndecl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1450, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1450, __FUNCTION__, (IDENTIFIER_NODE)))->base.u.bits.address_space )]); | ||||
1451 | tree_code code = info.code = op->tree_code; | ||||
1452 | |||||
1453 | tree lhs = DECL_ARGUMENTS (fndecl)((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1453, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); | ||||
1454 | tree rhs = DECL_CHAIN (lhs)(((contains_struct_check (((contains_struct_check ((lhs), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1454, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1454, __FUNCTION__))->common.chain)); | ||||
1455 | if (is_this_parameter (lhs)) | ||||
1456 | lhs = cp_build_fold_indirect_ref (lhs); | ||||
1457 | else | ||||
1458 | lhs = convert_from_reference (lhs); | ||||
1459 | rhs = convert_from_reference (rhs); | ||||
1460 | tree ctype = TYPE_MAIN_VARIANT (TREE_TYPE (lhs))((tree_class_check ((((contains_struct_check ((lhs), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1460, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1460, __FUNCTION__))->type_common.main_variant); | ||||
1461 | gcc_assert (!defining || COMPLETE_TYPE_P (ctype))((void)(!(!defining || (((tree_class_check ((ctype), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1461, __FUNCTION__))->type_common.size) != (tree) __null )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1461, __FUNCTION__), 0 : 0)); | ||||
1462 | |||||
1463 | iloc_sentinel ils (info.loc); | ||||
1464 | |||||
1465 | /* A defaulted comparison operator function for class C is defined as | ||||
1466 | deleted if ... C has variant members. */ | ||||
1467 | if (TREE_CODE (ctype)((enum tree_code) (ctype)->base.code) == UNION_TYPE | ||||
1468 | && next_aggregate_field (TYPE_FIELDS (ctype)((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1468, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values))) | ||||
1469 | { | ||||
1470 | if (complain & tf_error) | ||||
1471 | inform (info.loc, "cannot default compare union %qT", ctype); | ||||
1472 | DECL_DELETED_FN (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1472, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1472, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1472, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1472, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1472, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = true; | ||||
1473 | return; | ||||
1474 | } | ||||
1475 | |||||
1476 | tree compound_stmt = NULL_TREE(tree) __null; | ||||
1477 | if (defining) | ||||
1478 | compound_stmt = begin_compound_stmt (0); | ||||
1479 | else | ||||
1480 | ++cp_unevaluated_operand; | ||||
1481 | |||||
1482 | tree rettype = TREE_TYPE (TREE_TYPE (fndecl))((contains_struct_check ((((contains_struct_check ((fndecl), ( TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1482, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1482, __FUNCTION__))->typed.type); | ||||
1483 | if (code != SPACESHIP_EXPR && is_auto (rettype)) | ||||
1484 | { | ||||
1485 | rettype = boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE]; | ||||
1486 | apply_deduced_return_type (fndecl, rettype); | ||||
1487 | } | ||||
1488 | |||||
1489 | if (code == EQ_EXPR || code == SPACESHIP_EXPR) | ||||
1490 | { | ||||
1491 | comp_cat_tag &retcat = (info.retcat = cc_last); | ||||
1492 | if (code == SPACESHIP_EXPR && !FNDECL_USED_AUTO (fndecl)((tree_not_check2 (((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1492, __FUNCTION__, (FUNCTION_DECL)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1492, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) | ||||
1493 | retcat = cat_tag_for (rettype); | ||||
1494 | |||||
1495 | bool bad = false; | ||||
1496 | auto_vec<tree> comps; | ||||
1497 | |||||
1498 | /* Compare the base subobjects. We handle them this way, rather than in | ||||
1499 | the field loop below, because maybe_instantiate_noexcept might bring | ||||
1500 | us here before we've built the base fields. */ | ||||
1501 | for (tree base_binfo : BINFO_BASE_BINFOS (TYPE_BINFO (ctype))(&(tree_check ((((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1501, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1501, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)) | ||||
1502 | { | ||||
1503 | tree lhs_base | ||||
1504 | = build_base_path (PLUS_EXPR, lhs, base_binfo, 0, complain); | ||||
1505 | tree rhs_base | ||||
1506 | = build_base_path (PLUS_EXPR, rhs, base_binfo, 0, complain); | ||||
1507 | |||||
1508 | location_t loc = DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (ctype))((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1508, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1508, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1508, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1508, __FUNCTION__))->decl_minimal.locus); | ||||
1509 | tree comp = do_one_comp (loc, info, BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1509, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1509, __FUNCTION__))->typed.type), | ||||
1510 | lhs_base, rhs_base); | ||||
1511 | if (comp == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1512 | { | ||||
1513 | bad = true; | ||||
1514 | continue; | ||||
1515 | } | ||||
1516 | |||||
1517 | comps.safe_push (comp); | ||||
1518 | } | ||||
1519 | |||||
1520 | /* Now compare the field subobjects. */ | ||||
1521 | for (tree field = next_aggregate_field (TYPE_FIELDS (ctype)((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1521, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)); | ||||
1522 | field; | ||||
1523 | field = next_aggregate_field (DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1523, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1523, __FUNCTION__))->common.chain)))) | ||||
1524 | { | ||||
1525 | if (DECL_VIRTUAL_P (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1525, __FUNCTION__))->decl_common.virtual_flag) || DECL_FIELD_IS_BASE (field)((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1525, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1525, __FUNCTION__))->decl_common.lang_flag_6)) | ||||
1526 | /* We ignore the vptr, and we already handled bases. */ | ||||
1527 | continue; | ||||
1528 | |||||
1529 | tree expr_type = TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1529, __FUNCTION__))->typed.type); | ||||
1530 | |||||
1531 | location_t field_loc = DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1531, __FUNCTION__))->decl_minimal.locus); | ||||
1532 | |||||
1533 | /* A defaulted comparison operator function for class C is defined as | ||||
1534 | deleted if any non-static data member of C is of reference type or | ||||
1535 | C has variant members. */ | ||||
1536 | if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == REFERENCE_TYPE) | ||||
1537 | { | ||||
1538 | if (complain & tf_error) | ||||
1539 | inform (field_loc, "cannot default compare " | ||||
1540 | "reference member %qD", field); | ||||
1541 | bad = true; | ||||
1542 | continue; | ||||
1543 | } | ||||
1544 | else if (ANON_UNION_TYPE_P (expr_type)(((enum tree_code) (expr_type)->base.code) == UNION_TYPE && ((((((enum tree_code) (expr_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (expr_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((expr_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1544, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((expr_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1544, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr)) | ||||
1545 | && next_aggregate_field (TYPE_FIELDS (expr_type)((tree_check3 ((expr_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1545, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values))) | ||||
1546 | { | ||||
1547 | if (complain & tf_error) | ||||
1548 | inform (field_loc, "cannot default compare " | ||||
1549 | "anonymous union member"); | ||||
1550 | bad = true; | ||||
1551 | continue; | ||||
1552 | } | ||||
1553 | |||||
1554 | tree lhs_mem = build3_loc (field_loc, COMPONENT_REF, expr_type, lhs, | ||||
1555 | field, NULL_TREE(tree) __null); | ||||
1556 | tree rhs_mem = build3_loc (field_loc, COMPONENT_REF, expr_type, rhs, | ||||
1557 | field, NULL_TREE(tree) __null); | ||||
1558 | tree loop_indexes = NULL_TREE(tree) __null; | ||||
1559 | while (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == ARRAY_TYPE) | ||||
1560 | { | ||||
1561 | /* Flexible array member. */ | ||||
1562 | if (TYPE_DOMAIN (expr_type)((tree_check ((expr_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1562, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values ) == NULL_TREE(tree) __null | ||||
1563 | || TYPE_MAX_VALUE (TYPE_DOMAIN (expr_type))((tree_check5 ((((tree_check ((expr_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1563, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1563, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ) == NULL_TREE(tree) __null) | ||||
1564 | { | ||||
1565 | if (complain & tf_error) | ||||
1566 | inform (field_loc, "cannot default compare " | ||||
1567 | "flexible array member"); | ||||
1568 | bad = true; | ||||
1569 | break; | ||||
1570 | } | ||||
1571 | tree maxval = TYPE_MAX_VALUE (TYPE_DOMAIN (expr_type))((tree_check5 ((((tree_check ((expr_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1571, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1571, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ); | ||||
1572 | /* [0] array. No subobjects to compare, just skip it. */ | ||||
1573 | if (integer_all_onesp (maxval)) | ||||
1574 | break; | ||||
1575 | tree idx; | ||||
1576 | /* [1] array, no loop needed, just add [0] ARRAY_REF. | ||||
1577 | Similarly if !defining. */ | ||||
1578 | if (integer_zerop (maxval) || !defining) | ||||
1579 | idx = size_zero_nodeglobal_trees[TI_SIZE_ZERO]; | ||||
1580 | /* Some other array, will need runtime loop. */ | ||||
1581 | else | ||||
1582 | { | ||||
1583 | idx = force_target_expr (sizetypesizetype_tab[(int) stk_sizetype], maxval, complain); | ||||
1584 | loop_indexes = tree_cons (idx, NULL_TREE(tree) __null, loop_indexes); | ||||
1585 | } | ||||
1586 | expr_type = TREE_TYPE (expr_type)((contains_struct_check ((expr_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1586, __FUNCTION__))->typed.type); | ||||
1587 | lhs_mem = build4_loc (field_loc, ARRAY_REF, expr_type, lhs_mem, | ||||
1588 | idx, NULL_TREE(tree) __null, NULL_TREE(tree) __null); | ||||
1589 | rhs_mem = build4_loc (field_loc, ARRAY_REF, expr_type, rhs_mem, | ||||
1590 | idx, NULL_TREE(tree) __null, NULL_TREE(tree) __null); | ||||
1591 | } | ||||
1592 | if (TREE_CODE (expr_type)((enum tree_code) (expr_type)->base.code) == ARRAY_TYPE) | ||||
1593 | continue; | ||||
1594 | |||||
1595 | tree comp = do_one_comp (field_loc, info, field, lhs_mem, rhs_mem); | ||||
1596 | if (comp == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1597 | { | ||||
1598 | bad = true; | ||||
1599 | continue; | ||||
1600 | } | ||||
1601 | |||||
1602 | /* Most of the time, comp is the expression that should be evaluated | ||||
1603 | to compare the two members. If the expression needs to be | ||||
1604 | evaluated more than once in a loop, it will be a TREE_LIST | ||||
1605 | instead, whose TREE_VALUE is the expression for one array element, | ||||
1606 | TREE_PURPOSE is innermost iterator temporary and if the array | ||||
1607 | is multidimensional, TREE_CHAIN will contain another TREE_LIST | ||||
1608 | with second innermost iterator in its TREE_PURPOSE and so on. */ | ||||
1609 | if (loop_indexes) | ||||
1610 | { | ||||
1611 | TREE_VALUE (loop_indexes)((tree_check ((loop_indexes), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1611, __FUNCTION__, (TREE_LIST)))->list.value) = comp; | ||||
1612 | comp = loop_indexes; | ||||
1613 | } | ||||
1614 | comps.safe_push (comp); | ||||
1615 | } | ||||
1616 | if (code == SPACESHIP_EXPR && is_auto (rettype)) | ||||
1617 | { | ||||
1618 | rettype = common_comparison_type (comps); | ||||
1619 | apply_deduced_return_type (fndecl, rettype); | ||||
1620 | } | ||||
1621 | if (bad) | ||||
1622 | { | ||||
1623 | DECL_DELETED_FN (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1623, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1623, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1623, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1623, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1623, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = true; | ||||
1624 | goto out; | ||||
1625 | } | ||||
1626 | for (unsigned i = 0; i < comps.length(); ++i) | ||||
1627 | { | ||||
1628 | tree comp = comps[i]; | ||||
1629 | tree eq, retval = NULL_TREE(tree) __null, if_ = NULL_TREE(tree) __null; | ||||
1630 | tree loop_indexes = NULL_TREE(tree) __null; | ||||
1631 | if (defining) | ||||
1632 | { | ||||
1633 | if (TREE_CODE (comp)((enum tree_code) (comp)->base.code) == TREE_LIST) | ||||
1634 | { | ||||
1635 | loop_indexes = comp; | ||||
1636 | comp = TREE_VALUE (comp)((tree_check ((comp), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1636, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
1637 | loop_indexes = nreverse (loop_indexes); | ||||
1638 | for (tree loop_index = loop_indexes; loop_index; | ||||
1639 | loop_index = TREE_CHAIN (loop_index)((contains_struct_check ((loop_index), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1639, __FUNCTION__))->common.chain)) | ||||
1640 | { | ||||
1641 | tree for_stmt = begin_for_stmt (NULL_TREE(tree) __null, NULL_TREE(tree) __null); | ||||
1642 | tree idx = TREE_PURPOSE (loop_index)((tree_check ((loop_index), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1642, __FUNCTION__, (TREE_LIST)))->list.purpose); | ||||
1643 | tree maxval = TARGET_EXPR_INITIAL (idx)(*(tree_operand_check_code ((idx), (TARGET_EXPR), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1643, __FUNCTION__))); | ||||
1644 | TARGET_EXPR_INITIAL (idx)(*(tree_operand_check_code ((idx), (TARGET_EXPR), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1644, __FUNCTION__))) = size_zero_nodeglobal_trees[TI_SIZE_ZERO]; | ||||
1645 | add_stmt (idx); | ||||
1646 | finish_init_stmt (for_stmt); | ||||
1647 | finish_for_cond (build2 (LE_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], idx, | ||||
1648 | maxval), for_stmt, false, 0); | ||||
1649 | finish_for_expr (cp_build_unary_op (PREINCREMENT_EXPR, | ||||
1650 | TARGET_EXPR_SLOT (idx)(*(tree_operand_check_code ((idx), (TARGET_EXPR), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1650, __FUNCTION__))), | ||||
1651 | false, complain), | ||||
1652 | for_stmt); | ||||
1653 | /* Store in TREE_VALUE the for_stmt tree, so that we can | ||||
1654 | later on call finish_for_stmt on it (in the reverse | ||||
1655 | order). */ | ||||
1656 | TREE_VALUE (loop_index)((tree_check ((loop_index), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1656, __FUNCTION__, (TREE_LIST)))->list.value) = for_stmt; | ||||
1657 | } | ||||
1658 | loop_indexes = nreverse (loop_indexes); | ||||
1659 | } | ||||
1660 | if_ = begin_if_stmt (); | ||||
1661 | } | ||||
1662 | /* Spaceship is specified to use !=, but for the comparison category | ||||
1663 | types, != is equivalent to !(==), so let's use == directly. */ | ||||
1664 | if (code == EQ_EXPR) | ||||
1665 | { | ||||
1666 | /* if (x==y); else return false; */ | ||||
1667 | eq = comp; | ||||
1668 | retval = boolean_false_nodeglobal_trees[TI_BOOLEAN_FALSE]; | ||||
1669 | } | ||||
1670 | else | ||||
1671 | { | ||||
1672 | /* if (auto v = x<=>y, v == 0); else return v; */ | ||||
1673 | if (TREE_CODE (comp)((enum tree_code) (comp)->base.code) == SPACESHIP_EXPR) | ||||
1674 | TREE_TYPE (comp)((contains_struct_check ((comp), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1674, __FUNCTION__))->typed.type) = rettype; | ||||
1675 | else | ||||
1676 | comp = build_static_cast (input_location, rettype, comp, | ||||
1677 | complain); | ||||
1678 | info.check (comp); | ||||
1679 | if (defining) | ||||
1680 | { | ||||
1681 | tree var = create_temporary_var (rettype); | ||||
1682 | pushdecl (var); | ||||
1683 | cp_finish_decl (var, comp, false, NULL_TREE(tree) __null, flags); | ||||
1684 | comp = retval = var; | ||||
1685 | } | ||||
1686 | eq = build_new_op (info.loc, EQ_EXPR, flags, comp, | ||||
1687 | integer_zero_nodeglobal_trees[TI_INTEGER_ZERO], NULL_TREE(tree) __null, NULL_TREE(tree) __null, | ||||
1688 | NULL__null, complain); | ||||
1689 | } | ||||
1690 | tree ceq = contextual_conv_bool (eq, complain); | ||||
1691 | info.check (ceq); | ||||
1692 | if (defining) | ||||
1693 | { | ||||
1694 | finish_if_stmt_cond (ceq, if_); | ||||
1695 | finish_then_clause (if_); | ||||
1696 | begin_else_clause (if_); | ||||
1697 | finish_return_stmt (retval); | ||||
1698 | finish_else_clause (if_); | ||||
1699 | finish_if_stmt (if_); | ||||
1700 | for (tree loop_index = loop_indexes; loop_index; | ||||
1701 | loop_index = TREE_CHAIN (loop_index)((contains_struct_check ((loop_index), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1701, __FUNCTION__))->common.chain)) | ||||
1702 | finish_for_stmt (TREE_VALUE (loop_index)((tree_check ((loop_index), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1702, __FUNCTION__, (TREE_LIST)))->list.value)); | ||||
1703 | } | ||||
1704 | } | ||||
1705 | if (defining) | ||||
1706 | { | ||||
1707 | tree val; | ||||
1708 | if (code == EQ_EXPR) | ||||
1709 | val = boolean_true_nodeglobal_trees[TI_BOOLEAN_TRUE]; | ||||
1710 | else | ||||
1711 | { | ||||
1712 | tree seql = lookup_comparison_result (cc_strong_ordering, | ||||
1713 | "equal", complain); | ||||
1714 | val = build_static_cast (input_location, rettype, seql, | ||||
1715 | complain); | ||||
1716 | } | ||||
1717 | finish_return_stmt (val); | ||||
1718 | } | ||||
1719 | } | ||||
1720 | else if (code == NE_EXPR) | ||||
1721 | { | ||||
1722 | tree comp = build_new_op (info.loc, EQ_EXPR, flags, lhs, rhs, | ||||
1723 | NULL_TREE(tree) __null, NULL_TREE(tree) __null, NULL__null, complain); | ||||
1724 | comp = contextual_conv_bool (comp, complain); | ||||
1725 | info.check (comp); | ||||
1726 | if (defining) | ||||
1727 | { | ||||
1728 | tree neg = build1 (TRUTH_NOT_EXPR, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE], comp); | ||||
1729 | finish_return_stmt (neg); | ||||
1730 | } | ||||
1731 | } | ||||
1732 | else | ||||
1733 | { | ||||
1734 | tree comp = build_new_op (info.loc, SPACESHIP_EXPR, flags, lhs, rhs, | ||||
1735 | NULL_TREE(tree) __null, NULL_TREE(tree) __null, NULL__null, complain); | ||||
1736 | tree comp2 = build_new_op (info.loc, code, flags, comp, integer_zero_nodeglobal_trees[TI_INTEGER_ZERO], | ||||
1737 | NULL_TREE(tree) __null, NULL_TREE(tree) __null, NULL__null, complain); | ||||
1738 | info.check (comp2); | ||||
1739 | if (defining) | ||||
1740 | finish_return_stmt (comp2); | ||||
1741 | } | ||||
1742 | |||||
1743 | out: | ||||
1744 | if (defining) | ||||
1745 | finish_compound_stmt (compound_stmt); | ||||
1746 | else | ||||
1747 | --cp_unevaluated_operand; | ||||
1748 | } | ||||
1749 | |||||
1750 | /* True iff DECL is an implicitly-declared special member function with no real | ||||
1751 | source location, so we can use its DECL_SOURCE_LOCATION to remember where we | ||||
1752 | triggered its synthesis. */ | ||||
1753 | |||||
1754 | bool | ||||
1755 | decl_remember_implicit_trigger_p (tree decl) | ||||
1756 | { | ||||
1757 | if (!DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1757, __FUNCTION__))->decl_common.artificial_flag)) | ||||
1758 | return false; | ||||
1759 | special_function_kind sfk = special_function_p (decl); | ||||
1760 | /* Inherited constructors have the location of their using-declaration, and | ||||
1761 | operator== has the location of the corresponding operator<=>. */ | ||||
1762 | return (sfk != sfk_inheriting_constructor | ||||
1763 | && sfk != sfk_comparison); | ||||
1764 | } | ||||
1765 | |||||
1766 | /* Synthesize FNDECL, a non-static member function. */ | ||||
1767 | |||||
1768 | void | ||||
1769 | synthesize_method (tree fndecl) | ||||
1770 | { | ||||
1771 | bool nested = (current_function_decl != NULL_TREE(tree) __null); | ||||
1772 | tree context = decl_function_context (fndecl); | ||||
1773 | bool need_body = true; | ||||
1774 | tree stmt; | ||||
1775 | location_t save_input_location = input_location; | ||||
1776 | int error_count = errorcount(global_dc)->diagnostic_count[(int) (DK_ERROR)]; | ||||
1777 | int warning_count = warningcount(global_dc)->diagnostic_count[(int) (DK_WARNING)] + werrorcount(global_dc)->diagnostic_count[(int) (DK_WERROR)]; | ||||
1778 | special_function_kind sfk = special_function_p (fndecl); | ||||
1779 | |||||
1780 | /* Reset the source location, we might have been previously | ||||
1781 | deferred, and thus have saved where we were first needed. */ | ||||
1782 | if (decl_remember_implicit_trigger_p (fndecl)) | ||||
1783 | DECL_SOURCE_LOCATION (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1783, __FUNCTION__))->decl_minimal.locus) | ||||
1784 | = DECL_SOURCE_LOCATION (TYPE_NAME (DECL_CONTEXT (fndecl)))((contains_struct_check ((((tree_class_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1784, __FUNCTION__))->decl_minimal.context)), (tcc_type) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1784, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1784, __FUNCTION__))->decl_minimal.locus); | ||||
1785 | |||||
1786 | /* If we've been asked to synthesize a clone, just synthesize the | ||||
1787 | cloned function instead. Doing so will automatically fill in the | ||||
1788 | body for the clone. */ | ||||
1789 | if (DECL_CLONED_FUNCTION_P (fndecl)(((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((fndecl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((fndecl) , (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1789, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) | ||||
1790 | fndecl = DECL_CLONED_FUNCTION (fndecl)(((contains_struct_check (((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1790, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1790, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function); | ||||
1791 | |||||
1792 | /* We may be in the middle of deferred access check. Disable | ||||
1793 | it now. */ | ||||
1794 | push_deferring_access_checks (dk_no_deferred); | ||||
1795 | |||||
1796 | if (! context) | ||||
1797 | push_to_top_level (); | ||||
1798 | else if (nested) | ||||
1799 | push_function_context (); | ||||
1800 | |||||
1801 | input_location = DECL_SOURCE_LOCATION (fndecl)((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1801, __FUNCTION__))->decl_minimal.locus); | ||||
1802 | |||||
1803 | start_preparsed_function (fndecl, NULL_TREE(tree) __null, SF_DEFAULT0 | SF_PRE_PARSED1); | ||||
1804 | stmt = begin_function_body (); | ||||
1805 | |||||
1806 | if (DECL_ASSIGNMENT_OPERATOR_P (fndecl)(((((tree_not_check2 (((tree_check ((((contains_struct_check ( (fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1))) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((fndecl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1806, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) | ||||
1807 | && DECL_OVERLOADED_OPERATOR_IS (fndecl, NOP_EXPR)((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1807, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1807, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1807, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1807, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1807, __FUNCTION__); <->u.fn; })->ovl_op_code) == OVL_OP_NOP_EXPR)) | ||||
1808 | { | ||||
1809 | do_build_copy_assign (fndecl); | ||||
1810 | need_body = false; | ||||
1811 | } | ||||
1812 | else if (DECL_CONSTRUCTOR_P (fndecl)((tree_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1812, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1812, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) | ||||
1813 | { | ||||
1814 | tree arg_chain = FUNCTION_FIRST_USER_PARMTYPE (fndecl)skip_artificial_parms_for ((fndecl), ((tree_check2 ((((contains_struct_check ((fndecl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1814, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1814, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | ||||
1815 | if (arg_chain != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) | ||||
1816 | do_build_copy_constructor (fndecl); | ||||
1817 | else | ||||
1818 | finish_mem_initializers (NULL_TREE(tree) __null); | ||||
1819 | } | ||||
1820 | else if (sfk == sfk_comparison) | ||||
1821 | { | ||||
1822 | /* Pass tf_none so the function is just deleted if there's a problem. */ | ||||
1823 | build_comparison_op (fndecl, true, tf_none); | ||||
1824 | need_body = false; | ||||
1825 | } | ||||
1826 | |||||
1827 | /* If we haven't yet generated the body of the function, just | ||||
1828 | generate an empty compound statement. */ | ||||
1829 | if (need_body) | ||||
1830 | { | ||||
1831 | tree compound_stmt; | ||||
1832 | compound_stmt = begin_compound_stmt (BCS_FN_BODY); | ||||
1833 | finish_compound_stmt (compound_stmt); | ||||
1834 | } | ||||
1835 | |||||
1836 | finish_function_body (stmt); | ||||
1837 | finish_function (/*inline_p=*/false); | ||||
1838 | |||||
1839 | if (!DECL_DELETED_FN (fndecl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1839, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fndecl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1839, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fndecl)->base.code) == FUNCTION_DECL || (((enum tree_code) (fndecl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1839, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fndecl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1839, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1839, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p )) | ||||
1840 | expand_or_defer_fn (fndecl); | ||||
1841 | |||||
1842 | input_location = save_input_location; | ||||
1843 | |||||
1844 | if (! context) | ||||
1845 | pop_from_top_level (); | ||||
1846 | else if (nested) | ||||
1847 | pop_function_context (); | ||||
1848 | |||||
1849 | pop_deferring_access_checks (); | ||||
1850 | |||||
1851 | if (error_count != errorcount(global_dc)->diagnostic_count[(int) (DK_ERROR)] || warning_count != warningcount(global_dc)->diagnostic_count[(int) (DK_WARNING)] + werrorcount(global_dc)->diagnostic_count[(int) (DK_WERROR)]) | ||||
1852 | if (DECL_ARTIFICIAL (fndecl)((contains_struct_check ((fndecl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1852, __FUNCTION__))->decl_common.artificial_flag)) | ||||
1853 | inform (input_location, "synthesized method %qD first required here", | ||||
1854 | fndecl); | ||||
1855 | } | ||||
1856 | |||||
1857 | /* Like synthesize_method, but don't actually synthesize defaulted comparison | ||||
1858 | methods if their class is still incomplete. Just deduce the return | ||||
1859 | type in that case. */ | ||||
1860 | |||||
1861 | void | ||||
1862 | maybe_synthesize_method (tree fndecl) | ||||
1863 | { | ||||
1864 | if (special_function_p (fndecl) == sfk_comparison) | ||||
1865 | { | ||||
1866 | tree lhs = DECL_ARGUMENTS (fndecl)((tree_check ((fndecl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1866, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); | ||||
1867 | if (is_this_parameter (lhs)) | ||||
1868 | lhs = cp_build_fold_indirect_ref (lhs); | ||||
1869 | else | ||||
1870 | lhs = convert_from_reference (lhs); | ||||
1871 | tree ctype = TYPE_MAIN_VARIANT (TREE_TYPE (lhs))((tree_class_check ((((contains_struct_check ((lhs), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1871, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1871, __FUNCTION__))->type_common.main_variant); | ||||
1872 | if (!COMPLETE_TYPE_P (ctype)(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1872, __FUNCTION__))->type_common.size) != (tree) __null )) | ||||
1873 | { | ||||
1874 | push_deferring_access_checks (dk_no_deferred); | ||||
1875 | build_comparison_op (fndecl, false, tf_none); | ||||
1876 | pop_deferring_access_checks (); | ||||
1877 | return; | ||||
1878 | } | ||||
1879 | } | ||||
1880 | return synthesize_method (fndecl); | ||||
1881 | } | ||||
1882 | |||||
1883 | /* Build a reference to type TYPE with cv-quals QUALS, which is an | ||||
1884 | rvalue if RVALUE is true. */ | ||||
1885 | |||||
1886 | static tree | ||||
1887 | build_stub_type (tree type, int quals, bool rvalue) | ||||
1888 | { | ||||
1889 | tree argtype = cp_build_qualified_type (type, quals); | ||||
1890 | return cp_build_reference_type (argtype, rvalue); | ||||
1891 | } | ||||
1892 | |||||
1893 | /* Build a dummy glvalue from dereferencing a dummy reference of type | ||||
1894 | REFTYPE. */ | ||||
1895 | |||||
1896 | tree | ||||
1897 | build_stub_object (tree reftype) | ||||
1898 | { | ||||
1899 | if (!TYPE_REF_P (reftype)(((enum tree_code) (reftype)->base.code) == REFERENCE_TYPE )) | ||||
1900 | reftype = cp_build_reference_type (reftype, /*rval*/true); | ||||
1901 | tree stub = build1 (CONVERT_EXPR, reftype, integer_one_nodeglobal_trees[TI_INTEGER_ONE]); | ||||
1902 | return convert_from_reference (stub); | ||||
1903 | } | ||||
1904 | |||||
1905 | /* Determine which function will be called when looking up NAME in TYPE, | ||||
1906 | called with a single ARGTYPE argument, or no argument if ARGTYPE is | ||||
1907 | null. FLAGS and COMPLAIN are as for build_new_method_call. | ||||
1908 | |||||
1909 | Returns a FUNCTION_DECL if all is well. | ||||
1910 | Returns NULL_TREE if overload resolution failed. | ||||
1911 | Returns error_mark_node if the chosen function cannot be called. */ | ||||
1912 | |||||
1913 | static tree | ||||
1914 | locate_fn_flags (tree type, tree name, tree argtype, int flags, | ||||
1915 | tsubst_flags_t complain) | ||||
1916 | { | ||||
1917 | tree ob, fn, fns, binfo, rval; | ||||
1918 | |||||
1919 | if (TYPE_P (type)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (type)->base.code))] == tcc_type)) | ||||
1920 | binfo = TYPE_BINFO (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1920, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval); | ||||
1921 | else | ||||
1922 | { | ||||
1923 | binfo = type; | ||||
1924 | type = BINFO_TYPE (binfo)((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1924, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1924, __FUNCTION__))->typed.type); | ||||
1925 | } | ||||
1926 | |||||
1927 | ob = build_stub_object (cp_build_reference_type (type, false)); | ||||
1928 | releasing_vec args; | ||||
1929 | if (argtype) | ||||
1930 | { | ||||
1931 | if (TREE_CODE (argtype)((enum tree_code) (argtype)->base.code) == TREE_LIST) | ||||
1932 | { | ||||
1933 | for (tree elt = argtype; elt && elt != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; | ||||
1934 | elt = TREE_CHAIN (elt)((contains_struct_check ((elt), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1934, __FUNCTION__))->common.chain)) | ||||
1935 | { | ||||
1936 | tree type = TREE_VALUE (elt)((tree_check ((elt), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 1936, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
1937 | tree arg = build_stub_object (type); | ||||
1938 | vec_safe_push (args, arg); | ||||
1939 | } | ||||
1940 | } | ||||
1941 | else | ||||
1942 | { | ||||
1943 | tree arg = build_stub_object (argtype); | ||||
1944 | args->quick_push (arg); | ||||
1945 | } | ||||
1946 | } | ||||
1947 | |||||
1948 | fns = lookup_fnfields (binfo, name, 0, complain); | ||||
1949 | rval = build_new_method_call (ob, fns, &args, binfo, flags, &fn, complain); | ||||
1950 | |||||
1951 | if (fn && rval == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1952 | return rval; | ||||
1953 | else | ||||
1954 | return fn; | ||||
1955 | } | ||||
1956 | |||||
1957 | /* Locate the dtor of TYPE. */ | ||||
1958 | |||||
1959 | tree | ||||
1960 | get_dtor (tree type, tsubst_flags_t complain) | ||||
1961 | { | ||||
1962 | tree fn = locate_fn_flags (type, complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER], NULL_TREE(tree) __null, | ||||
1963 | LOOKUP_NORMAL((1 << 0)), complain); | ||||
1964 | if (fn == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1965 | return NULL_TREE(tree) __null; | ||||
1966 | return fn; | ||||
1967 | } | ||||
1968 | |||||
1969 | /* Locate the default ctor of TYPE. */ | ||||
1970 | |||||
1971 | tree | ||||
1972 | locate_ctor (tree type) | ||||
1973 | { | ||||
1974 | tree fn; | ||||
1975 | |||||
1976 | push_deferring_access_checks (dk_no_check); | ||||
1977 | fn = locate_fn_flags (type, complete_ctor_identifiercp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER], NULL_TREE(tree) __null, | ||||
1978 | LOOKUP_SPECULATIVE((((((1 << 6) << 1) << 1) << 1) << 1) << 1), tf_none); | ||||
1979 | pop_deferring_access_checks (); | ||||
1980 | if (fn == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1981 | return NULL_TREE(tree) __null; | ||||
1982 | return fn; | ||||
1983 | } | ||||
1984 | |||||
1985 | /* Likewise, but give any appropriate errors. */ | ||||
1986 | |||||
1987 | tree | ||||
1988 | get_default_ctor (tree type) | ||||
1989 | { | ||||
1990 | tree fn = locate_fn_flags (type, complete_ctor_identifiercp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER], NULL_TREE(tree) __null, | ||||
1991 | LOOKUP_NORMAL((1 << 0)), tf_warning_or_error); | ||||
1992 | if (fn == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
1993 | return NULL_TREE(tree) __null; | ||||
1994 | return fn; | ||||
1995 | } | ||||
1996 | |||||
1997 | /* Locate the copy ctor of TYPE. */ | ||||
1998 | |||||
1999 | tree | ||||
2000 | get_copy_ctor (tree type, tsubst_flags_t complain) | ||||
2001 | { | ||||
2002 | int quals = (TYPE_HAS_CONST_COPY_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2002, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_ctor) | ||||
2003 | ? TYPE_QUAL_CONST : TYPE_UNQUALIFIED); | ||||
2004 | tree argtype = build_stub_type (type, quals, false); | ||||
2005 | tree fn = locate_fn_flags (type, complete_ctor_identifiercp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER], argtype, | ||||
2006 | LOOKUP_NORMAL((1 << 0)), complain); | ||||
2007 | if (fn == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2008 | return NULL_TREE(tree) __null; | ||||
2009 | return fn; | ||||
2010 | } | ||||
2011 | |||||
2012 | /* Locate the copy assignment operator of TYPE. */ | ||||
2013 | |||||
2014 | tree | ||||
2015 | get_copy_assign (tree type) | ||||
2016 | { | ||||
2017 | int quals = (TYPE_HAS_CONST_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2017, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_assign) | ||||
2018 | ? TYPE_QUAL_CONST : TYPE_UNQUALIFIED); | ||||
2019 | tree argtype = build_stub_type (type, quals, false); | ||||
2020 | tree fn = locate_fn_flags (type, assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier), argtype, | ||||
2021 | LOOKUP_NORMAL((1 << 0)), tf_warning_or_error); | ||||
2022 | if (fn == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2023 | return NULL_TREE(tree) __null; | ||||
2024 | return fn; | ||||
2025 | } | ||||
2026 | |||||
2027 | /* walk_tree helper function for is_trivially_xible. If *TP is a call, | ||||
2028 | return it if it calls something other than a trivial special member | ||||
2029 | function. */ | ||||
2030 | |||||
2031 | static tree | ||||
2032 | check_nontriv (tree *tp, int *, void *) | ||||
2033 | { | ||||
2034 | tree fn = cp_get_callee (*tp); | ||||
2035 | if (fn == NULL_TREE(tree) __null) | ||||
2036 | return NULL_TREE(tree) __null; | ||||
2037 | |||||
2038 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == ADDR_EXPR) | ||||
2039 | fn = TREE_OPERAND (fn, 0)(*((const_cast<tree*> (tree_operand_check ((fn), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2039, __FUNCTION__))))); | ||||
2040 | |||||
2041 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) != FUNCTION_DECL | ||||
2042 | || !trivial_fn_p (fn)) | ||||
2043 | return fn; | ||||
2044 | return NULL_TREE(tree) __null; | ||||
2045 | } | ||||
2046 | |||||
2047 | /* Return declval<T>() = declval<U>() treated as an unevaluated operand. */ | ||||
2048 | |||||
2049 | static tree | ||||
2050 | assignable_expr (tree to, tree from) | ||||
2051 | { | ||||
2052 | cp_unevaluated cp_uneval_guard; | ||||
2053 | to = build_stub_object (to); | ||||
2054 | from = build_stub_object (from); | ||||
2055 | tree r = cp_build_modify_expr (input_location, to, NOP_EXPR, from, tf_none); | ||||
2056 | return r; | ||||
2057 | } | ||||
2058 | |||||
2059 | /* The predicate condition for a template specialization | ||||
2060 | is_constructible<T, Args...> shall be satisfied if and only if the | ||||
2061 | following variable definition would be well-formed for some invented | ||||
2062 | variable t: T t(create<Args>()...); | ||||
2063 | |||||
2064 | Return something equivalent in well-formedness and triviality. */ | ||||
2065 | |||||
2066 | static tree | ||||
2067 | constructible_expr (tree to, tree from) | ||||
2068 | { | ||||
2069 | tree expr; | ||||
2070 | cp_unevaluated cp_uneval_guard; | ||||
2071 | if (CLASS_TYPE_P (to)(((((enum tree_code) (to)->base.code)) == RECORD_TYPE || ( ((enum tree_code) (to)->base.code)) == UNION_TYPE) && ((tree_class_check ((to), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2071, __FUNCTION__))->type_common.lang_flag_5))) | ||||
2072 | { | ||||
2073 | tree ctype = to; | ||||
2074 | vec<tree, va_gc> *args = NULL__null; | ||||
2075 | if (!TYPE_REF_P (to)(((enum tree_code) (to)->base.code) == REFERENCE_TYPE)) | ||||
2076 | to = cp_build_reference_type (to, /*rval*/false); | ||||
2077 | tree ob = build_stub_object (to); | ||||
2078 | for (; from; from = TREE_CHAIN (from)((contains_struct_check ((from), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2078, __FUNCTION__))->common.chain)) | ||||
2079 | vec_safe_push (args, build_stub_object (TREE_VALUE (from)((tree_check ((from), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2079, __FUNCTION__, (TREE_LIST)))->list.value))); | ||||
2080 | expr = build_special_member_call (ob, complete_ctor_identifiercp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER], &args, | ||||
2081 | ctype, LOOKUP_NORMAL((1 << 0)), tf_none); | ||||
2082 | if (expr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2083 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2084 | /* The current state of the standard vis-a-vis LWG 2116 is that | ||||
2085 | is_*constructible involves destruction as well. */ | ||||
2086 | if (type_build_dtor_call (ctype)) | ||||
2087 | { | ||||
2088 | tree dtor = build_special_member_call (ob, complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER], | ||||
2089 | NULL__null, ctype, LOOKUP_NORMAL((1 << 0)), | ||||
2090 | tf_none); | ||||
2091 | if (dtor == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2092 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2093 | if (!TYPE_HAS_TRIVIAL_DESTRUCTOR (ctype)(!(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2093, __FUNCTION__))->type_common.lang_flag_4)))) | ||||
2094 | expr = build2 (COMPOUND_EXPR, void_type_nodeglobal_trees[TI_VOID_TYPE], expr, dtor); | ||||
2095 | } | ||||
2096 | } | ||||
2097 | else | ||||
2098 | { | ||||
2099 | if (from
| ||||
2100 | return build_value_init (strip_array_types (to), tf_none); | ||||
2101 | const int len = list_length (from); | ||||
2102 | if (len > 1) | ||||
2103 | { | ||||
2104 | if (cxx_dialect < cxx20) | ||||
2105 | /* Too many initializers. */ | ||||
2106 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2107 | |||||
2108 | /* In C++20 this is well-formed: | ||||
2109 | using T = int[2]; | ||||
2110 | T t(1, 2); | ||||
2111 | which means that std::is_constructible_v<int[2], int, int> | ||||
2112 | should be true. */ | ||||
2113 | vec<constructor_elt, va_gc> *v; | ||||
2114 | vec_alloc (v, len); | ||||
2115 | for (tree t = from; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2115, __FUNCTION__))->common.chain)) | ||||
2116 | { | ||||
2117 | tree stub = build_stub_object (TREE_VALUE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2117, __FUNCTION__, (TREE_LIST)))->list.value)); | ||||
2118 | constructor_elt elt = { NULL_TREE(tree) __null, stub }; | ||||
2119 | v->quick_push (elt); | ||||
| |||||
2120 | } | ||||
2121 | from = build_constructor (init_list_type_nodecp_global_trees[CPTI_INIT_LIST_TYPE], v); | ||||
2122 | CONSTRUCTOR_IS_DIRECT_INIT (from)(((tree_not_check2 (((tree_check ((from), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2122, __FUNCTION__, (CONSTRUCTOR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2122, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) = true; | ||||
2123 | CONSTRUCTOR_IS_PAREN_INIT (from)((tree_check ((from), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2123, __FUNCTION__, (CONSTRUCTOR)))->base.private_flag) = true; | ||||
2124 | } | ||||
2125 | else | ||||
2126 | from = build_stub_object (TREE_VALUE (from)((tree_check ((from), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2126, __FUNCTION__, (TREE_LIST)))->list.value)); | ||||
2127 | expr = perform_direct_initialization_if_possible (to, from, | ||||
2128 | /*cast*/false, | ||||
2129 | tf_none); | ||||
2130 | /* If t(e) didn't work, maybe t{e} will. */ | ||||
2131 | if (expr == NULL_TREE(tree) __null | ||||
2132 | && len == 1 | ||||
2133 | && cxx_dialect >= cxx20) | ||||
2134 | { | ||||
2135 | from = build_constructor_single (init_list_type_nodecp_global_trees[CPTI_INIT_LIST_TYPE], NULL_TREE(tree) __null, | ||||
2136 | from); | ||||
2137 | CONSTRUCTOR_IS_DIRECT_INIT (from)(((tree_not_check2 (((tree_check ((from), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2137, __FUNCTION__, (CONSTRUCTOR)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2137, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) = true; | ||||
2138 | CONSTRUCTOR_IS_PAREN_INIT (from)((tree_check ((from), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2138, __FUNCTION__, (CONSTRUCTOR)))->base.private_flag) = true; | ||||
2139 | expr = perform_direct_initialization_if_possible (to, from, | ||||
2140 | /*cast*/false, | ||||
2141 | tf_none); | ||||
2142 | } | ||||
2143 | } | ||||
2144 | return expr; | ||||
2145 | } | ||||
2146 | |||||
2147 | /* Returns a tree iff TO is assignable (if CODE is MODIFY_EXPR) or | ||||
2148 | constructible (otherwise) from FROM, which is a single type for | ||||
2149 | assignment or a list of types for construction. */ | ||||
2150 | |||||
2151 | static tree | ||||
2152 | is_xible_helper (enum tree_code code, tree to, tree from, bool trivial) | ||||
2153 | { | ||||
2154 | to = complete_type (to); | ||||
2155 | deferring_access_check_sentinel acs (dk_no_deferred); | ||||
2156 | if (VOID_TYPE_P (to)(((enum tree_code) (to)->base.code) == VOID_TYPE) || ABSTRACT_CLASS_TYPE_P (to)((((((enum tree_code) (to)->base.code)) == RECORD_TYPE || ( ((enum tree_code) (to)->base.code)) == UNION_TYPE) && ((tree_class_check ((to), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2156, __FUNCTION__))->type_common.lang_flag_5)) && ((((tree_class_check ((to), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2156, __FUNCTION__))->type_with_lang_specific.lang_specific ))->pure_virtuals)) | ||||
2157 | || (from && FUNC_OR_METHOD_TYPE_P (from)(((enum tree_code) (from)->base.code) == FUNCTION_TYPE || ( (enum tree_code) (from)->base.code) == METHOD_TYPE) | ||||
2158 | && (TYPE_READONLY (from)((tree_class_check ((from), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2158, __FUNCTION__))->base.readonly_flag) || FUNCTION_REF_QUALIFIED (from)((tree_not_check2 (((tree_check2 ((from), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2158, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2158, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_4)))) | ||||
2159 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2160 | tree expr; | ||||
2161 | if (code == MODIFY_EXPR) | ||||
2162 | expr = assignable_expr (to, from); | ||||
2163 | else if (trivial
, 2163, __FUNCTION__))->common.chain) | ||||
2164 | && cxx_dialect < cxx20) | ||||
2165 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; // only 0- and 1-argument ctors can be trivial | ||||
2166 | // before C++20 aggregate paren init | ||||
2167 | else if (TREE_CODE (to)((enum tree_code) (to)->base.code) == ARRAY_TYPE && !TYPE_DOMAIN (to)((tree_check ((to), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2167, __FUNCTION__, (ARRAY_TYPE)))->type_non_common.values )) | ||||
2168 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; // can't construct an array of unknown bound | ||||
2169 | else | ||||
2170 | expr = constructible_expr (to, from); | ||||
2171 | return expr; | ||||
2172 | } | ||||
2173 | |||||
2174 | /* Returns true iff TO is trivially assignable (if CODE is MODIFY_EXPR) or | ||||
2175 | constructible (otherwise) from FROM, which is a single type for | ||||
2176 | assignment or a list of types for construction. */ | ||||
2177 | |||||
2178 | bool | ||||
2179 | is_trivially_xible (enum tree_code code, tree to, tree from) | ||||
2180 | { | ||||
2181 | tree expr = is_xible_helper (code, to, from, /*trivial*/true); | ||||
2182 | if (expr == NULL_TREE(tree) __null || expr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2183 | return false; | ||||
2184 | tree nt = cp_walk_tree_without_duplicates (&expr, check_nontriv, NULL)walk_tree_without_duplicates_1 (&expr, check_nontriv, __null , cp_walk_subtrees); | ||||
2185 | return !nt; | ||||
2186 | } | ||||
2187 | |||||
2188 | /* Returns true iff TO is nothrow assignable (if CODE is MODIFY_EXPR) or | ||||
2189 | constructible (otherwise) from FROM, which is a single type for | ||||
2190 | assignment or a list of types for construction. */ | ||||
2191 | |||||
2192 | bool | ||||
2193 | is_nothrow_xible (enum tree_code code, tree to, tree from) | ||||
2194 | { | ||||
2195 | tree expr = is_xible_helper (code, to, from, /*trivial*/false); | ||||
2196 | if (expr == NULL_TREE(tree) __null || expr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2197 | return false; | ||||
2198 | return expr_noexcept_p (expr, tf_none); | ||||
2199 | } | ||||
2200 | |||||
2201 | /* Returns true iff TO is assignable (if CODE is MODIFY_EXPR) or | ||||
2202 | constructible (otherwise) from FROM, which is a single type for | ||||
2203 | assignment or a list of types for construction. */ | ||||
2204 | |||||
2205 | bool | ||||
2206 | is_xible (enum tree_code code, tree to, tree from) | ||||
2207 | { | ||||
2208 | tree expr = is_xible_helper (code, to, from, /*trivial*/false); | ||||
| |||||
2209 | if (expr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2210 | return false; | ||||
2211 | return !!expr; | ||||
2212 | } | ||||
2213 | |||||
2214 | /* Return true iff conjunction_v<is_reference<T>, is_constructible<T, U>> is | ||||
2215 | true, and the initialization | ||||
2216 | T t(VAL<U>); // DIRECT_INIT_P | ||||
2217 | or | ||||
2218 | T t = VAL<U>; // !DIRECT_INIT_P | ||||
2219 | binds t to a temporary object whose lifetime is extended. | ||||
2220 | VAL<T> is defined in [meta.unary.prop]: | ||||
2221 | -- If T is a reference or function type, VAL<T> is an expression with the | ||||
2222 | same type and value category as declval<T>(). | ||||
2223 | -- Otherwise, VAL<T> is a prvalue that initially has type T. */ | ||||
2224 | |||||
2225 | bool | ||||
2226 | ref_xes_from_temporary (tree to, tree from, bool direct_init_p) | ||||
2227 | { | ||||
2228 | /* Check is_reference<T>. */ | ||||
2229 | if (!TYPE_REF_P (to)(((enum tree_code) (to)->base.code) == REFERENCE_TYPE)) | ||||
2230 | return false; | ||||
2231 | /* We don't check is_constructible<T, U>: if T isn't constructible | ||||
2232 | from U, we won't be able to create a conversion. */ | ||||
2233 | tree val = build_stub_object (from); | ||||
2234 | if (!TYPE_REF_P (from)(((enum tree_code) (from)->base.code) == REFERENCE_TYPE) && TREE_CODE (from)((enum tree_code) (from)->base.code) != FUNCTION_TYPE) | ||||
2235 | val = CLASS_TYPE_P (from)(((((enum tree_code) (from)->base.code)) == RECORD_TYPE || (((enum tree_code) (from)->base.code)) == UNION_TYPE) && ((tree_class_check ((from), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2235, __FUNCTION__))->type_common.lang_flag_5)) ? force_rvalue (val, tf_none) : rvalue (val); | ||||
2236 | return ref_conv_binds_to_temporary (to, val, direct_init_p).is_true (); | ||||
2237 | } | ||||
2238 | |||||
2239 | /* Worker for is_{,nothrow_}convertible. Attempt to perform an implicit | ||||
2240 | conversion from FROM to TO and return the result. */ | ||||
2241 | |||||
2242 | static tree | ||||
2243 | is_convertible_helper (tree from, tree to) | ||||
2244 | { | ||||
2245 | if (VOID_TYPE_P (from)(((enum tree_code) (from)->base.code) == VOID_TYPE) && VOID_TYPE_P (to)(((enum tree_code) (to)->base.code) == VOID_TYPE)) | ||||
2246 | return integer_one_nodeglobal_trees[TI_INTEGER_ONE]; | ||||
2247 | cp_unevaluated u; | ||||
2248 | tree expr = build_stub_object (from); | ||||
2249 | deferring_access_check_sentinel acs (dk_no_deferred); | ||||
2250 | return perform_implicit_conversion (to, expr, tf_none); | ||||
2251 | } | ||||
2252 | |||||
2253 | /* Return true if FROM can be converted to TO using implicit conversions, | ||||
2254 | or both FROM and TO are possibly cv-qualified void. NB: This doesn't | ||||
2255 | implement the "Access checks are performed as if from a context unrelated | ||||
2256 | to either type" restriction. */ | ||||
2257 | |||||
2258 | bool | ||||
2259 | is_convertible (tree from, tree to) | ||||
2260 | { | ||||
2261 | tree expr = is_convertible_helper (from, to); | ||||
2262 | if (expr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2263 | return false; | ||||
2264 | return !!expr; | ||||
2265 | } | ||||
2266 | |||||
2267 | /* Like is_convertible, but the conversion is also noexcept. */ | ||||
2268 | |||||
2269 | bool | ||||
2270 | is_nothrow_convertible (tree from, tree to) | ||||
2271 | { | ||||
2272 | tree expr = is_convertible_helper (from, to); | ||||
2273 | if (expr == NULL_TREE(tree) __null || expr == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2274 | return false; | ||||
2275 | return expr_noexcept_p (expr, tf_none); | ||||
2276 | } | ||||
2277 | |||||
2278 | /* Categorize various special_function_kinds. */ | ||||
2279 | #define SFK_CTOR_P(sfk)((sfk) >= sfk_constructor && (sfk) <= sfk_move_constructor ) \ | ||||
2280 | ((sfk) >= sfk_constructor && (sfk) <= sfk_move_constructor) | ||||
2281 | #define SFK_DTOR_P(sfk)((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor) \ | ||||
2282 | ((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor) | ||||
2283 | #define SFK_ASSIGN_P(sfk)((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment ) \ | ||||
2284 | ((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment) | ||||
2285 | #define SFK_COPY_P(sfk)((sfk) == sfk_copy_constructor || (sfk) == sfk_copy_assignment ) \ | ||||
2286 | ((sfk) == sfk_copy_constructor || (sfk) == sfk_copy_assignment) | ||||
2287 | #define SFK_MOVE_P(sfk)((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment ) \ | ||||
2288 | ((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment) | ||||
2289 | |||||
2290 | /* Subroutine of synthesized_method_walk. Update SPEC_P, TRIVIAL_P and | ||||
2291 | DELETED_P or give an error message MSG with argument ARG. */ | ||||
2292 | |||||
2293 | static void | ||||
2294 | process_subob_fn (tree fn, special_function_kind sfk, tree *spec_p, | ||||
2295 | bool *trivial_p, bool *deleted_p, bool *constexpr_p, | ||||
2296 | bool diag, tree arg, bool dtor_from_ctor = false) | ||||
2297 | { | ||||
2298 | if (!fn || fn == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2299 | { | ||||
2300 | if (deleted_p) | ||||
2301 | *deleted_p = true; | ||||
2302 | return; | ||||
2303 | } | ||||
2304 | |||||
2305 | if (spec_p) | ||||
2306 | { | ||||
2307 | if (!maybe_instantiate_noexcept (fn)) | ||||
2308 | *spec_p = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2309 | else | ||||
2310 | { | ||||
2311 | tree raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn))((tree_class_check (((tree_check2 ((((contains_struct_check ( (fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2311, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2311, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2311, __FUNCTION__))->type_non_common.lang_1); | ||||
2312 | *spec_p = merge_exception_specifiers (*spec_p, raises); | ||||
2313 | } | ||||
2314 | } | ||||
2315 | |||||
2316 | if (!trivial_fn_p (fn) && !dtor_from_ctor) | ||||
2317 | { | ||||
2318 | if (trivial_p) | ||||
2319 | *trivial_p = false; | ||||
2320 | if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == FIELD_DECL | ||||
2321 | && TREE_CODE (DECL_CONTEXT (arg))((enum tree_code) (((contains_struct_check ((arg), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2321, __FUNCTION__))->decl_minimal.context))->base.code ) == UNION_TYPE) | ||||
2322 | { | ||||
2323 | if (deleted_p) | ||||
2324 | *deleted_p = true; | ||||
2325 | if (diag) | ||||
2326 | error ("union member %q+D with non-trivial %qD", arg, fn); | ||||
2327 | } | ||||
2328 | } | ||||
2329 | |||||
2330 | if (constexpr_p && !DECL_DECLARED_CONSTEXPR_P (fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2330, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2330, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2330, __FUNCTION__))->decl_common.lang_flag_8)) | ||||
2331 | { | ||||
2332 | *constexpr_p = false; | ||||
2333 | if (diag) | ||||
2334 | { | ||||
2335 | inform (DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2335, __FUNCTION__))->decl_minimal.locus), | ||||
2336 | SFK_DTOR_P (sfk)((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor) | ||||
2337 | ? G_("defaulted destructor calls non-%<constexpr%> %qD")"defaulted destructor calls non-%<constexpr%> %qD" | ||||
2338 | : G_("defaulted constructor calls non-%<constexpr%> %qD")"defaulted constructor calls non-%<constexpr%> %qD", | ||||
2339 | fn); | ||||
2340 | explain_invalid_constexpr_fn (fn); | ||||
2341 | } | ||||
2342 | } | ||||
2343 | } | ||||
2344 | |||||
2345 | /* Subroutine of synthesized_method_walk to allow recursion into anonymous | ||||
2346 | aggregates. If DTOR_FROM_CTOR is true, we're walking subobject destructors | ||||
2347 | called from a synthesized constructor, in which case we don't consider | ||||
2348 | the triviality of the subobject destructor. */ | ||||
2349 | |||||
2350 | static void | ||||
2351 | walk_field_subobs (tree fields, special_function_kind sfk, tree fnname, | ||||
2352 | int quals, tree *spec_p, bool *trivial_p, | ||||
2353 | bool *deleted_p, bool *constexpr_p, | ||||
2354 | bool diag, int flags, tsubst_flags_t complain, | ||||
2355 | bool dtor_from_ctor) | ||||
2356 | { | ||||
2357 | if (!fields) | ||||
2358 | return; | ||||
2359 | |||||
2360 | tree ctx = DECL_CONTEXT (fields)((contains_struct_check ((fields), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2360, __FUNCTION__))->decl_minimal.context); | ||||
2361 | |||||
2362 | /* CWG2084: A defaulted default ctor for a union with a DMI only initializes | ||||
2363 | that member, so don't check other members. */ | ||||
2364 | enum { unknown, no, yes } | ||||
2365 | only_dmi_mem = (sfk == sfk_constructor && TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) == UNION_TYPE | ||||
2366 | ? unknown : no); | ||||
2367 | |||||
2368 | again: | ||||
2369 | for (tree field = fields; field; field = DECL_CHAIN (field)(((contains_struct_check (((contains_struct_check ((field), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2369, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2369, __FUNCTION__))->common.chain))) | ||||
2370 | { | ||||
2371 | tree mem_type, argtype, rval; | ||||
2372 | |||||
2373 | if (TREE_CODE (field)((enum tree_code) (field)->base.code) != FIELD_DECL | ||||
2374 | || DECL_ARTIFICIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2374, __FUNCTION__))->decl_common.artificial_flag) | ||||
2375 | || DECL_UNNAMED_BIT_FIELD (field)((((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2375, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2375, __FUNCTION__))->decl_common.lang_flag_4) == 1) && !((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2375, __FUNCTION__))->decl_minimal.name))) | ||||
2376 | continue; | ||||
2377 | |||||
2378 | /* Variant members only affect deletedness. In particular, they don't | ||||
2379 | affect the exception-specification of a user-provided destructor, | ||||
2380 | which we're figuring out via get_defaulted_eh_spec. So if we aren't | ||||
2381 | asking if this is deleted, don't even look up the function; we don't | ||||
2382 | want an error about a deleted function we aren't actually calling. */ | ||||
2383 | if (sfk == sfk_destructor && deleted_p == NULL__null | ||||
2384 | && TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) == UNION_TYPE) | ||||
2385 | break; | ||||
2386 | |||||
2387 | if (only_dmi_mem != no) | ||||
2388 | { | ||||
2389 | if (DECL_INITIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2389, __FUNCTION__))->decl_common.initial)) | ||||
2390 | only_dmi_mem = yes; | ||||
2391 | else | ||||
2392 | /* Don't check this until we know there's no DMI. */ | ||||
2393 | continue; | ||||
2394 | } | ||||
2395 | |||||
2396 | mem_type = strip_array_types (TREE_TYPE (field)((contains_struct_check ((field), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2396, __FUNCTION__))->typed.type)); | ||||
2397 | if (SFK_ASSIGN_P (sfk)((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment )) | ||||
2398 | { | ||||
2399 | bool bad = true; | ||||
2400 | if (CP_TYPE_CONST_P (mem_type)((cp_type_quals (mem_type) & TYPE_QUAL_CONST) != 0) && !CLASS_TYPE_P (mem_type)(((((enum tree_code) (mem_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (mem_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((mem_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2400, __FUNCTION__))->type_common.lang_flag_5))) | ||||
2401 | { | ||||
2402 | if (diag) | ||||
2403 | error ("non-static const member %q#D, cannot use default " | ||||
2404 | "assignment operator", field); | ||||
2405 | } | ||||
2406 | else if (TYPE_REF_P (mem_type)(((enum tree_code) (mem_type)->base.code) == REFERENCE_TYPE )) | ||||
2407 | { | ||||
2408 | if (diag) | ||||
2409 | error ("non-static reference member %q#D, cannot use " | ||||
2410 | "default assignment operator", field); | ||||
2411 | } | ||||
2412 | else | ||||
2413 | bad = false; | ||||
2414 | |||||
2415 | if (bad && deleted_p) | ||||
2416 | *deleted_p = true; | ||||
2417 | } | ||||
2418 | else if (sfk == sfk_constructor || sfk == sfk_inheriting_constructor) | ||||
2419 | { | ||||
2420 | bool bad; | ||||
2421 | |||||
2422 | if (DECL_INITIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2422, __FUNCTION__))->decl_common.initial)) | ||||
2423 | { | ||||
2424 | if (diag && DECL_INITIAL (field)((contains_struct_check ((field), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2424, __FUNCTION__))->decl_common.initial) == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2425 | inform (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2425, __FUNCTION__))->decl_minimal.locus), | ||||
2426 | "initializer for %q#D is invalid", field); | ||||
2427 | if (trivial_p) | ||||
2428 | *trivial_p = false; | ||||
2429 | /* Core 1351: If the field has an NSDMI that could throw, the | ||||
2430 | default constructor is noexcept(false). */ | ||||
2431 | if (spec_p) | ||||
2432 | { | ||||
2433 | tree nsdmi = get_nsdmi (field, /*ctor*/false, complain); | ||||
2434 | if (nsdmi == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2435 | *spec_p = error_mark_nodeglobal_trees[TI_ERROR_MARK]; | ||||
2436 | else if (*spec_p != error_mark_nodeglobal_trees[TI_ERROR_MARK] | ||||
2437 | && !expr_noexcept_p (nsdmi, tf_none)) | ||||
2438 | *spec_p = noexcept_false_speccp_global_trees[CPTI_NOEXCEPT_FALSE_SPEC]; | ||||
2439 | } | ||||
2440 | /* Don't do the normal processing. */ | ||||
2441 | continue; | ||||
2442 | } | ||||
2443 | |||||
2444 | bad = false; | ||||
2445 | if (CP_TYPE_CONST_P (mem_type)((cp_type_quals (mem_type) & TYPE_QUAL_CONST) != 0) | ||||
2446 | && default_init_uninitialized_part (mem_type)) | ||||
2447 | { | ||||
2448 | if (diag) | ||||
2449 | { | ||||
2450 | error ("uninitialized const member in %q#T", | ||||
2451 | current_class_typescope_chain->class_type); | ||||
2452 | inform (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2452, __FUNCTION__))->decl_minimal.locus), | ||||
2453 | "%q#D should be initialized", field); | ||||
2454 | } | ||||
2455 | bad = true; | ||||
2456 | } | ||||
2457 | else if (TYPE_REF_P (mem_type)(((enum tree_code) (mem_type)->base.code) == REFERENCE_TYPE )) | ||||
2458 | { | ||||
2459 | if (diag) | ||||
2460 | { | ||||
2461 | error ("uninitialized reference member in %q#T", | ||||
2462 | current_class_typescope_chain->class_type); | ||||
2463 | inform (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2463, __FUNCTION__))->decl_minimal.locus), | ||||
2464 | "%q#D should be initialized", field); | ||||
2465 | } | ||||
2466 | bad = true; | ||||
2467 | } | ||||
2468 | |||||
2469 | if (bad && deleted_p) | ||||
2470 | *deleted_p = true; | ||||
2471 | |||||
2472 | /* Before C++20, for an implicitly-defined default constructor to | ||||
2473 | be constexpr, every member must have a user-provided default | ||||
2474 | constructor or an explicit initializer. */ | ||||
2475 | if (constexpr_p | ||||
2476 | && cxx_dialect < cxx20 | ||||
2477 | && !CLASS_TYPE_P (mem_type)(((((enum tree_code) (mem_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (mem_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((mem_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2477, __FUNCTION__))->type_common.lang_flag_5)) | ||||
2478 | && TREE_CODE (ctx)((enum tree_code) (ctx)->base.code) != UNION_TYPE) | ||||
2479 | { | ||||
2480 | *constexpr_p = false; | ||||
2481 | if (diag) | ||||
2482 | inform (DECL_SOURCE_LOCATION (field)((contains_struct_check ((field), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2482, __FUNCTION__))->decl_minimal.locus), | ||||
2483 | "defaulted default constructor does not " | ||||
2484 | "initialize %q#D", field); | ||||
2485 | } | ||||
2486 | } | ||||
2487 | else if (sfk == sfk_copy_constructor) | ||||
2488 | { | ||||
2489 | /* 12.8p11b5 */ | ||||
2490 | if (TYPE_REF_P (mem_type)(((enum tree_code) (mem_type)->base.code) == REFERENCE_TYPE ) | ||||
2491 | && TYPE_REF_IS_RVALUE (mem_type)((tree_check ((mem_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2491, __FUNCTION__, (REFERENCE_TYPE)))->base.private_flag )) | ||||
2492 | { | ||||
2493 | if (diag) | ||||
2494 | error ("copying non-static data member %q#D of rvalue " | ||||
2495 | "reference type", field); | ||||
2496 | if (deleted_p) | ||||
2497 | *deleted_p = true; | ||||
2498 | } | ||||
2499 | } | ||||
2500 | |||||
2501 | if (!CLASS_TYPE_P (mem_type)(((((enum tree_code) (mem_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (mem_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((mem_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2501, __FUNCTION__))->type_common.lang_flag_5))) | ||||
2502 | continue; | ||||
2503 | |||||
2504 | if (ANON_AGGR_TYPE_P (mem_type)((((((enum tree_code) (mem_type)->base.code)) == RECORD_TYPE || (((enum tree_code) (mem_type)->base.code)) == UNION_TYPE ) && ((tree_class_check ((mem_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2504, __FUNCTION__))->type_common.lang_flag_5)) && (((tree_class_check ((mem_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2504, __FUNCTION__))->type_with_lang_specific.lang_specific ))->anon_aggr)) | ||||
2505 | { | ||||
2506 | walk_field_subobs (TYPE_FIELDS (mem_type)((tree_check3 ((mem_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2506, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values), sfk, fnname, quals, | ||||
2507 | spec_p, trivial_p, deleted_p, constexpr_p, | ||||
2508 | diag, flags, complain, dtor_from_ctor); | ||||
2509 | continue; | ||||
2510 | } | ||||
2511 | |||||
2512 | if (SFK_COPY_P (sfk)((sfk) == sfk_copy_constructor || (sfk) == sfk_copy_assignment ) || SFK_MOVE_P (sfk)((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment )) | ||||
2513 | { | ||||
2514 | int mem_quals = cp_type_quals (mem_type) | quals; | ||||
2515 | if (DECL_MUTABLE_P (field)(((contains_struct_check (((tree_check ((field), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2515, __FUNCTION__, (FIELD_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2515, __FUNCTION__))->decl_common.lang_flag_0))) | ||||
2516 | mem_quals &= ~TYPE_QUAL_CONST; | ||||
2517 | argtype = build_stub_type (mem_type, mem_quals, SFK_MOVE_P (sfk)((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment )); | ||||
2518 | } | ||||
2519 | else | ||||
2520 | argtype = NULL_TREE(tree) __null; | ||||
2521 | |||||
2522 | rval = locate_fn_flags (mem_type, fnname, argtype, flags, complain); | ||||
2523 | |||||
2524 | process_subob_fn (rval, sfk, spec_p, trivial_p, deleted_p, | ||||
2525 | constexpr_p, diag, field, dtor_from_ctor); | ||||
2526 | } | ||||
2527 | |||||
2528 | /* We didn't find a DMI in this union, now check all the members. */ | ||||
2529 | if (only_dmi_mem == unknown) | ||||
2530 | { | ||||
2531 | only_dmi_mem = no; | ||||
2532 | goto again; | ||||
2533 | } | ||||
2534 | } | ||||
2535 | |||||
2536 | /* Base walker helper for synthesized_method_walk. Inspect a direct | ||||
2537 | or virtual base. BINFO is the parent type's binfo. BASE_BINFO is | ||||
2538 | the base binfo of interests. All other parms are as for | ||||
2539 | synthesized_method_walk, or its local vars. */ | ||||
2540 | |||||
2541 | static tree | ||||
2542 | synthesized_method_base_walk (tree binfo, tree base_binfo, | ||||
2543 | special_function_kind sfk, tree fnname, int quals, | ||||
2544 | tree *inheriting_ctor, tree inherited_parms, | ||||
2545 | int flags, bool diag, | ||||
2546 | tree *spec_p, bool *trivial_p, | ||||
2547 | bool *deleted_p, bool *constexpr_p) | ||||
2548 | { | ||||
2549 | bool inherited_binfo = false; | ||||
2550 | tree argtype = NULL_TREE(tree) __null; | ||||
2551 | deferring_kind defer = dk_no_deferred; | ||||
2552 | |||||
2553 | if (SFK_COPY_P (sfk)((sfk) == sfk_copy_constructor || (sfk) == sfk_copy_assignment ) || SFK_MOVE_P (sfk)((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment )) | ||||
2554 | argtype = build_stub_type (BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2554, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2554, __FUNCTION__))->typed.type), quals, SFK_MOVE_P (sfk)((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment )); | ||||
2555 | else if (inheriting_ctor | ||||
2556 | && (inherited_binfo | ||||
2557 | = binfo_inherited_from (binfo, base_binfo, *inheriting_ctor))) | ||||
2558 | { | ||||
2559 | argtype = inherited_parms; | ||||
2560 | /* Don't check access on the inherited constructor. */ | ||||
2561 | if (flag_new_inheriting_ctorsglobal_options.x_flag_new_inheriting_ctors) | ||||
2562 | defer = dk_deferred; | ||||
2563 | } | ||||
2564 | else if (cxx_dialect >= cxx14 && sfk == sfk_virtual_destructor | ||||
2565 | && BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2565, __FUNCTION__, (TREE_BINFO)))->base.static_flag) | ||||
2566 | && ABSTRACT_CLASS_TYPE_P (BINFO_TYPE (binfo))((((((enum tree_code) (((contains_struct_check (((tree_check ( (binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE ) && ((tree_class_check ((((contains_struct_check ((( tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__))->type_common.lang_flag_5)) && ((((tree_class_check ((((contains_struct_check (((tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2566, __FUNCTION__))->type_with_lang_specific.lang_specific ))->pure_virtuals))) | ||||
2567 | /* Don't check access when looking at vbases of abstract class's | ||||
2568 | virtual destructor. */ | ||||
2569 | defer = dk_no_check; | ||||
2570 | |||||
2571 | if (defer != dk_no_deferred) | ||||
2572 | push_deferring_access_checks (defer); | ||||
2573 | tree rval = locate_fn_flags (base_binfo, fnname, argtype, flags, | ||||
2574 | diag ? tf_warning_or_error : tf_none); | ||||
2575 | if (defer != dk_no_deferred) | ||||
2576 | pop_deferring_access_checks (); | ||||
2577 | |||||
2578 | /* Replace an inherited template with the appropriate specialization. */ | ||||
2579 | if (inherited_binfo && rval | ||||
2580 | && DECL_P (*inheriting_ctor)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (*inheriting_ctor)->base.code))] == tcc_declaration) && DECL_P (rval)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (rval)->base.code))] == tcc_declaration) | ||||
2581 | && DECL_CONTEXT (*inheriting_ctor)((contains_struct_check ((*inheriting_ctor), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2581, __FUNCTION__))->decl_minimal.context) == DECL_CONTEXT (rval)((contains_struct_check ((rval), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2581, __FUNCTION__))->decl_minimal.context)) | ||||
2582 | *inheriting_ctor = DECL_CLONED_FUNCTION (rval)(((contains_struct_check (((tree_check ((rval), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2582, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2582, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function); | ||||
2583 | |||||
2584 | process_subob_fn (rval, sfk, spec_p, trivial_p, deleted_p, | ||||
2585 | constexpr_p, diag, BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2585, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2585, __FUNCTION__))->typed.type)); | ||||
2586 | if (SFK_CTOR_P (sfk)((sfk) >= sfk_constructor && (sfk) <= sfk_move_constructor ) | ||||
2587 | && (!BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2587, __FUNCTION__, (TREE_BINFO)))->base.static_flag) | ||||
2588 | || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (BINFO_TYPE (base_binfo))(((tree_class_check ((((contains_struct_check (((tree_check ( (base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2588, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2588, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2588, __FUNCTION__))->type_common.lang_flag_4)))) | ||||
2589 | { | ||||
2590 | /* In a constructor we also need to check the subobject | ||||
2591 | destructors for cleanup of partially constructed objects. */ | ||||
2592 | tree dtor = locate_fn_flags (base_binfo, complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER], | ||||
2593 | NULL_TREE(tree) __null, flags, | ||||
2594 | diag ? tf_warning_or_error : tf_none); | ||||
2595 | /* Note that we don't pass down trivial_p; the subobject | ||||
2596 | destructors don't affect triviality of the constructor. Nor | ||||
2597 | do they affect constexpr-ness (a constant expression doesn't | ||||
2598 | throw) or exception-specification (a throw from one of the | ||||
2599 | dtors would be a double-fault). */ | ||||
2600 | process_subob_fn (dtor, sfk, NULL__null, NULL__null, deleted_p, NULL__null, false, | ||||
2601 | BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2601, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2601, __FUNCTION__))->typed.type), /*dtor_from_ctor*/true); | ||||
2602 | } | ||||
2603 | |||||
2604 | return rval; | ||||
2605 | } | ||||
2606 | |||||
2607 | /* The caller wants to generate an implicit declaration of SFK for | ||||
2608 | CTYPE which is const if relevant and CONST_P is set. If SPEC_P, | ||||
2609 | TRIVIAL_P, DELETED_P or CONSTEXPR_P are non-null, set their | ||||
2610 | referent appropriately. If DIAG is true, we're either being called | ||||
2611 | from maybe_explain_implicit_delete to give errors, or if | ||||
2612 | CONSTEXPR_P is non-null, from explain_invalid_constexpr_fn. */ | ||||
2613 | |||||
2614 | static void | ||||
2615 | synthesized_method_walk (tree ctype, special_function_kind sfk, bool const_p, | ||||
2616 | tree *spec_p, bool *trivial_p, bool *deleted_p, | ||||
2617 | bool *constexpr_p, bool diag, | ||||
2618 | tree *inheriting_ctor, tree inherited_parms) | ||||
2619 | { | ||||
2620 | tree binfo, base_binfo; | ||||
2621 | int i; | ||||
2622 | |||||
2623 | /* SFK must be exactly one category. */ | ||||
2624 | gcc_checking_assert (SFK_DTOR_P(sfk) + SFK_CTOR_P(sfk)((void)(!(((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor ) + ((sfk) >= sfk_constructor && (sfk) <= sfk_move_constructor ) + ((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment ) == 1) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2625, __FUNCTION__), 0 : 0)) | ||||
2625 | + SFK_ASSIGN_P(sfk) == 1)((void)(!(((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor ) + ((sfk) >= sfk_constructor && (sfk) <= sfk_move_constructor ) + ((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment ) == 1) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2625, __FUNCTION__), 0 : 0)); | ||||
2626 | |||||
2627 | if (spec_p) | ||||
2628 | *spec_p = (cxx_dialect >= cxx11 ? noexcept_true_speccp_global_trees[CPTI_NOEXCEPT_TRUE_SPEC] : empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]); | ||||
2629 | |||||
2630 | if (deleted_p) | ||||
2631 | { | ||||
2632 | /* "The closure type associated with a lambda-expression has a deleted | ||||
2633 | default constructor and a deleted copy assignment operator." | ||||
2634 | This is diagnosed in maybe_explain_implicit_delete. | ||||
2635 | In C++20, only lambda-expressions with lambda-captures have those | ||||
2636 | deleted. */ | ||||
2637 | if (LAMBDA_TYPE_P (ctype)(((enum tree_code) (ctype)->base.code) == RECORD_TYPE && ((((tree_class_check ((((tree_class_check ((ctype), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((ctype), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2637, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag )) | ||||
2638 | && (sfk == sfk_constructor || sfk == sfk_copy_assignment) | ||||
2639 | && (cxx_dialect < cxx20 | ||||
2640 | || LAMBDA_EXPR_CAPTURE_LIST (CLASSTYPE_LAMBDA_EXPR (ctype))(((struct tree_lambda_expr *)(tree_check ((((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2640, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2640, __FUNCTION__, (LAMBDA_EXPR))))->capture_list) | ||||
2641 | || LAMBDA_EXPR_DEFAULT_CAPTURE_MODE(((struct tree_lambda_expr *)(tree_check ((((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2642, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2642, __FUNCTION__, (LAMBDA_EXPR))))->default_capture_mode ) | ||||
2642 | (CLASSTYPE_LAMBDA_EXPR (ctype))(((struct tree_lambda_expr *)(tree_check ((((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2642, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2642, __FUNCTION__, (LAMBDA_EXPR))))->default_capture_mode ) != CPLD_NONE)) | ||||
2643 | { | ||||
2644 | *deleted_p = true; | ||||
2645 | return; | ||||
2646 | } | ||||
2647 | |||||
2648 | *deleted_p = false; | ||||
2649 | } | ||||
2650 | |||||
2651 | bool check_vdtor = false; | ||||
2652 | tree fnname; | ||||
2653 | |||||
2654 | if (SFK_DTOR_P (sfk)((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor)) | ||||
2655 | { | ||||
2656 | check_vdtor = true; | ||||
2657 | /* The synthesized method will call base dtors, but check complete | ||||
2658 | here to avoid having to deal with VTT. */ | ||||
2659 | fnname = complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER]; | ||||
2660 | } | ||||
2661 | else if (SFK_ASSIGN_P (sfk)((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment )) | ||||
2662 | fnname = assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier); | ||||
2663 | else | ||||
2664 | fnname = complete_ctor_identifiercp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER]; | ||||
2665 | |||||
2666 | gcc_assert ((sfk == sfk_inheriting_constructor)((void)(!((sfk == sfk_inheriting_constructor) == (inheriting_ctor && *inheriting_ctor != (tree) __null)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2667, __FUNCTION__), 0 : 0)) | ||||
2667 | == (inheriting_ctor && *inheriting_ctor != NULL_TREE))((void)(!((sfk == sfk_inheriting_constructor) == (inheriting_ctor && *inheriting_ctor != (tree) __null)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2667, __FUNCTION__), 0 : 0)); | ||||
2668 | |||||
2669 | /* If that user-written default constructor would satisfy the | ||||
2670 | requirements of a constexpr constructor (7.1.5), the | ||||
2671 | implicitly-defined default constructor is constexpr. | ||||
2672 | |||||
2673 | C++20: | ||||
2674 | The implicitly-defined copy/move assignment operator is constexpr if | ||||
2675 | - X is a literal type, and | ||||
2676 | - the assignment operator selected to copy/move each direct base class | ||||
2677 | subobject is a constexpr function, and | ||||
2678 | - for each non-static data member of X that is of class type (or array | ||||
2679 | thereof), the assignment operator selected to copy/move that | ||||
2680 | member is a constexpr function. | ||||
2681 | |||||
2682 | C++23: | ||||
2683 | The implicitly-defined copy/move assignment operator is constexpr. */ | ||||
2684 | if (constexpr_p) | ||||
2685 | *constexpr_p = (SFK_CTOR_P (sfk)((sfk) >= sfk_constructor && (sfk) <= sfk_move_constructor ) | ||||
2686 | || (SFK_ASSIGN_P (sfk)((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment ) && cxx_dialect >= cxx14) | ||||
2687 | || (SFK_DTOR_P (sfk)((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor) && cxx_dialect >= cxx20)); | ||||
2688 | |||||
2689 | bool expected_trivial = type_has_trivial_fn (ctype, sfk); | ||||
2690 | if (trivial_p) | ||||
2691 | *trivial_p = expected_trivial; | ||||
2692 | |||||
2693 | /* The TYPE_HAS_COMPLEX_* flags tell us about constraints from base | ||||
2694 | class versions and other properties of the type. But a subobject | ||||
2695 | class can be trivially copyable and yet have overload resolution | ||||
2696 | choose a template constructor for initialization, depending on | ||||
2697 | rvalueness and cv-quals. And furthermore, a member in a base might | ||||
2698 | be trivial but deleted or otherwise not callable. So we can't exit | ||||
2699 | early in C++0x. The same considerations apply in C++98/03, but | ||||
2700 | there the definition of triviality does not consider overload | ||||
2701 | resolution, so a constructor can be trivial even if it would otherwise | ||||
2702 | call a non-trivial constructor. */ | ||||
2703 | if (expected_trivial | ||||
2704 | && (!(SFK_COPY_P (sfk)((sfk) == sfk_copy_constructor || (sfk) == sfk_copy_assignment ) || SFK_MOVE_P (sfk)((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment )) || cxx_dialect < cxx11)) | ||||
2705 | { | ||||
2706 | if (constexpr_p && sfk == sfk_constructor) | ||||
2707 | { | ||||
2708 | bool cx = trivial_default_constructor_is_constexpr (ctype); | ||||
2709 | *constexpr_p = cx; | ||||
2710 | if (diag && !cx && TREE_CODE (ctype)((enum tree_code) (ctype)->base.code) == UNION_TYPE) | ||||
2711 | /* A trivial constructor doesn't have any NSDMI. */ | ||||
2712 | inform (input_location, "defaulted default constructor does " | ||||
2713 | "not initialize any non-static data member"); | ||||
2714 | } | ||||
2715 | if (!diag && cxx_dialect < cxx11) | ||||
2716 | return; | ||||
2717 | } | ||||
2718 | |||||
2719 | ++cp_unevaluated_operand; | ||||
2720 | ++c_inhibit_evaluation_warnings; | ||||
2721 | push_deferring_access_checks (dk_no_deferred); | ||||
2722 | |||||
2723 | tree scope = push_scope (ctype); | ||||
2724 | |||||
2725 | int flags = LOOKUP_NORMAL((1 << 0)) | LOOKUP_SPECULATIVE((((((1 << 6) << 1) << 1) << 1) << 1) << 1); | ||||
2726 | if (sfk != sfk_inheriting_constructor) | ||||
2727 | flags |= LOOKUP_DEFAULTED(((((((1 << 6) << 1) << 1) << 1) << 1) << 1) << 1); | ||||
2728 | |||||
2729 | tsubst_flags_t complain = diag ? tf_warning_or_error : tf_none; | ||||
2730 | if (diag && spec_p) | ||||
2731 | /* We're in get_defaulted_eh_spec; we don't actually want any walking | ||||
2732 | diagnostics, we just want complain set. */ | ||||
2733 | diag = false; | ||||
2734 | int quals = const_p ? TYPE_QUAL_CONST : TYPE_UNQUALIFIED; | ||||
2735 | |||||
2736 | for (binfo = TYPE_BINFO (ctype)((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2736, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.maxval), i = 0; | ||||
2737 | BINFO_BASE_ITERATE (binfo, i, base_binfo)((&(tree_check ((binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2737, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)-> iterate ((i), &(base_binfo))); ++i) | ||||
2738 | { | ||||
2739 | if (!SFK_ASSIGN_P (sfk)((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment ) && BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2739, __FUNCTION__, (TREE_BINFO)))->base.static_flag)) | ||||
2740 | /* We'll handle virtual bases below. */ | ||||
2741 | continue; | ||||
2742 | |||||
2743 | tree fn = synthesized_method_base_walk (binfo, base_binfo, | ||||
2744 | sfk, fnname, quals, | ||||
2745 | inheriting_ctor, inherited_parms, | ||||
2746 | flags, diag, spec_p, trivial_p, | ||||
2747 | deleted_p, constexpr_p); | ||||
2748 | |||||
2749 | if (diag && SFK_ASSIGN_P (sfk)((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment ) && SFK_MOVE_P (sfk)((sfk) == sfk_move_constructor || (sfk) == sfk_move_assignment ) | ||||
2750 | && BINFO_VIRTUAL_P (base_binfo)((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2750, __FUNCTION__, (TREE_BINFO)))->base.static_flag) | ||||
2751 | && fn && TREE_CODE (fn)((enum tree_code) (fn)->base.code) == FUNCTION_DECL | ||||
2752 | && move_fn_p (fn) && !trivial_fn_p (fn) | ||||
2753 | && vbase_has_user_provided_move_assign (BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2753, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2753, __FUNCTION__))->typed.type))) | ||||
2754 | warning (OPT_Wvirtual_move_assign, | ||||
2755 | "defaulted move assignment for %qT calls a non-trivial " | ||||
2756 | "move assignment operator for virtual base %qT", | ||||
2757 | ctype, BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2757, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2757, __FUNCTION__))->typed.type)); | ||||
2758 | |||||
2759 | if (check_vdtor && type_has_virtual_destructor (BINFO_TYPE (base_binfo)((contains_struct_check (((tree_check ((base_binfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2759, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2759, __FUNCTION__))->typed.type))) | ||||
2760 | { | ||||
2761 | /* Unlike for base ctor/op=/dtor, for operator delete it's fine | ||||
2762 | to have a null fn (no class-specific op delete). */ | ||||
2763 | fn = locate_fn_flags (ctype, ovl_op_identifier (false, DELETE_EXPR), | ||||
2764 | ptr_type_nodeglobal_trees[TI_PTR_TYPE], flags, tf_none); | ||||
2765 | if (fn && fn == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
2766 | { | ||||
2767 | if (complain & tf_error) | ||||
2768 | locate_fn_flags (ctype, ovl_op_identifier (false, DELETE_EXPR), | ||||
2769 | ptr_type_nodeglobal_trees[TI_PTR_TYPE], flags, complain); | ||||
2770 | if (deleted_p) | ||||
2771 | *deleted_p = true; | ||||
2772 | } | ||||
2773 | check_vdtor = false; | ||||
2774 | } | ||||
2775 | } | ||||
2776 | |||||
2777 | vec<tree, va_gc> *vbases = CLASSTYPE_VBASECLASSES (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2777, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases); | ||||
2778 | if (SFK_ASSIGN_P (sfk)((sfk) == sfk_copy_assignment || (sfk) == sfk_move_assignment )) | ||||
2779 | /* Already examined vbases above. */; | ||||
2780 | else if (vec_safe_is_empty (vbases)) | ||||
2781 | /* No virtual bases to worry about. */; | ||||
2782 | else if (ABSTRACT_CLASS_TYPE_P (ctype)((((((enum tree_code) (ctype)->base.code)) == RECORD_TYPE || (((enum tree_code) (ctype)->base.code)) == UNION_TYPE) && ((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2782, __FUNCTION__))->type_common.lang_flag_5)) && ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2782, __FUNCTION__))->type_with_lang_specific.lang_specific ))->pure_virtuals)) && cxx_dialect >= cxx14 | ||||
2783 | /* DR 1658 specifies that vbases of abstract classes are | ||||
2784 | ignored for both ctors and dtors. Except DR 2336 | ||||
2785 | overrides that skipping when determing the eh-spec of a | ||||
2786 | virtual destructor. */ | ||||
2787 | && sfk != sfk_virtual_destructor) | ||||
2788 | /* Vbase cdtors are not relevant. */; | ||||
2789 | else | ||||
2790 | { | ||||
2791 | if (constexpr_p) | ||||
2792 | *constexpr_p = false; | ||||
2793 | |||||
2794 | FOR_EACH_VEC_ELT (*vbases, i, base_binfo)for (i = 0; (*vbases).iterate ((i), &(base_binfo)); ++(i) ) | ||||
2795 | synthesized_method_base_walk (binfo, base_binfo, sfk, fnname, quals, | ||||
2796 | inheriting_ctor, inherited_parms, | ||||
2797 | flags, diag, | ||||
2798 | spec_p, trivial_p, deleted_p, constexpr_p); | ||||
2799 | } | ||||
2800 | |||||
2801 | /* Now handle the non-static data members. */ | ||||
2802 | walk_field_subobs (TYPE_FIELDS (ctype)((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2802, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values), sfk, fnname, quals, | ||||
2803 | spec_p, trivial_p, deleted_p, constexpr_p, | ||||
2804 | diag, flags, complain, /*dtor_from_ctor*/false); | ||||
2805 | if (SFK_CTOR_P (sfk)((sfk) >= sfk_constructor && (sfk) <= sfk_move_constructor )) | ||||
2806 | walk_field_subobs (TYPE_FIELDS (ctype)((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2806, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values), sfk_destructor, | ||||
2807 | complete_dtor_identifiercp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER], TYPE_UNQUALIFIED, | ||||
2808 | NULL__null, NULL__null, deleted_p, NULL__null, | ||||
2809 | false, flags, complain, /*dtor_from_ctor*/true); | ||||
2810 | |||||
2811 | pop_scope (scope); | ||||
2812 | |||||
2813 | pop_deferring_access_checks (); | ||||
2814 | --cp_unevaluated_operand; | ||||
2815 | --c_inhibit_evaluation_warnings; | ||||
2816 | } | ||||
2817 | |||||
2818 | /* DECL is a defaulted function whose exception specification is now | ||||
2819 | needed. Return what it should be. */ | ||||
2820 | |||||
2821 | tree | ||||
2822 | get_defaulted_eh_spec (tree decl, tsubst_flags_t complain) | ||||
2823 | { | ||||
2824 | /* For DECL_MAYBE_DELETED this should already have been handled by | ||||
2825 | synthesize_method. */ | ||||
2826 | gcc_assert (!DECL_MAYBE_DELETED (decl))((void)(!(!(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2826, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2826, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2826, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2826, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2826, __FUNCTION__); <->u.fn; })->maybe_deleted )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2826, __FUNCTION__), 0 : 0)); | ||||
2827 | |||||
2828 | if (DECL_CLONED_FUNCTION_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((decl ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2828, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) | ||||
2829 | decl = DECL_CLONED_FUNCTION (decl)(((contains_struct_check (((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2829, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2829, __FUNCTION__))->decl_common.lang_specific)->u.fn .u5.cloned_function); | ||||
2830 | special_function_kind sfk = special_function_p (decl); | ||||
2831 | tree ctype = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2831, __FUNCTION__))->decl_minimal.context); | ||||
2832 | tree parms = FUNCTION_FIRST_USER_PARMTYPE (decl)skip_artificial_parms_for ((decl), ((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2832, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2832, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | ||||
2833 | tree parm_type = TREE_VALUE (parms)((tree_check ((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2833, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
2834 | bool const_p = CP_TYPE_CONST_P (non_reference (parm_type))((cp_type_quals (non_reference (parm_type)) & TYPE_QUAL_CONST ) != 0); | ||||
2835 | tree spec = empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]; | ||||
2836 | bool diag = !DECL_DELETED_FN (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2836, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2836, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2836, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2836, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2836, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) && (complain & tf_error); | ||||
2837 | tree inh = DECL_INHERITED_CTOR (decl)((((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2837, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
2838 | if (SFK_DTOR_P (sfk)((sfk) == sfk_destructor || (sfk) == sfk_virtual_destructor) && DECL_VIRTUAL_P (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2838, __FUNCTION__))->decl_common.virtual_flag)) | ||||
2839 | /* We have to examine virtual bases even if abstract. */ | ||||
2840 | sfk = sfk_virtual_destructor; | ||||
2841 | bool pushed = false; | ||||
2842 | if (CLASSTYPE_TEMPLATE_INSTANTIATION (ctype)(((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2842, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) & 1)) | ||||
2843 | pushed = push_tinst_level (decl); | ||||
2844 | synthesized_method_walk (ctype, sfk, const_p, &spec, NULL__null, NULL__null, | ||||
2845 | NULL__null, diag, &inh, parms); | ||||
2846 | if (pushed) | ||||
2847 | pop_tinst_level (); | ||||
2848 | return spec; | ||||
2849 | } | ||||
2850 | |||||
2851 | /* DECL is a deleted function. If it's implicitly deleted, explain why and | ||||
2852 | return true; else return false. */ | ||||
2853 | |||||
2854 | bool | ||||
2855 | maybe_explain_implicit_delete (tree decl) | ||||
2856 | { | ||||
2857 | /* If decl is a clone, get the primary variant. */ | ||||
2858 | decl = DECL_ORIGIN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2858, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2858, __FUNCTION__))->decl_common.abstract_origin) : (decl )); | ||||
2859 | gcc_assert (DECL_DELETED_FN (decl))((void)(!((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2859, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2859, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2859, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2859, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2859, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p )) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2859, __FUNCTION__), 0 : 0)); | ||||
2860 | if (DECL_DEFAULTED_FN (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2860, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2860, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2860, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2860, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2860, __FUNCTION__); <->u.fn; })->defaulted_p)) | ||||
2861 | { | ||||
2862 | /* Not marked GTY; it doesn't need to be GC'd or written to PCH. */ | ||||
2863 | static hash_set<tree> *explained; | ||||
2864 | |||||
2865 | special_function_kind sfk; | ||||
2866 | location_t loc; | ||||
2867 | bool informed; | ||||
2868 | tree ctype; | ||||
2869 | |||||
2870 | if (!explained) | ||||
2871 | explained = new hash_set<tree>; | ||||
2872 | if (explained->add (decl)) | ||||
2873 | return true; | ||||
2874 | |||||
2875 | sfk = special_function_p (decl); | ||||
2876 | ctype = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2876, __FUNCTION__))->decl_minimal.context); | ||||
2877 | loc = input_location; | ||||
2878 | input_location = DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2878, __FUNCTION__))->decl_minimal.locus); | ||||
2879 | |||||
2880 | informed = false; | ||||
2881 | if (LAMBDA_TYPE_P (ctype)(((enum tree_code) (ctype)->base.code) == RECORD_TYPE && ((((tree_class_check ((((tree_class_check ((ctype), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((ctype), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name))->base.code)) ] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2881, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag ))) | ||||
2882 | { | ||||
2883 | informed = true; | ||||
2884 | if (sfk == sfk_constructor) | ||||
2885 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2885, __FUNCTION__))->decl_minimal.locus), | ||||
2886 | "a lambda closure type has a deleted default constructor"); | ||||
2887 | else if (sfk == sfk_copy_assignment) | ||||
2888 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2888, __FUNCTION__))->decl_minimal.locus), | ||||
2889 | "a lambda closure type has a deleted copy assignment operator"); | ||||
2890 | else | ||||
2891 | informed = false; | ||||
2892 | } | ||||
2893 | else if (DECL_ARTIFICIAL (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2893, __FUNCTION__))->decl_common.artificial_flag) | ||||
2894 | && (sfk == sfk_copy_assignment || sfk == sfk_copy_constructor) | ||||
2895 | && classtype_has_move_assign_or_move_ctor_p (ctype, true)) | ||||
2896 | { | ||||
2897 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2897, __FUNCTION__))->decl_minimal.locus), | ||||
2898 | "%q#D is implicitly declared as deleted because %qT " | ||||
2899 | "declares a move constructor or move assignment operator", | ||||
2900 | decl, ctype); | ||||
2901 | informed = true; | ||||
2902 | } | ||||
2903 | else if (sfk == sfk_inheriting_constructor) | ||||
2904 | { | ||||
2905 | tree binfo = inherited_ctor_binfo (decl); | ||||
2906 | if (TREE_CODE (binfo)((enum tree_code) (binfo)->base.code) != TREE_BINFO) | ||||
2907 | { | ||||
2908 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2908, __FUNCTION__))->decl_minimal.locus), | ||||
2909 | "%q#D inherits from multiple base subobjects", | ||||
2910 | decl); | ||||
2911 | informed = true; | ||||
2912 | } | ||||
2913 | } | ||||
2914 | if (!informed && sfk == sfk_comparison) | ||||
2915 | { | ||||
2916 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2916, __FUNCTION__))->decl_minimal.locus), | ||||
2917 | "%q#D is implicitly deleted because the default " | ||||
2918 | "definition would be ill-formed:", decl); | ||||
2919 | build_comparison_op (decl, false, tf_warning_or_error); | ||||
2920 | } | ||||
2921 | else if (!informed) | ||||
2922 | { | ||||
2923 | tree parms = FUNCTION_FIRST_USER_PARMTYPE (decl)skip_artificial_parms_for ((decl), ((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2923, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2923, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | ||||
2924 | bool const_p = false; | ||||
2925 | if (parms) | ||||
2926 | { | ||||
2927 | tree parm_type = TREE_VALUE (parms)((tree_check ((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2927, __FUNCTION__, (TREE_LIST)))->list.value); | ||||
2928 | const_p = CP_TYPE_CONST_P (non_reference (parm_type))((cp_type_quals (non_reference (parm_type)) & TYPE_QUAL_CONST ) != 0); | ||||
2929 | } | ||||
2930 | tree raises = NULL_TREE(tree) __null; | ||||
2931 | bool deleted_p = false; | ||||
2932 | tree scope = push_scope (ctype); | ||||
2933 | tree inh = DECL_INHERITED_CTOR (decl)((((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2933, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
2934 | |||||
2935 | synthesized_method_walk (ctype, sfk, const_p, | ||||
2936 | &raises, NULL__null, &deleted_p, NULL__null, false, | ||||
2937 | &inh, parms); | ||||
2938 | if (deleted_p) | ||||
2939 | { | ||||
2940 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2940, __FUNCTION__))->decl_minimal.locus), | ||||
2941 | "%q#D is implicitly deleted because the default " | ||||
2942 | "definition would be ill-formed:", decl); | ||||
2943 | synthesized_method_walk (ctype, sfk, const_p, | ||||
2944 | NULL__null, NULL__null, &deleted_p, NULL__null, true, | ||||
2945 | &inh, parms); | ||||
2946 | } | ||||
2947 | else if (!comp_except_specs | ||||
2948 | (TYPE_RAISES_EXCEPTIONS (TREE_TYPE (decl))((tree_class_check (((tree_check2 ((((contains_struct_check ( (decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2948, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2948, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2948, __FUNCTION__))->type_non_common.lang_1), | ||||
2949 | raises, ce_normal)) | ||||
2950 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2950, __FUNCTION__))->decl_minimal.locus), "%q#F is implicitly " | ||||
2951 | "deleted because its exception-specification does not " | ||||
2952 | "match the implicit exception-specification %qX", | ||||
2953 | decl, raises); | ||||
2954 | else if (flag_checkingglobal_options.x_flag_checking) | ||||
2955 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2955, __FUNCTION__)); | ||||
2956 | |||||
2957 | pop_scope (scope); | ||||
2958 | } | ||||
2959 | |||||
2960 | input_location = loc; | ||||
2961 | return true; | ||||
2962 | } | ||||
2963 | return false; | ||||
2964 | } | ||||
2965 | |||||
2966 | /* DECL is a defaulted function which was declared constexpr. Explain why | ||||
2967 | it can't be constexpr. */ | ||||
2968 | |||||
2969 | void | ||||
2970 | explain_implicit_non_constexpr (tree decl) | ||||
2971 | { | ||||
2972 | tree parms = FUNCTION_FIRST_USER_PARMTYPE (decl)skip_artificial_parms_for ((decl), ((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2972, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2972, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | ||||
2973 | bool const_p = CP_TYPE_CONST_P (non_reference (TREE_VALUE (parms)))((cp_type_quals (non_reference (((tree_check ((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2973, __FUNCTION__, (TREE_LIST)))->list.value))) & TYPE_QUAL_CONST ) != 0); | ||||
2974 | tree inh = DECL_INHERITED_CTOR (decl)((((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2974, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
2975 | bool dummy; | ||||
2976 | special_function_kind sfk = special_function_p (decl); | ||||
2977 | if (sfk == sfk_comparison) | ||||
2978 | { | ||||
2979 | DECL_DECLARED_CONSTEXPR_P (decl)((contains_struct_check (((tree_check2 (((((enum tree_code) ( decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2979, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2979, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2979, __FUNCTION__))->decl_common.lang_flag_8) = true; | ||||
2980 | build_comparison_op (decl, false, tf_warning_or_error); | ||||
2981 | DECL_DECLARED_CONSTEXPR_P (decl)((contains_struct_check (((tree_check2 (((((enum tree_code) ( decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2981, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2981, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2981, __FUNCTION__))->decl_common.lang_flag_8) = false; | ||||
2982 | } | ||||
2983 | else | ||||
2984 | synthesized_method_walk (DECL_CLASS_CONTEXT (decl)((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2984, __FUNCTION__))->decl_minimal.context) && ( tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2984, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)) ? ((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2984, __FUNCTION__))->decl_minimal.context) : (tree) __null ), | ||||
2985 | sfk, const_p, | ||||
2986 | NULL__null, NULL__null, NULL__null, &dummy, true, | ||||
2987 | &inh, parms); | ||||
2988 | } | ||||
2989 | |||||
2990 | /* DECL is an instantiation of an inheriting constructor template. Deduce | ||||
2991 | the correct exception-specification and deletedness for this particular | ||||
2992 | specialization. Return true if the deduction succeeds; false otherwise. */ | ||||
2993 | |||||
2994 | bool | ||||
2995 | deduce_inheriting_ctor (tree decl) | ||||
2996 | { | ||||
2997 | decl = DECL_ORIGIN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2997, __FUNCTION__))->decl_common.abstract_origin) ? ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2997, __FUNCTION__))->decl_common.abstract_origin) : (decl )); | ||||
2998 | gcc_assert (DECL_INHERITED_CTOR (decl))((void)(!(((((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 2998, __FUNCTION__), 0 : 0)); | ||||
2999 | tree spec; | ||||
3000 | bool trivial, constexpr_, deleted; | ||||
3001 | tree inh = DECL_INHERITED_CTOR (decl)((((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) && ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3001, __FUNCTION__); <->u.fn; })->context : (tree ) __null); | ||||
3002 | synthesized_method_walk (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3002, __FUNCTION__))->decl_minimal.context), sfk_inheriting_constructor, | ||||
3003 | false, &spec, &trivial, &deleted, &constexpr_, | ||||
3004 | /*diag*/false, | ||||
3005 | &inh, | ||||
3006 | FUNCTION_FIRST_USER_PARMTYPE (decl)skip_artificial_parms_for ((decl), ((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3006, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3006, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values))); | ||||
3007 | if (spec == error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3008 | return false; | ||||
3009 | if (TREE_CODE (inherited_ctor_binfo (decl))((enum tree_code) (inherited_ctor_binfo (decl))->base.code ) != TREE_BINFO) | ||||
3010 | /* Inherited the same constructor from different base subobjects. */ | ||||
3011 | deleted = true; | ||||
3012 | DECL_DELETED_FN (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3012, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3012, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3012, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3012, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3012, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = deleted; | ||||
3013 | TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3013, __FUNCTION__))->typed.type) = build_exception_variant (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3013, __FUNCTION__))->typed.type), spec); | ||||
3014 | SET_DECL_INHERITED_CTOR (decl, inh)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3014, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3014, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (decl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3014, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3014, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3014, __FUNCTION__); <->u.fn; })->context = (inh )); | ||||
3015 | |||||
3016 | tree clone; | ||||
3017 | FOR_EACH_CLONE (clone, decl)if (!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL && ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((decl), ( TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ; else for (clone = (((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->common.chain)); clone && ( ((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((clone ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((clone) , (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]))); clone = (((contains_struct_check ( ((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3017, __FUNCTION__))->common.chain))) | ||||
3018 | { | ||||
3019 | DECL_DELETED_FN (clone)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (clone)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((clone), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3019, __FUNCTION__, (TEMPLATE_DECL))))))))->result : clone )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3019, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (clone)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (clone)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((clone), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3019, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((clone ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3019, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3019, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = deleted; | ||||
3020 | TREE_TYPE (clone)((contains_struct_check ((clone), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3020, __FUNCTION__))->typed.type) = build_exception_variant (TREE_TYPE (clone)((contains_struct_check ((clone), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3020, __FUNCTION__))->typed.type), spec); | ||||
3021 | SET_DECL_INHERITED_CTOR (clone, inh)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (clone)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((clone), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3021, __FUNCTION__, (TEMPLATE_DECL))))))))->result : clone )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3021, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (clone)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (clone)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((clone), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3021, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((clone ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3021, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3021, __FUNCTION__); <->u.fn; })->context = (inh )); | ||||
3022 | } | ||||
3023 | |||||
3024 | return true; | ||||
3025 | } | ||||
3026 | |||||
3027 | /* Implicitly declare the special function indicated by KIND, as a | ||||
3028 | member of TYPE. For copy constructors and assignment operators, | ||||
3029 | CONST_P indicates whether these functions should take a const | ||||
3030 | reference argument or a non-const reference. | ||||
3031 | Returns the FUNCTION_DECL for the implicitly declared function. */ | ||||
3032 | |||||
3033 | tree | ||||
3034 | implicitly_declare_fn (special_function_kind kind, tree type, | ||||
3035 | bool const_p, tree pattern_fn, | ||||
3036 | tree inherited_parms) | ||||
3037 | { | ||||
3038 | tree fn; | ||||
3039 | tree parameter_types = void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; | ||||
3040 | tree return_type; | ||||
3041 | tree fn_type; | ||||
3042 | tree raises = empty_except_speccp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]; | ||||
3043 | tree rhs_parm_type = NULL_TREE(tree) __null; | ||||
3044 | tree this_parm; | ||||
3045 | tree name; | ||||
3046 | HOST_WIDE_INTlong saved_processing_template_decl; | ||||
3047 | bool deleted_p = false; | ||||
3048 | bool constexpr_p = false; | ||||
3049 | tree inherited_ctor = (kind == sfk_inheriting_constructor | ||||
3050 | ? pattern_fn : NULL_TREE(tree) __null); | ||||
3051 | |||||
3052 | /* Because we create declarations for implicitly declared functions | ||||
3053 | lazily, we may be creating the declaration for a member of TYPE | ||||
3054 | while in some completely different context. However, TYPE will | ||||
3055 | never be a dependent class (because we never want to do lookups | ||||
3056 | for implicitly defined functions in a dependent class). */ | ||||
3057 | gcc_assert (!dependent_type_p (type))((void)(!(!dependent_type_p (type)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3057, __FUNCTION__), 0 : 0)); | ||||
3058 | |||||
3059 | /* If the member-specification does not explicitly declare any member or | ||||
3060 | friend named operator==, an == operator function is declared | ||||
3061 | implicitly for each three-way comparison operator function defined as | ||||
3062 | defaulted in the member-specification, with the same access and | ||||
3063 | function-definition and in the same class scope as the respective | ||||
3064 | three-way comparison operator function, except that the return type is | ||||
3065 | replaced with bool and the declarator-id is replaced with | ||||
3066 | operator==. | ||||
3067 | |||||
3068 | [Note: Such an implicitly-declared == operator for a class X is | ||||
3069 | defined as defaulted in the definition of X and has the same | ||||
3070 | parameter-declaration-clause and trailing requires-clause as the | ||||
3071 | respective three-way comparison operator. It is declared with friend, | ||||
3072 | virtual, constexpr, or consteval if the three-way comparison operator | ||||
3073 | function is so declared. If the three-way comparison operator function | ||||
3074 | has no noexcept-specifier, the implicitly-declared == operator | ||||
3075 | function has an implicit exception specification (14.5) that may | ||||
3076 | differ from the implicit exception specification of the three-way | ||||
3077 | comparison operator function. --end note] */ | ||||
3078 | if (kind == sfk_comparison) | ||||
3079 | { | ||||
3080 | fn = copy_operator_fn (pattern_fn, EQ_EXPR); | ||||
3081 | DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3081, __FUNCTION__))->decl_common.artificial_flag) = 1; | ||||
3082 | apply_deduced_return_type (fn, boolean_type_nodeglobal_trees[TI_BOOLEAN_TYPE]); | ||||
3083 | return fn; | ||||
3084 | } | ||||
3085 | |||||
3086 | /* Furthermore, we must set PROCESSING_TEMPLATE_DECL to zero here | ||||
3087 | because we only create clones for constructors and destructors | ||||
3088 | when not in a template. */ | ||||
3089 | saved_processing_template_decl = processing_template_declscope_chain->x_processing_template_decl; | ||||
3090 | processing_template_declscope_chain->x_processing_template_decl = 0; | ||||
3091 | |||||
3092 | type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3092, __FUNCTION__))->type_common.main_variant); | ||||
3093 | |||||
3094 | if (targetm.cxx.cdtor_returns_this ()) | ||||
3095 | { | ||||
3096 | if (kind == sfk_destructor) | ||||
3097 | /* See comment in check_special_function_return_type. */ | ||||
3098 | return_type = build_pointer_type (void_type_nodeglobal_trees[TI_VOID_TYPE]); | ||||
3099 | else | ||||
3100 | return_type = build_pointer_type (type); | ||||
3101 | } | ||||
3102 | else | ||||
3103 | return_type = void_type_nodeglobal_trees[TI_VOID_TYPE]; | ||||
3104 | |||||
3105 | int this_quals = TYPE_UNQUALIFIED; | ||||
3106 | switch (kind) | ||||
3107 | { | ||||
3108 | case sfk_destructor: | ||||
3109 | /* Destructor. */ | ||||
3110 | name = dtor_identifiercp_global_trees[CPTI_DTOR_IDENTIFIER]; | ||||
3111 | break; | ||||
3112 | |||||
3113 | case sfk_constructor: | ||||
3114 | /* Default constructor. */ | ||||
3115 | name = ctor_identifiercp_global_trees[CPTI_CTOR_IDENTIFIER]; | ||||
3116 | break; | ||||
3117 | |||||
3118 | case sfk_copy_constructor: | ||||
3119 | case sfk_copy_assignment: | ||||
3120 | case sfk_move_constructor: | ||||
3121 | case sfk_move_assignment: | ||||
3122 | case sfk_inheriting_constructor: | ||||
3123 | { | ||||
3124 | if (kind == sfk_copy_assignment | ||||
3125 | || kind == sfk_move_assignment) | ||||
3126 | { | ||||
3127 | return_type = build_reference_type (type); | ||||
3128 | name = assign_op_identifier(ovl_op_info[true][OVL_OP_NOP_EXPR].identifier); | ||||
3129 | } | ||||
3130 | else | ||||
3131 | name = ctor_identifiercp_global_trees[CPTI_CTOR_IDENTIFIER]; | ||||
3132 | |||||
3133 | if (kind == sfk_inheriting_constructor) | ||||
3134 | parameter_types = inherited_parms; | ||||
3135 | else | ||||
3136 | { | ||||
3137 | if (const_p) | ||||
3138 | rhs_parm_type = cp_build_qualified_type (type, TYPE_QUAL_CONST); | ||||
3139 | else | ||||
3140 | rhs_parm_type = type; | ||||
3141 | bool move_p = (kind == sfk_move_assignment | ||||
3142 | || kind == sfk_move_constructor); | ||||
3143 | rhs_parm_type = cp_build_reference_type (rhs_parm_type, move_p); | ||||
3144 | |||||
3145 | parameter_types = tree_cons (NULL_TREE(tree) __null, rhs_parm_type, parameter_types); | ||||
3146 | } | ||||
3147 | break; | ||||
3148 | } | ||||
3149 | |||||
3150 | default: | ||||
3151 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3151, __FUNCTION__)); | ||||
3152 | } | ||||
3153 | |||||
3154 | bool trivial_p = false; | ||||
3155 | |||||
3156 | if (inherited_ctor) | ||||
3157 | { | ||||
3158 | /* For an inheriting constructor, just copy these flags from the | ||||
3159 | inherited constructor until deduce_inheriting_ctor. */ | ||||
3160 | raises = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (inherited_ctor))((tree_class_check (((tree_check2 ((((contains_struct_check ( (inherited_ctor), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3160, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3160, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3160, __FUNCTION__))->type_non_common.lang_1); | ||||
3161 | deleted_p = DECL_DELETED_FN (inherited_ctor)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (inherited_ctor)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3161, __FUNCTION__, (TEMPLATE_DECL))))))))->result : inherited_ctor )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3161, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (inherited_ctor)->base.code) == FUNCTION_DECL || (((enum tree_code) (inherited_ctor)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3161, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3161, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3161, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ); | ||||
3162 | constexpr_p = DECL_DECLARED_CONSTEXPR_P (inherited_ctor)((contains_struct_check (((tree_check2 (((((enum tree_code) ( inherited_ctor)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3162, __FUNCTION__, (TEMPLATE_DECL))))))))->result : inherited_ctor )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3162, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3162, __FUNCTION__))->decl_common.lang_flag_8); | ||||
3163 | } | ||||
3164 | else if (cxx_dialect >= cxx11) | ||||
3165 | { | ||||
3166 | raises = noexcept_deferred_speccp_global_trees[CPTI_NOEXCEPT_DEFERRED_SPEC]; | ||||
3167 | synthesized_method_walk (type, kind, const_p, NULL__null, &trivial_p, | ||||
3168 | &deleted_p, &constexpr_p, false, | ||||
3169 | &inherited_ctor, inherited_parms); | ||||
3170 | } | ||||
3171 | else | ||||
3172 | synthesized_method_walk (type, kind, const_p, &raises, &trivial_p, | ||||
3173 | &deleted_p, &constexpr_p, false, | ||||
3174 | &inherited_ctor, inherited_parms); | ||||
3175 | /* Don't bother marking a deleted constructor as constexpr. */ | ||||
3176 | if (deleted_p) | ||||
3177 | constexpr_p = false; | ||||
3178 | /* A trivial copy/move constructor is also a constexpr constructor, | ||||
3179 | unless the class has virtual bases (7.1.5p4). */ | ||||
3180 | else if (trivial_p | ||||
3181 | && cxx_dialect >= cxx11 | ||||
3182 | && (kind == sfk_copy_constructor | ||||
3183 | || kind == sfk_move_constructor) | ||||
3184 | && !CLASSTYPE_VBASECLASSES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3184, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases)) | ||||
3185 | gcc_assert (constexpr_p)((void)(!(constexpr_p) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3185, __FUNCTION__), 0 : 0)); | ||||
3186 | |||||
3187 | if (!trivial_p && type_has_trivial_fn (type, kind)) | ||||
3188 | type_set_nontrivial_flag (type, kind); | ||||
3189 | |||||
3190 | /* Create the function. */ | ||||
3191 | tree this_type = cp_build_qualified_type (type, this_quals); | ||||
3192 | fn_type = build_method_type_directly (this_type, return_type, | ||||
3193 | parameter_types); | ||||
3194 | |||||
3195 | if (raises) | ||||
3196 | { | ||||
3197 | if (raises != error_mark_nodeglobal_trees[TI_ERROR_MARK]) | ||||
3198 | fn_type = build_exception_variant (fn_type, raises); | ||||
3199 | else | ||||
3200 | { | ||||
3201 | /* Can happen, e.g., in C++98 mode for an ill-formed non-static data | ||||
3202 | member initializer (c++/89914). Also, in C++98, we might have | ||||
3203 | failed to deduce RAISES, so try again but complain this time. */ | ||||
3204 | if (cxx_dialect < cxx11) | ||||
3205 | synthesized_method_walk (type, kind, const_p, &raises, nullptr, | ||||
3206 | nullptr, nullptr, /*diag=*/true, | ||||
3207 | &inherited_ctor, inherited_parms); | ||||
3208 | /* We should have seen an error at this point. */ | ||||
3209 | gcc_assert (seen_error ())((void)(!(seen_error ()) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3209, __FUNCTION__), 0 : 0)); | ||||
3210 | } | ||||
3211 | } | ||||
3212 | fn = build_lang_decl (FUNCTION_DECL, name, fn_type); | ||||
3213 | if (kind != sfk_inheriting_constructor) | ||||
3214 | DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3214, __FUNCTION__))->decl_minimal.locus) = DECL_SOURCE_LOCATION (TYPE_NAME (type))((contains_struct_check ((((tree_class_check ((type), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3214, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3214, __FUNCTION__))->decl_minimal.locus); | ||||
3215 | |||||
3216 | if (IDENTIFIER_OVL_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3216, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3216, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & (!((tree_not_check2 (((tree_check ((name ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3216, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3216, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)))) | ||||
3217 | { | ||||
3218 | const ovl_op_info_t *op = IDENTIFIER_OVL_OP_INFO (name)(&ovl_op_info[((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3218, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3218, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)][((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3218, __FUNCTION__, (IDENTIFIER_NODE)))->base.u.bits.address_space )]); | ||||
3219 | DECL_OVERLOADED_OPERATOR_CODE_RAW (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3219, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3219, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3219, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3219, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3219, __FUNCTION__); <->u.fn; })->ovl_op_code) = op->ovl_op_code; | ||||
3220 | } | ||||
3221 | else if (IDENTIFIER_CTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3221, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3221, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3221, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3221, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) & (!((tree_not_check2 (((tree_check ((name ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3221, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3221, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) | ||||
3222 | DECL_CXX_CONSTRUCTOR_P (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3222, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) = true; | ||||
3223 | else if (IDENTIFIER_DTOR_P (name)(((!((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3223, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3223, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3223, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3223, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) & ((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3223, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3223, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) | ||||
3224 | DECL_CXX_DESTRUCTOR_P (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3224, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor ) = true; | ||||
3225 | else | ||||
3226 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3226, __FUNCTION__)); | ||||
3227 | |||||
3228 | SET_DECL_ALIGN (fn, MINIMUM_METHOD_BOUNDARY)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3228, __FUNCTION__))->decl_common.align) = ffs_hwi (((ptrmemfunc_vbit_in_pfn == ptrmemfunc_vbit_in_pfn) ? ((8) > (2 * (8)) ? (8) : (2 * (8))) : 8))); | ||||
3229 | |||||
3230 | /* Create the explicit arguments. */ | ||||
3231 | if (rhs_parm_type) | ||||
3232 | { | ||||
3233 | /* Note that this parameter is *not* marked DECL_ARTIFICIAL; we | ||||
3234 | want its type to be included in the mangled function | ||||
3235 | name. */ | ||||
3236 | tree decl = cp_build_parm_decl (fn, NULL_TREE(tree) __null, rhs_parm_type); | ||||
3237 | TREE_READONLY (decl)((non_type_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3237, __FUNCTION__))->base.readonly_flag) = 1; | ||||
3238 | retrofit_lang_decl (decl); | ||||
3239 | DECL_PARM_INDEX (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3239, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (decl)->base.code) != PARM_DECL || lt-> u.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3239, __FUNCTION__); <->u.parm; })->index) = DECL_PARM_LEVEL (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3239, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (decl)->base.code) != PARM_DECL || lt-> u.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3239, __FUNCTION__); <->u.parm; })->level) = 1; | ||||
3240 | DECL_ARGUMENTS (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3240, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = decl; | ||||
3241 | } | ||||
3242 | else if (kind == sfk_inheriting_constructor) | ||||
3243 | { | ||||
3244 | tree *p = &DECL_ARGUMENTS (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3244, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); | ||||
3245 | int index = 1; | ||||
3246 | for (tree parm = inherited_parms; parm && parm != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; | ||||
3247 | parm = TREE_CHAIN (parm)((contains_struct_check ((parm), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3247, __FUNCTION__))->common.chain)) | ||||
3248 | { | ||||
3249 | *p = cp_build_parm_decl (fn, NULL_TREE(tree) __null, TREE_VALUE (parm)((tree_check ((parm), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3249, __FUNCTION__, (TREE_LIST)))->list.value)); | ||||
3250 | retrofit_lang_decl (*p); | ||||
3251 | DECL_PARM_LEVEL (*p)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((*p), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3251, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (*p)->base.code) != PARM_DECL || lt->u. base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3251, __FUNCTION__); <->u.parm; })->level) = 1; | ||||
3252 | DECL_PARM_INDEX (*p)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((*p), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3252, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (*p)->base.code) != PARM_DECL || lt->u. base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3252, __FUNCTION__); <->u.parm; })->index) = index++; | ||||
3253 | p = &DECL_CHAIN (*p)(((contains_struct_check (((contains_struct_check ((*p), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3253, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3253, __FUNCTION__))->common.chain)); | ||||
3254 | } | ||||
3255 | SET_DECL_INHERITED_CTOR (fn, inherited_ctor)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3255, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3255, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3255, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3255, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3255, __FUNCTION__); <->u.fn; })->context = (inherited_ctor )); | ||||
3256 | DECL_NONCONVERTING_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__); <->u.fn; })->nonconverting ) = DECL_NONCONVERTING_P (inherited_ctor)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (inherited_ctor)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__, (TEMPLATE_DECL))))))))->result : inherited_ctor )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (inherited_ctor)->base.code) == FUNCTION_DECL || (((enum tree_code) (inherited_ctor)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3256, __FUNCTION__); <->u.fn; })->nonconverting ); | ||||
3257 | /* A constructor so declared has the same access as the corresponding | ||||
3258 | constructor in X. */ | ||||
3259 | TREE_PRIVATE (fn)((fn)->base.private_flag) = TREE_PRIVATE (inherited_ctor)((inherited_ctor)->base.private_flag); | ||||
3260 | TREE_PROTECTED (fn)((fn)->base.protected_flag) = TREE_PROTECTED (inherited_ctor)((inherited_ctor)->base.protected_flag); | ||||
3261 | /* Copy constexpr from the inherited constructor even if the | ||||
3262 | inheriting constructor doesn't satisfy the requirements. */ | ||||
3263 | constexpr_p = DECL_DECLARED_CONSTEXPR_P (inherited_ctor)((contains_struct_check (((tree_check2 (((((enum tree_code) ( inherited_ctor)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((inherited_ctor ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3263, __FUNCTION__, (TEMPLATE_DECL))))))))->result : inherited_ctor )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3263, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3263, __FUNCTION__))->decl_common.lang_flag_8); | ||||
3264 | } | ||||
3265 | |||||
3266 | /* Add the "this" parameter. */ | ||||
3267 | this_parm = build_this_parm (fn, fn_type, this_quals); | ||||
3268 | DECL_CHAIN (this_parm)(((contains_struct_check (((contains_struct_check ((this_parm ), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3268, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3268, __FUNCTION__))->common.chain)) = DECL_ARGUMENTS (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3268, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); | ||||
3269 | DECL_ARGUMENTS (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3269, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = this_parm; | ||||
3270 | |||||
3271 | grokclassfn (type, fn, kind == sfk_destructor ? DTOR_FLAG : NO_SPECIAL); | ||||
3272 | |||||
3273 | DECL_IN_AGGR_P (fn)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3273, __FUNCTION__))->decl_common.lang_flag_3)) = 1; | ||||
3274 | DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3274, __FUNCTION__))->decl_common.artificial_flag) = 1; | ||||
3275 | DECL_DEFAULTED_FN (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3275, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3275, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3275, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3275, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3275, __FUNCTION__); <->u.fn; })->defaulted_p) = 1; | ||||
3276 | if (cxx_dialect >= cxx11) | ||||
3277 | { | ||||
3278 | DECL_DELETED_FN (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3278, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3278, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3278, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3278, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3278, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = deleted_p; | ||||
3279 | DECL_DECLARED_CONSTEXPR_P (fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3279, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3279, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3279, __FUNCTION__))->decl_common.lang_flag_8) = constexpr_p; | ||||
3280 | } | ||||
3281 | DECL_EXTERNAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3281, __FUNCTION__))->decl_common.decl_flag_1) = true; | ||||
3282 | DECL_NOT_REALLY_EXTERN (fn)(((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3282, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 1; | ||||
3283 | DECL_DECLARED_INLINE_P (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3283, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) = 1; | ||||
3284 | set_linkage_according_to_type (type, fn); | ||||
3285 | if (TREE_PUBLIC (fn)((fn)->base.public_flag)) | ||||
3286 | DECL_COMDAT (fn)((contains_struct_check ((fn), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3286, __FUNCTION__))->decl_with_vis.comdat_flag) = 1; | ||||
3287 | rest_of_decl_compilation (fn, namespace_bindings_p (), at_eof); | ||||
3288 | gcc_assert (!TREE_USED (fn))((void)(!(!((fn)->base.used_flag)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3288, __FUNCTION__), 0 : 0)); | ||||
3289 | |||||
3290 | /* Propagate constraints from the inherited constructor. */ | ||||
3291 | if (flag_conceptsglobal_options.x_flag_concepts && inherited_ctor) | ||||
3292 | if (tree orig_ci = get_constraints (inherited_ctor)) | ||||
3293 | { | ||||
3294 | tree new_ci = copy_node (orig_ci); | ||||
3295 | set_constraints (fn, new_ci); | ||||
3296 | } | ||||
3297 | |||||
3298 | /* Restore PROCESSING_TEMPLATE_DECL. */ | ||||
3299 | processing_template_declscope_chain->x_processing_template_decl = saved_processing_template_decl; | ||||
3300 | |||||
3301 | if (inherited_ctor && TREE_CODE (inherited_ctor)((enum tree_code) (inherited_ctor)->base.code) == TEMPLATE_DECL) | ||||
3302 | fn = add_inherited_template_parms (fn, inherited_ctor); | ||||
3303 | |||||
3304 | /* Warn about calling a non-trivial move assignment in a virtual base. */ | ||||
3305 | if (kind == sfk_move_assignment && !deleted_p && !trivial_p | ||||
3306 | && CLASSTYPE_VBASECLASSES (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3306, __FUNCTION__))->type_with_lang_specific.lang_specific ))->vbases)) | ||||
3307 | { | ||||
3308 | location_t loc = input_location; | ||||
3309 | input_location = DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3309, __FUNCTION__))->decl_minimal.locus); | ||||
3310 | synthesized_method_walk (type, kind, const_p, | ||||
3311 | NULL__null, NULL__null, NULL__null, NULL__null, true, | ||||
3312 | NULL__null, NULL_TREE(tree) __null); | ||||
3313 | input_location = loc; | ||||
3314 | } | ||||
3315 | |||||
3316 | return fn; | ||||
3317 | } | ||||
3318 | |||||
3319 | /* Gives any errors about defaulted functions which need to be deferred | ||||
3320 | until the containing class is complete. */ | ||||
3321 | |||||
3322 | void | ||||
3323 | defaulted_late_check (tree fn) | ||||
3324 | { | ||||
3325 | /* Complain about invalid signature for defaulted fn. */ | ||||
3326 | tree ctx = DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3326, __FUNCTION__))->decl_minimal.context); | ||||
3327 | special_function_kind kind = special_function_p (fn); | ||||
3328 | |||||
3329 | if (kind == sfk_comparison) | ||||
3330 | { | ||||
3331 | /* If the function was declared constexpr, check that the definition | ||||
3332 | qualifies. Otherwise we can define the function lazily. */ | ||||
3333 | if (DECL_DECLARED_CONSTEXPR_P (fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3333, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3333, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3333, __FUNCTION__))->decl_common.lang_flag_8) && !DECL_INITIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3333, __FUNCTION__))->decl_common.initial)) | ||||
3334 | { | ||||
3335 | /* Prevent GC. */ | ||||
3336 | function_depth++; | ||||
3337 | synthesize_method (fn); | ||||
3338 | function_depth--; | ||||
3339 | } | ||||
3340 | return; | ||||
3341 | } | ||||
3342 | |||||
3343 | bool fn_const_p = (copy_fn_p (fn) == 2); | ||||
3344 | tree implicit_fn = implicitly_declare_fn (kind, ctx, fn_const_p, | ||||
3345 | NULL__null, NULL__null); | ||||
3346 | tree eh_spec = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (implicit_fn))((tree_class_check (((tree_check2 ((((contains_struct_check ( (implicit_fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3346, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3346, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3346, __FUNCTION__))->type_non_common.lang_1); | ||||
3347 | |||||
3348 | if (!same_type_p (TREE_TYPE (TREE_TYPE (fn)),comptypes ((((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3348, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3348, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((implicit_fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3349, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3349, __FUNCTION__))->typed.type)), 0) | ||||
3349 | TREE_TYPE (TREE_TYPE (implicit_fn)))comptypes ((((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3348, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3348, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((implicit_fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3349, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3349, __FUNCTION__))->typed.type)), 0) | ||||
3350 | || !compparms (TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3350, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3350, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values), | ||||
3351 | TYPE_ARG_TYPES (TREE_TYPE (implicit_fn))((tree_check2 ((((contains_struct_check ((implicit_fn), (TS_TYPED ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3351, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3351, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values))) | ||||
3352 | { | ||||
3353 | error ("defaulted declaration %q+D does not match the " | ||||
3354 | "expected signature", fn); | ||||
3355 | inform (DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3355, __FUNCTION__))->decl_minimal.locus), | ||||
3356 | "expected signature: %qD", implicit_fn); | ||||
3357 | } | ||||
3358 | |||||
3359 | if (DECL_DELETED_FN (implicit_fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (implicit_fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((implicit_fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3359, __FUNCTION__, (TEMPLATE_DECL))))))))->result : implicit_fn )), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3359, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (implicit_fn)->base.code) == FUNCTION_DECL || (((enum tree_code) (implicit_fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((implicit_fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3359, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((implicit_fn ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3359, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3359, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p )) | ||||
3360 | { | ||||
3361 | DECL_DELETED_FN (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3361, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3361, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3361, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3361, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3361, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = 1; | ||||
3362 | return; | ||||
3363 | } | ||||
3364 | |||||
3365 | /* If a function is explicitly defaulted on its first declaration without an | ||||
3366 | exception-specification, it is implicitly considered to have the same | ||||
3367 | exception-specification as if it had been implicitly declared. */ | ||||
3368 | if (!TYPE_RAISES_EXCEPTIONS (TREE_TYPE (fn))((tree_class_check (((tree_check2 ((((contains_struct_check ( (fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3368, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3368, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3368, __FUNCTION__))->type_non_common.lang_1) | ||||
3369 | && DECL_DEFAULTED_IN_CLASS_P (fn)((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3369, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3369, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3369, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3369, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3369, __FUNCTION__); <->u.fn; })->defaulted_p) && (((contains_struct_check (((tree_check2 ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3369, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3369, __FUNCTION__))->decl_common.lang_specific) ->u. base.initialized_in_class))) | ||||
3370 | TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3370, __FUNCTION__))->typed.type) = build_exception_variant (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3370, __FUNCTION__))->typed.type), eh_spec); | ||||
3371 | |||||
3372 | if (DECL_DEFAULTED_IN_CLASS_P (fn)((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3372, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3372, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3372, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3372, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3372, __FUNCTION__); <->u.fn; })->defaulted_p) && (((contains_struct_check (((tree_check2 ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3372, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3372, __FUNCTION__))->decl_common.lang_specific) ->u. base.initialized_in_class)) | ||||
3373 | && DECL_DECLARED_CONSTEXPR_P (implicit_fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( implicit_fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((implicit_fn ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3373, __FUNCTION__, (TEMPLATE_DECL))))))))->result : implicit_fn )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3373, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3373, __FUNCTION__))->decl_common.lang_flag_8)) | ||||
3374 | { | ||||
3375 | /* Hmm...should we do this for out-of-class too? Should it be OK to | ||||
3376 | add constexpr later like inline, rather than requiring | ||||
3377 | declarations to match? */ | ||||
3378 | DECL_DECLARED_CONSTEXPR_P (fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3378, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3378, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3378, __FUNCTION__))->decl_common.lang_flag_8) = true; | ||||
3379 | if (kind == sfk_constructor) | ||||
3380 | TYPE_HAS_CONSTEXPR_CTOR (ctx)((((tree_class_check ((ctx), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3380, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_constexpr_ctor) = true; | ||||
3381 | } | ||||
3382 | |||||
3383 | if (!DECL_DECLARED_CONSTEXPR_P (implicit_fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( implicit_fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((implicit_fn ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3383, __FUNCTION__, (TEMPLATE_DECL))))))))->result : implicit_fn )), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3383, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3383, __FUNCTION__))->decl_common.lang_flag_8) | ||||
3384 | && DECL_DECLARED_CONSTEXPR_P (fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3384, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3384, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3384, __FUNCTION__))->decl_common.lang_flag_8)) | ||||
3385 | { | ||||
3386 | if (!CLASSTYPE_TEMPLATE_INSTANTIATION (ctx)(((((tree_class_check ((ctx), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3386, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) & 1)) | ||||
3387 | { | ||||
3388 | error ("explicitly defaulted function %q+D cannot be declared " | ||||
3389 | "%qs because the implicit declaration is not %qs:", fn, | ||||
3390 | DECL_IMMEDIATE_FUNCTION_P (fn)(((contains_struct_check (((tree_check (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__))->decl_common.lang_specific) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code ) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3390, __FUNCTION__); <->u.fn; })->immediate_fn_p : false) ? "consteval" : "constexpr", | ||||
3391 | "constexpr"); | ||||
3392 | explain_implicit_non_constexpr (fn); | ||||
3393 | } | ||||
3394 | DECL_DECLARED_CONSTEXPR_P (fn)((contains_struct_check (((tree_check2 (((((enum tree_code) ( fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3394, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3394, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3394, __FUNCTION__))->decl_common.lang_flag_8) = false; | ||||
3395 | } | ||||
3396 | } | ||||
3397 | |||||
3398 | /* Returns true iff FN can be explicitly defaulted, and gives any | ||||
3399 | errors if defaulting FN is ill-formed. */ | ||||
3400 | |||||
3401 | bool | ||||
3402 | defaultable_fn_check (tree fn) | ||||
3403 | { | ||||
3404 | special_function_kind kind = sfk_none; | ||||
3405 | |||||
3406 | if (template_parm_scope_p ()) | ||||
3407 | { | ||||
3408 | error ("a template cannot be defaulted"); | ||||
3409 | return false; | ||||
3410 | } | ||||
3411 | |||||
3412 | if (DECL_CONSTRUCTOR_P (fn)((tree_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3412, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3412, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) | ||||
3413 | { | ||||
3414 | if (FUNCTION_FIRST_USER_PARMTYPE (fn)skip_artificial_parms_for ((fn), ((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3414, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3414, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)) == void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) | ||||
3415 | kind = sfk_constructor; | ||||
3416 | else if (copy_fn_p (fn) > 0 | ||||
3417 | && (TREE_CHAIN (FUNCTION_FIRST_USER_PARMTYPE (fn))((contains_struct_check ((skip_artificial_parms_for ((fn), (( tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3417, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3417, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3417, __FUNCTION__))->common.chain) | ||||
3418 | == void_list_nodeglobal_trees[TI_VOID_LIST_NODE])) | ||||
3419 | kind = sfk_copy_constructor; | ||||
3420 | else if (move_fn_p (fn)) | ||||
3421 | kind = sfk_move_constructor; | ||||
3422 | } | ||||
3423 | else if (DECL_DESTRUCTOR_P (fn)((tree_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3423, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3423, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) | ||||
3424 | kind = sfk_destructor; | ||||
3425 | else if (DECL_ASSIGNMENT_OPERATOR_P (fn)(((((tree_not_check2 (((tree_check ((((contains_struct_check ( (fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1))) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3425, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)) | ||||
3426 | && DECL_OVERLOADED_OPERATOR_IS (fn, NOP_EXPR)((__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3426, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3426, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3426, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3426, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3426, __FUNCTION__); <->u.fn; })->ovl_op_code) == OVL_OP_NOP_EXPR)) | ||||
3427 | { | ||||
3428 | if (copy_fn_p (fn)) | ||||
3429 | kind = sfk_copy_assignment; | ||||
3430 | else if (move_fn_p (fn)) | ||||
3431 | kind = sfk_move_assignment; | ||||
3432 | } | ||||
3433 | else if (DECL_OVERLOADED_OPERATOR_CODE_RAW (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3433, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3433, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3433, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3433, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3433, __FUNCTION__); <->u.fn; })->ovl_op_code) >= OVL_OP_EQ_EXPR | ||||
3434 | && DECL_OVERLOADED_OPERATOR_CODE_RAW (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3434, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3434, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3434, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3434, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3434, __FUNCTION__); <->u.fn; })->ovl_op_code) <= OVL_OP_SPACESHIP_EXPR) | ||||
3435 | { | ||||
3436 | kind = sfk_comparison; | ||||
3437 | if (!early_check_defaulted_comparison (fn)) | ||||
3438 | return false; | ||||
3439 | } | ||||
3440 | |||||
3441 | if (kind == sfk_none) | ||||
3442 | { | ||||
3443 | error ("%qD cannot be defaulted", fn); | ||||
3444 | return false; | ||||
3445 | } | ||||
3446 | else | ||||
3447 | { | ||||
3448 | for (tree t = FUNCTION_FIRST_USER_PARMTYPE (fn)skip_artificial_parms_for ((fn), ((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3448, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3448, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); | ||||
3449 | t && t != void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3449, __FUNCTION__))->common.chain)) | ||||
3450 | if (TREE_PURPOSE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3450, __FUNCTION__, (TREE_LIST)))->list.purpose)) | ||||
3451 | { | ||||
3452 | error ("defaulted function %q+D with default argument", fn); | ||||
3453 | break; | ||||
3454 | } | ||||
3455 | |||||
3456 | /* Avoid do_warn_unused_parameter warnings. */ | ||||
3457 | for (tree p = FUNCTION_FIRST_USER_PARM (fn)skip_artificial_parms_for ((fn), ((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3457, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments )); p; p = DECL_CHAIN (p)(((contains_struct_check (((contains_struct_check ((p), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3457, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3457, __FUNCTION__))->common.chain))) | ||||
3458 | if (DECL_NAME (p)((contains_struct_check ((p), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3458, __FUNCTION__))->decl_minimal.name)) | ||||
3459 | suppress_warning (p, OPT_Wunused_parameter); | ||||
3460 | |||||
3461 | if (current_class_typescope_chain->class_type && TYPE_BEING_DEFINED (current_class_type)((((tree_class_check ((scope_chain->class_type), (tcc_type ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3461, __FUNCTION__))->type_with_lang_specific.lang_specific ))->being_defined)) | ||||
3462 | /* Defer checking. */; | ||||
3463 | else if (!processing_template_declscope_chain->x_processing_template_decl) | ||||
3464 | defaulted_late_check (fn); | ||||
3465 | |||||
3466 | return true; | ||||
3467 | } | ||||
3468 | } | ||||
3469 | |||||
3470 | /* Add an implicit declaration to TYPE for the kind of function | ||||
3471 | indicated by SFK. Return the FUNCTION_DECL for the new implicit | ||||
3472 | declaration. */ | ||||
3473 | |||||
3474 | tree | ||||
3475 | lazily_declare_fn (special_function_kind sfk, tree type) | ||||
3476 | { | ||||
3477 | tree fn; | ||||
3478 | /* Whether or not the argument has a const reference type. */ | ||||
3479 | bool const_p = false; | ||||
3480 | |||||
3481 | type = TYPE_MAIN_VARIANT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3481, __FUNCTION__))->type_common.main_variant); | ||||
3482 | |||||
3483 | switch (sfk) | ||||
3484 | { | ||||
3485 | case sfk_constructor: | ||||
3486 | CLASSTYPE_LAZY_DEFAULT_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3486, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_default_ctor) = 0; | ||||
3487 | break; | ||||
3488 | case sfk_copy_constructor: | ||||
3489 | const_p = TYPE_HAS_CONST_COPY_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3489, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_ctor); | ||||
3490 | CLASSTYPE_LAZY_COPY_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3490, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_copy_ctor) = 0; | ||||
3491 | break; | ||||
3492 | case sfk_move_constructor: | ||||
3493 | CLASSTYPE_LAZY_MOVE_CTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3493, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_move_ctor) = 0; | ||||
3494 | break; | ||||
3495 | case sfk_copy_assignment: | ||||
3496 | const_p = TYPE_HAS_CONST_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3496, __FUNCTION__))->type_with_lang_specific.lang_specific ))->has_const_copy_assign); | ||||
3497 | CLASSTYPE_LAZY_COPY_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3497, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_copy_assign) = 0; | ||||
3498 | break; | ||||
3499 | case sfk_move_assignment: | ||||
3500 | CLASSTYPE_LAZY_MOVE_ASSIGN (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3500, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_move_assign) = 0; | ||||
3501 | break; | ||||
3502 | case sfk_destructor: | ||||
3503 | CLASSTYPE_LAZY_DESTRUCTOR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3503, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lazy_destructor) = 0; | ||||
3504 | break; | ||||
3505 | default: | ||||
3506 | gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3506, __FUNCTION__)); | ||||
3507 | } | ||||
3508 | |||||
3509 | /* Declare the function. */ | ||||
3510 | fn = implicitly_declare_fn (sfk, type, const_p, NULL__null, NULL__null); | ||||
3511 | |||||
3512 | /* [class.copy]/8 If the class definition declares a move constructor or | ||||
3513 | move assignment operator, the implicitly declared copy constructor is | ||||
3514 | defined as deleted.... */ | ||||
3515 | if ((sfk == sfk_copy_assignment || sfk == sfk_copy_constructor) | ||||
3516 | && cxx_dialect >= cxx11) | ||||
3517 | { | ||||
3518 | if (classtype_has_move_assign_or_move_ctor_p (type, true)) | ||||
3519 | DECL_DELETED_FN (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3519, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3519, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3519, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3519, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3519, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) = true; | ||||
3520 | else if (classtype_has_depr_implicit_copy (type)) | ||||
3521 | /* The implicit definition of a copy constructor as defaulted is | ||||
3522 | deprecated if the class has a user-declared copy assignment operator | ||||
3523 | or a user-declared destructor. The implicit definition of a copy | ||||
3524 | assignment operator as defaulted is deprecated if the class has a | ||||
3525 | user-declared copy constructor or a user-declared destructor (15.4, | ||||
3526 | 15.8). */ | ||||
3527 | TREE_DEPRECATED (fn)((fn)->base.deprecated_flag) = true; | ||||
3528 | } | ||||
3529 | |||||
3530 | /* Destructors and assignment operators may be virtual. */ | ||||
3531 | if (sfk == sfk_destructor | ||||
3532 | || sfk == sfk_move_assignment | ||||
3533 | || sfk == sfk_copy_assignment) | ||||
3534 | check_for_override (fn, type); | ||||
3535 | |||||
3536 | /* Add it to the class */ | ||||
3537 | bool added = add_method (type, fn, false); | ||||
3538 | gcc_assert (added || errorcount)((void)(!(added || (global_dc)->diagnostic_count[(int) (DK_ERROR )]) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3538, __FUNCTION__), 0 : 0)); | ||||
3539 | |||||
3540 | /* Add it to TYPE_FIELDS. */ | ||||
3541 | if (sfk == sfk_destructor | ||||
3542 | && DECL_VIRTUAL_P (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3542, __FUNCTION__))->decl_common.virtual_flag)) | ||||
3543 | /* The ABI requires that a virtual destructor go at the end of the | ||||
3544 | vtable. */ | ||||
3545 | TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3545, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = chainon (TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3545, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values), fn); | ||||
3546 | else | ||||
3547 | { | ||||
3548 | DECL_CHAIN (fn)(((contains_struct_check (((contains_struct_check ((fn), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3548, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3548, __FUNCTION__))->common.chain)) = TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3548, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values); | ||||
3549 | TYPE_FIELDS (type)((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3549, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values) = fn; | ||||
3550 | } | ||||
3551 | /* Propagate TYPE_FIELDS. */ | ||||
3552 | fixup_type_variants (type); | ||||
3553 | |||||
3554 | maybe_add_class_template_decl_list (type, fn, /*friend_p=*/0); | ||||
3555 | if (DECL_MAYBE_IN_CHARGE_CDTOR_P (fn)((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3555, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((fn), (TS_DECL_MINIMAL ), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3555, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]))) | ||||
3556 | /* Create appropriate clones. */ | ||||
3557 | clone_cdtor (fn, /*update_methods=*/true); | ||||
3558 | |||||
3559 | return fn; | ||||
3560 | } | ||||
3561 | |||||
3562 | /* Given a FUNCTION_DECL FN and a chain LIST, skip as many elements of LIST | ||||
3563 | as there are artificial parms in FN. */ | ||||
3564 | |||||
3565 | tree | ||||
3566 | skip_artificial_parms_for (const_tree fn, tree list) | ||||
3567 | { | ||||
3568 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3568, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) | ||||
3569 | list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3569, __FUNCTION__))->common.chain); | ||||
3570 | else | ||||
3571 | return list; | ||||
3572 | |||||
3573 | if (DECL_HAS_IN_CHARGE_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3573, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3573, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3573, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3573, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3573, __FUNCTION__); <->u.fn; })->has_in_charge_parm_p )) | ||||
3574 | list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3574, __FUNCTION__))->common.chain); | ||||
3575 | if (DECL_HAS_VTT_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3575, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3575, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3575, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3575, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3575, __FUNCTION__); <->u.fn; })->has_vtt_parm_p )) | ||||
3576 | list = TREE_CHAIN (list)((contains_struct_check ((list), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3576, __FUNCTION__))->common.chain); | ||||
3577 | return list; | ||||
3578 | } | ||||
3579 | |||||
3580 | /* Given a FUNCTION_DECL FN and a chain LIST, return the number of | ||||
3581 | artificial parms in FN. */ | ||||
3582 | |||||
3583 | int | ||||
3584 | num_artificial_parms_for (const_tree fn) | ||||
3585 | { | ||||
3586 | int count = 0; | ||||
3587 | |||||
3588 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED) , "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3588, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) | ||||
3589 | count++; | ||||
3590 | else | ||||
3591 | return 0; | ||||
3592 | |||||
3593 | if (DECL_HAS_IN_CHARGE_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3593, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3593, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3593, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3593, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3593, __FUNCTION__); <->u.fn; })->has_in_charge_parm_p )) | ||||
3594 | count++; | ||||
3595 | if (DECL_HAS_VTT_PARM_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3595, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3595, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (fn)->base.code) == FUNCTION_DECL || ((( enum tree_code) (fn)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3595, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3595, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/method.cc" , 3595, __FUNCTION__); <->u.fn; })->has_vtt_parm_p )) | ||||
3596 | count++; | ||||
3597 | return count; | ||||
3598 | } | ||||
3599 | |||||
3600 | |||||
3601 | #include "gt-cp-method.h" |
1 | /* Vector API for GNU compiler. | ||||
2 | Copyright (C) 2004-2023 Free Software Foundation, Inc. | ||||
3 | Contributed by Nathan Sidwell <nathan@codesourcery.com> | ||||
4 | Re-implemented in C++ by Diego Novillo <dnovillo@google.com> | ||||
5 | |||||
6 | This file is part of GCC. | ||||
7 | |||||
8 | GCC is free software; you can redistribute it and/or modify it under | ||||
9 | the terms of the GNU General Public License as published by the Free | ||||
10 | Software Foundation; either version 3, or (at your option) any later | ||||
11 | version. | ||||
12 | |||||
13 | GCC is distributed in the hope that it will be useful, but WITHOUT ANY | ||||
14 | WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||||
15 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||||
16 | for more details. | ||||
17 | |||||
18 | You should have received a copy of the GNU General Public License | ||||
19 | along with GCC; see the file COPYING3. If not see | ||||
20 | <http://www.gnu.org/licenses/>. */ | ||||
21 | |||||
22 | #ifndef GCC_VEC_H | ||||
23 | #define GCC_VEC_H | ||||
24 | |||||
25 | /* Some gen* file have no ggc support as the header file gtype-desc.h is | ||||
26 | missing. Provide these definitions in case ggc.h has not been included. | ||||
27 | This is not a problem because any code that runs before gengtype is built | ||||
28 | will never need to use GC vectors.*/ | ||||
29 | |||||
30 | extern void ggc_free (void *); | ||||
31 | extern size_t ggc_round_alloc_size (size_t requested_size); | ||||
32 | extern void *ggc_realloc (void *, size_t MEM_STAT_DECL); | ||||
33 | |||||
34 | /* Templated vector type and associated interfaces. | ||||
35 | |||||
36 | The interface functions are typesafe and use inline functions, | ||||
37 | sometimes backed by out-of-line generic functions. The vectors are | ||||
38 | designed to interoperate with the GTY machinery. | ||||
39 | |||||
40 | There are both 'index' and 'iterate' accessors. The index accessor | ||||
41 | is implemented by operator[]. The iterator returns a boolean | ||||
42 | iteration condition and updates the iteration variable passed by | ||||
43 | reference. Because the iterator will be inlined, the address-of | ||||
44 | can be optimized away. | ||||
45 | |||||
46 | Each operation that increases the number of active elements is | ||||
47 | available in 'quick' and 'safe' variants. The former presumes that | ||||
48 | there is sufficient allocated space for the operation to succeed | ||||
49 | (it dies if there is not). The latter will reallocate the | ||||
50 | vector, if needed. Reallocation causes an exponential increase in | ||||
51 | vector size. If you know you will be adding N elements, it would | ||||
52 | be more efficient to use the reserve operation before adding the | ||||
53 | elements with the 'quick' operation. This will ensure there are at | ||||
54 | least as many elements as you ask for, it will exponentially | ||||
55 | increase if there are too few spare slots. If you want reserve a | ||||
56 | specific number of slots, but do not want the exponential increase | ||||
57 | (for instance, you know this is the last allocation), use the | ||||
58 | reserve_exact operation. You can also create a vector of a | ||||
59 | specific size from the get go. | ||||
60 | |||||
61 | You should prefer the push and pop operations, as they append and | ||||
62 | remove from the end of the vector. If you need to remove several | ||||
63 | items in one go, use the truncate operation. The insert and remove | ||||
64 | operations allow you to change elements in the middle of the | ||||
65 | vector. There are two remove operations, one which preserves the | ||||
66 | element ordering 'ordered_remove', and one which does not | ||||
67 | 'unordered_remove'. The latter function copies the end element | ||||
68 | into the removed slot, rather than invoke a memmove operation. The | ||||
69 | 'lower_bound' function will determine where to place an item in the | ||||
70 | array using insert that will maintain sorted order. | ||||
71 | |||||
72 | Vectors are template types with three arguments: the type of the | ||||
73 | elements in the vector, the allocation strategy, and the physical | ||||
74 | layout to use | ||||
75 | |||||
76 | Four allocation strategies are supported: | ||||
77 | |||||
78 | - Heap: allocation is done using malloc/free. This is the | ||||
79 | default allocation strategy. | ||||
80 | |||||
81 | - GC: allocation is done using ggc_alloc/ggc_free. | ||||
82 | |||||
83 | - GC atomic: same as GC with the exception that the elements | ||||
84 | themselves are assumed to be of an atomic type that does | ||||
85 | not need to be garbage collected. This means that marking | ||||
86 | routines do not need to traverse the array marking the | ||||
87 | individual elements. This increases the performance of | ||||
88 | GC activities. | ||||
89 | |||||
90 | Two physical layouts are supported: | ||||
91 | |||||
92 | - Embedded: The vector is structured using the trailing array | ||||
93 | idiom. The last member of the structure is an array of size | ||||
94 | 1. When the vector is initially allocated, a single memory | ||||
95 | block is created to hold the vector's control data and the | ||||
96 | array of elements. These vectors cannot grow without | ||||
97 | reallocation (see discussion on embeddable vectors below). | ||||
98 | |||||
99 | - Space efficient: The vector is structured as a pointer to an | ||||
100 | embedded vector. This is the default layout. It means that | ||||
101 | vectors occupy a single word of storage before initial | ||||
102 | allocation. Vectors are allowed to grow (the internal | ||||
103 | pointer is reallocated but the main vector instance does not | ||||
104 | need to relocate). | ||||
105 | |||||
106 | The type, allocation and layout are specified when the vector is | ||||
107 | declared. | ||||
108 | |||||
109 | If you need to directly manipulate a vector, then the 'address' | ||||
110 | accessor will return the address of the start of the vector. Also | ||||
111 | the 'space' predicate will tell you whether there is spare capacity | ||||
112 | in the vector. You will not normally need to use these two functions. | ||||
113 | |||||
114 | Notes on the different layout strategies | ||||
115 | |||||
116 | * Embeddable vectors (vec<T, A, vl_embed>) | ||||
117 | |||||
118 | These vectors are suitable to be embedded in other data | ||||
119 | structures so that they can be pre-allocated in a contiguous | ||||
120 | memory block. | ||||
121 | |||||
122 | Embeddable vectors are implemented using the trailing array | ||||
123 | idiom, thus they are not resizeable without changing the address | ||||
124 | of the vector object itself. This means you cannot have | ||||
125 | variables or fields of embeddable vector type -- always use a | ||||
126 | pointer to a vector. The one exception is the final field of a | ||||
127 | structure, which could be a vector type. | ||||
128 | |||||
129 | You will have to use the embedded_size & embedded_init calls to | ||||
130 | create such objects, and they will not be resizeable (so the | ||||
131 | 'safe' allocation variants are not available). | ||||
132 | |||||
133 | Properties of embeddable vectors: | ||||
134 | |||||
135 | - The whole vector and control data are allocated in a single | ||||
136 | contiguous block. It uses the trailing-vector idiom, so | ||||
137 | allocation must reserve enough space for all the elements | ||||
138 | in the vector plus its control data. | ||||
139 | - The vector cannot be re-allocated. | ||||
140 | - The vector cannot grow nor shrink. | ||||
141 | - No indirections needed for access/manipulation. | ||||
142 | - It requires 2 words of storage (prior to vector allocation). | ||||
143 | |||||
144 | |||||
145 | * Space efficient vector (vec<T, A, vl_ptr>) | ||||
146 | |||||
147 | These vectors can grow dynamically and are allocated together | ||||
148 | with their control data. They are suited to be included in data | ||||
149 | structures. Prior to initial allocation, they only take a single | ||||
150 | word of storage. | ||||
151 | |||||
152 | These vectors are implemented as a pointer to embeddable vectors. | ||||
153 | The semantics allow for this pointer to be NULL to represent | ||||
154 | empty vectors. This way, empty vectors occupy minimal space in | ||||
155 | the structure containing them. | ||||
156 | |||||
157 | Properties: | ||||
158 | |||||
159 | - The whole vector and control data are allocated in a single | ||||
160 | contiguous block. | ||||
161 | - The whole vector may be re-allocated. | ||||
162 | - Vector data may grow and shrink. | ||||
163 | - Access and manipulation requires a pointer test and | ||||
164 | indirection. | ||||
165 | - It requires 1 word of storage (prior to vector allocation). | ||||
166 | |||||
167 | An example of their use would be, | ||||
168 | |||||
169 | struct my_struct { | ||||
170 | // A space-efficient vector of tree pointers in GC memory. | ||||
171 | vec<tree, va_gc, vl_ptr> v; | ||||
172 | }; | ||||
173 | |||||
174 | struct my_struct *s; | ||||
175 | |||||
176 | if (s->v.length ()) { we have some contents } | ||||
177 | s->v.safe_push (decl); // append some decl onto the end | ||||
178 | for (ix = 0; s->v.iterate (ix, &elt); ix++) | ||||
179 | { do something with elt } | ||||
180 | */ | ||||
181 | |||||
182 | /* Support function for statistics. */ | ||||
183 | extern void dump_vec_loc_statistics (void); | ||||
184 | |||||
185 | /* Hashtable mapping vec addresses to descriptors. */ | ||||
186 | extern htab_t vec_mem_usage_hash; | ||||
187 | |||||
188 | /* Control data for vectors. This contains the number of allocated | ||||
189 | and used slots inside a vector. */ | ||||
190 | |||||
191 | struct vec_prefix | ||||
192 | { | ||||
193 | /* FIXME - These fields should be private, but we need to cater to | ||||
194 | compilers that have stricter notions of PODness for types. */ | ||||
195 | |||||
196 | /* Memory allocation support routines in vec.cc. */ | ||||
197 | void register_overhead (void *, size_t, size_t CXX_MEM_STAT_INFO); | ||||
198 | void release_overhead (void *, size_t, size_t, bool CXX_MEM_STAT_INFO); | ||||
199 | static unsigned calculate_allocation (vec_prefix *, unsigned, bool); | ||||
200 | static unsigned calculate_allocation_1 (unsigned, unsigned); | ||||
201 | |||||
202 | /* Note that vec_prefix should be a base class for vec, but we use | ||||
203 | offsetof() on vector fields of tree structures (e.g., | ||||
204 | tree_binfo::base_binfos), and offsetof only supports base types. | ||||
205 | |||||
206 | To compensate, we make vec_prefix a field inside vec and make | ||||
207 | vec a friend class of vec_prefix so it can access its fields. */ | ||||
208 | template <typename, typename, typename> friend struct vec; | ||||
209 | |||||
210 | /* The allocator types also need access to our internals. */ | ||||
211 | friend struct va_gc; | ||||
212 | friend struct va_gc_atomic; | ||||
213 | friend struct va_heap; | ||||
214 | |||||
215 | unsigned m_alloc : 31; | ||||
216 | unsigned m_using_auto_storage : 1; | ||||
217 | unsigned m_num; | ||||
218 | }; | ||||
219 | |||||
220 | /* Calculate the number of slots to reserve a vector, making sure that | ||||
221 | RESERVE slots are free. If EXACT grow exactly, otherwise grow | ||||
222 | exponentially. PFX is the control data for the vector. */ | ||||
223 | |||||
224 | inline unsigned | ||||
225 | vec_prefix::calculate_allocation (vec_prefix *pfx, unsigned reserve, | ||||
226 | bool exact) | ||||
227 | { | ||||
228 | if (exact) | ||||
229 | return (pfx ? pfx->m_num : 0) + reserve; | ||||
230 | else if (!pfx) | ||||
231 | return MAX (4, reserve)((4) > (reserve) ? (4) : (reserve)); | ||||
232 | return calculate_allocation_1 (pfx->m_alloc, pfx->m_num + reserve); | ||||
233 | } | ||||
234 | |||||
235 | template<typename, typename, typename> struct vec; | ||||
236 | |||||
237 | /* Valid vector layouts | ||||
238 | |||||
239 | vl_embed - Embeddable vector that uses the trailing array idiom. | ||||
240 | vl_ptr - Space efficient vector that uses a pointer to an | ||||
241 | embeddable vector. */ | ||||
242 | struct vl_embed { }; | ||||
243 | struct vl_ptr { }; | ||||
244 | |||||
245 | |||||
246 | /* Types of supported allocations | ||||
247 | |||||
248 | va_heap - Allocation uses malloc/free. | ||||
249 | va_gc - Allocation uses ggc_alloc. | ||||
250 | va_gc_atomic - Same as GC, but individual elements of the array | ||||
251 | do not need to be marked during collection. */ | ||||
252 | |||||
253 | /* Allocator type for heap vectors. */ | ||||
254 | struct va_heap | ||||
255 | { | ||||
256 | /* Heap vectors are frequently regular instances, so use the vl_ptr | ||||
257 | layout for them. */ | ||||
258 | typedef vl_ptr default_layout; | ||||
259 | |||||
260 | template<typename T> | ||||
261 | static void reserve (vec<T, va_heap, vl_embed> *&, unsigned, bool | ||||
262 | CXX_MEM_STAT_INFO); | ||||
263 | |||||
264 | template<typename T> | ||||
265 | static void release (vec<T, va_heap, vl_embed> *&); | ||||
266 | }; | ||||
267 | |||||
268 | |||||
269 | /* Allocator for heap memory. Ensure there are at least RESERVE free | ||||
270 | slots in V. If EXACT is true, grow exactly, else grow | ||||
271 | exponentially. As a special case, if the vector had not been | ||||
272 | allocated and RESERVE is 0, no vector will be created. */ | ||||
273 | |||||
274 | template<typename T> | ||||
275 | inline void | ||||
276 | va_heap::reserve (vec<T, va_heap, vl_embed> *&v, unsigned reserve, bool exact | ||||
277 | MEM_STAT_DECL) | ||||
278 | { | ||||
279 | size_t elt_size = sizeof (T); | ||||
280 | unsigned alloc | ||||
281 | = vec_prefix::calculate_allocation (v ? &v->m_vecpfx : 0, reserve, exact); | ||||
282 | gcc_checking_assert (alloc)((void)(!(alloc) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/vec.h" , 282, __FUNCTION__), 0 : 0)); | ||||
283 | |||||
284 | if (GATHER_STATISTICS0 && v) | ||||
285 | v->m_vecpfx.release_overhead (v, elt_size * v->allocated (), | ||||
286 | v->allocated (), false); | ||||
287 | |||||
288 | size_t size = vec<T, va_heap, vl_embed>::embedded_size (alloc); | ||||
289 | unsigned nelem = v ? v->length () : 0; | ||||
290 | v = static_cast <vec<T, va_heap, vl_embed> *> (xrealloc (v, size)); | ||||
291 | v->embedded_init (alloc, nelem); | ||||
292 | |||||
293 | if (GATHER_STATISTICS0) | ||||
294 | v->m_vecpfx.register_overhead (v, alloc, elt_size PASS_MEM_STAT); | ||||
295 | } | ||||
296 | |||||
297 | |||||
298 | #if GCC_VERSION(4 * 1000 + 2) >= 4007 | ||||
299 | #pragma GCC diagnostic push | ||||
300 | #pragma GCC diagnostic ignored "-Wfree-nonheap-object" | ||||
301 | #endif | ||||
302 | |||||
303 | /* Free the heap space allocated for vector V. */ | ||||
304 | |||||
305 | template<typename T> | ||||
306 | void | ||||
307 | va_heap::release (vec<T, va_heap, vl_embed> *&v) | ||||
308 | { | ||||
309 | size_t elt_size = sizeof (T); | ||||
310 | if (v == NULL__null) | ||||
311 | return; | ||||
312 | |||||
313 | if (GATHER_STATISTICS0) | ||||
314 | v->m_vecpfx.release_overhead (v, elt_size * v->allocated (), | ||||
315 | v->allocated (), true); | ||||
316 | ::free (v); | ||||
317 | v = NULL__null; | ||||
318 | } | ||||
319 | |||||
320 | #if GCC_VERSION(4 * 1000 + 2) >= 4007 | ||||
321 | #pragma GCC diagnostic pop | ||||
322 | #endif | ||||
323 | |||||
324 | /* Allocator type for GC vectors. Notice that we need the structure | ||||
325 | declaration even if GC is not enabled. */ | ||||
326 | |||||
327 | struct va_gc | ||||
328 | { | ||||
329 | /* Use vl_embed as the default layout for GC vectors. Due to GTY | ||||
330 | limitations, GC vectors must always be pointers, so it is more | ||||
331 | efficient to use a pointer to the vl_embed layout, rather than | ||||
332 | using a pointer to a pointer as would be the case with vl_ptr. */ | ||||
333 | typedef vl_embed default_layout; | ||||
334 | |||||
335 | template<typename T, typename A> | ||||
336 | static void reserve (vec<T, A, vl_embed> *&, unsigned, bool | ||||
337 | CXX_MEM_STAT_INFO); | ||||
338 | |||||
339 | template<typename T, typename A> | ||||
340 | static void release (vec<T, A, vl_embed> *&v); | ||||
341 | }; | ||||
342 | |||||
343 | |||||
344 | /* Free GC memory used by V and reset V to NULL. */ | ||||
345 | |||||
346 | template<typename T, typename A> | ||||
347 | inline void | ||||
348 | va_gc::release (vec<T, A, vl_embed> *&v) | ||||
349 | { | ||||
350 | if (v) | ||||
351 | ::ggc_free (v); | ||||
352 | v = NULL__null; | ||||
353 | } | ||||
354 | |||||
355 | |||||
356 | /* Allocator for GC memory. Ensure there are at least RESERVE free | ||||
357 | slots in V. If EXACT is true, grow exactly, else grow | ||||
358 | exponentially. As a special case, if the vector had not been | ||||
359 | allocated and RESERVE is 0, no vector will be created. */ | ||||
360 | |||||
361 | template<typename T, typename A> | ||||
362 | void | ||||
363 | va_gc::reserve (vec<T, A, vl_embed> *&v, unsigned reserve, bool exact | ||||
364 | MEM_STAT_DECL) | ||||
365 | { | ||||
366 | unsigned alloc | ||||
367 | = vec_prefix::calculate_allocation (v
| ||||
368 | if (!alloc) | ||||
369 | { | ||||
370 | ::ggc_free (v); | ||||
371 | v = NULL__null; | ||||
372 | return; | ||||
373 | } | ||||
374 | |||||
375 | /* Calculate the amount of space we want. */ | ||||
376 | size_t size = vec<T, A, vl_embed>::embedded_size (alloc); | ||||
377 | |||||
378 | /* Ask the allocator how much space it will really give us. */ | ||||
379 | size = ::ggc_round_alloc_size (size); | ||||
380 | |||||
381 | /* Adjust the number of slots accordingly. */ | ||||
382 | size_t vec_offset = sizeof (vec_prefix); | ||||
383 | size_t elt_size = sizeof (T); | ||||
384 | alloc = (size - vec_offset) / elt_size; | ||||
385 | |||||
386 | /* And finally, recalculate the amount of space we ask for. */ | ||||
387 | size = vec_offset + alloc * elt_size; | ||||
388 | |||||
389 | unsigned nelem = v ? v->length () : 0; | ||||
390 | v = static_cast <vec<T, A, vl_embed> *> (::ggc_realloc (v, size | ||||
391 | PASS_MEM_STAT)); | ||||
392 | v->embedded_init (alloc, nelem); | ||||
393 | } | ||||
394 | |||||
395 | |||||
396 | /* Allocator type for GC vectors. This is for vectors of types | ||||
397 | atomics w.r.t. collection, so allocation and deallocation is | ||||
398 | completely inherited from va_gc. */ | ||||
399 | struct va_gc_atomic : va_gc | ||||
400 | { | ||||
401 | }; | ||||
402 | |||||
403 | |||||
404 | /* Generic vector template. Default values for A and L indicate the | ||||
405 | most commonly used strategies. | ||||
406 | |||||
407 | FIXME - Ideally, they would all be vl_ptr to encourage using regular | ||||
408 | instances for vectors, but the existing GTY machinery is limited | ||||
409 | in that it can only deal with GC objects that are pointers | ||||
410 | themselves. | ||||
411 | |||||
412 | This means that vector operations that need to deal with | ||||
413 | potentially NULL pointers, must be provided as free | ||||
414 | functions (see the vec_safe_* functions above). */ | ||||
415 | template<typename T, | ||||
416 | typename A = va_heap, | ||||
417 | typename L = typename A::default_layout> | ||||
418 | struct GTY((user)) vec | ||||
419 | { | ||||
420 | }; | ||||
421 | |||||
422 | /* Allow C++11 range-based 'for' to work directly on vec<T>*. */ | ||||
423 | template<typename T, typename A, typename L> | ||||
424 | T* begin (vec<T,A,L> *v) { return v ? v->begin () : nullptr; } | ||||
425 | template<typename T, typename A, typename L> | ||||
426 | T* end (vec<T,A,L> *v) { return v ? v->end () : nullptr; } | ||||
427 | template<typename T, typename A, typename L> | ||||
428 | const T* begin (const vec<T,A,L> *v) { return v ? v->begin () : nullptr; } | ||||
429 | template<typename T, typename A, typename L> | ||||
430 | const T* end (const vec<T,A,L> *v) { return v ? v->end () : nullptr; } | ||||
431 | |||||
432 | /* Generic vec<> debug helpers. | ||||
433 | |||||
434 | These need to be instantiated for each vec<TYPE> used throughout | ||||
435 | the compiler like this: | ||||
436 | |||||
437 | DEFINE_DEBUG_VEC (TYPE) | ||||
438 | |||||
439 | The reason we have a debug_helper() is because GDB can't | ||||
440 | disambiguate a plain call to debug(some_vec), and it must be called | ||||
441 | like debug<TYPE>(some_vec). */ | ||||
442 | |||||
443 | template<typename T> | ||||
444 | void | ||||
445 | debug_helper (vec<T> &ref) | ||||
446 | { | ||||
447 | unsigned i; | ||||
448 | for (i = 0; i < ref.length (); ++i) | ||||
449 | { | ||||
450 | fprintf (stderrstderr, "[%d] = ", i); | ||||
451 | debug_slim (ref[i]); | ||||
452 | fputc ('\n', stderrstderr); | ||||
453 | } | ||||
454 | } | ||||
455 | |||||
456 | /* We need a separate va_gc variant here because default template | ||||
457 | argument for functions cannot be used in c++-98. Once this | ||||
458 | restriction is removed, those variant should be folded with the | ||||
459 | above debug_helper. */ | ||||
460 | |||||
461 | template<typename T> | ||||
462 | void | ||||
463 | debug_helper (vec<T, va_gc> &ref) | ||||
464 | { | ||||
465 | unsigned i; | ||||
466 | for (i = 0; i < ref.length (); ++i) | ||||
467 | { | ||||
468 | fprintf (stderrstderr, "[%d] = ", i); | ||||
469 | debug_slim (ref[i]); | ||||
470 | fputc ('\n', stderrstderr); | ||||
471 | } | ||||
472 | } | ||||
473 | |||||
474 | /* Macro to define debug(vec<T>) and debug(vec<T, va_gc>) helper | ||||
475 | functions for a type T. */ | ||||
476 | |||||
477 | #define DEFINE_DEBUG_VEC(T)template void debug_helper (vec<T> &); template void debug_helper (vec<T, va_gc> &); __attribute__ ((__used__ )) void debug (vec<T> &ref) { debug_helper <T> (ref); } __attribute__ ((__used__)) void debug (vec<T> *ptr) { if (ptr) debug (*ptr); else fprintf (stderr, "<nil>\n" ); } __attribute__ ((__used__)) void debug (vec<T, va_gc> &ref) { debug_helper <T> (ref); } __attribute__ (( __used__)) void debug (vec<T, va_gc> *ptr) { if (ptr) debug (*ptr); else fprintf (stderr, "<nil>\n"); } \ | ||||
478 | template void debug_helper (vec<T> &); \ | ||||
479 | template void debug_helper (vec<T, va_gc> &); \ | ||||
480 | /* Define the vec<T> debug functions. */ \ | ||||
481 | DEBUG_FUNCTION__attribute__ ((__used__)) void \ | ||||
482 | debug (vec<T> &ref) \ | ||||
483 | { \ | ||||
484 | debug_helper <T> (ref); \ | ||||
485 | } \ | ||||
486 | DEBUG_FUNCTION__attribute__ ((__used__)) void \ | ||||
487 | debug (vec<T> *ptr) \ | ||||
488 | { \ | ||||
489 | if (ptr) \ | ||||
490 | debug (*ptr); \ | ||||
491 | else \ | ||||
492 | fprintf (stderrstderr, "<nil>\n"); \ | ||||
493 | } \ | ||||