File: | build/gcc/cp/pt.c |
Warning: | line 29246, column 4 Value stored to 'call' is never read |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
1 | /* Handle parameterized types (templates) for GNU -*- C++ -*-. |
2 | Copyright (C) 1992-2021 Free Software Foundation, Inc. |
3 | Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. |
4 | Rewritten by Jason Merrill (jason@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 | /* Known bugs or deficiencies include: |
23 | |
24 | all methods must be provided in header files; can't use a source |
25 | file that contains only the method templates and "just win". |
26 | |
27 | Fixed by: C++20 modules. */ |
28 | |
29 | #include "config.h" |
30 | #include "system.h" |
31 | #include "coretypes.h" |
32 | #include "cp-tree.h" |
33 | #include "timevar.h" |
34 | #include "stringpool.h" |
35 | #include "varasm.h" |
36 | #include "attribs.h" |
37 | #include "stor-layout.h" |
38 | #include "intl.h" |
39 | #include "c-family/c-objc.h" |
40 | #include "cp-objcp-common.h" |
41 | #include "toplev.h" |
42 | #include "tree-iterator.h" |
43 | #include "type-utils.h" |
44 | #include "gimplify.h" |
45 | #include "gcc-rich-location.h" |
46 | #include "selftest.h" |
47 | #include "target.h" |
48 | |
49 | /* The type of functions taking a tree, and some additional data, and |
50 | returning an int. */ |
51 | typedef int (*tree_fn_t) (tree, void*); |
52 | |
53 | /* The PENDING_TEMPLATES is a list of templates whose instantiations |
54 | have been deferred, either because their definitions were not yet |
55 | available, or because we were putting off doing the work. */ |
56 | struct GTY ((chain_next ("%h.next"))) pending_template |
57 | { |
58 | struct pending_template *next; |
59 | struct tinst_level *tinst; |
60 | }; |
61 | |
62 | static GTY(()) struct pending_template *pending_templates; |
63 | static GTY(()) struct pending_template *last_pending_template; |
64 | |
65 | int processing_template_parmlist; |
66 | static int template_header_count; |
67 | |
68 | static GTY(()) tree saved_trees; |
69 | static vec<int> inline_parm_levels; |
70 | |
71 | static GTY(()) struct tinst_level *current_tinst_level; |
72 | |
73 | static GTY(()) vec<tree, va_gc> *saved_access_scope; |
74 | |
75 | /* Live only within one (recursive) call to tsubst_expr. We use |
76 | this to pass the statement expression node from the STMT_EXPR |
77 | to the EXPR_STMT that is its result. */ |
78 | static tree cur_stmt_expr; |
79 | |
80 | // -------------------------------------------------------------------------- // |
81 | // Local Specialization Stack |
82 | // |
83 | // Implementation of the RAII helper for creating new local |
84 | // specializations. |
85 | local_specialization_stack::local_specialization_stack (lss_policy policy) |
86 | : saved (local_specializationsscope_chain->x_local_specializations) |
87 | { |
88 | if (policy == lss_nop) |
89 | ; |
90 | else if (policy == lss_blank || !saved) |
91 | local_specializationsscope_chain->x_local_specializations = new hash_map<tree, tree>; |
92 | else |
93 | local_specializationsscope_chain->x_local_specializations = new hash_map<tree, tree>(*saved); |
94 | } |
95 | |
96 | local_specialization_stack::~local_specialization_stack () |
97 | { |
98 | if (local_specializationsscope_chain->x_local_specializations != saved) |
99 | { |
100 | delete local_specializationsscope_chain->x_local_specializations; |
101 | local_specializationsscope_chain->x_local_specializations = saved; |
102 | } |
103 | } |
104 | |
105 | /* True if we've recursed into fn_type_unification too many times. */ |
106 | static bool excessive_deduction_depth; |
107 | |
108 | struct spec_hasher : ggc_ptr_hash<spec_entry> |
109 | { |
110 | static hashval_t hash (spec_entry *); |
111 | static bool equal (spec_entry *, spec_entry *); |
112 | }; |
113 | |
114 | /* The general template is not in these tables. */ |
115 | typedef hash_table<spec_hasher> spec_hash_table; |
116 | static GTY (()) spec_hash_table *decl_specializations; |
117 | static GTY (()) spec_hash_table *type_specializations; |
118 | |
119 | /* Contains canonical template parameter types. The vector is indexed by |
120 | the TEMPLATE_TYPE_IDX of the template parameter. Each element is a |
121 | TREE_LIST, whose TREE_VALUEs contain the canonical template |
122 | parameters of various types and levels. */ |
123 | static GTY(()) vec<tree, va_gc> *canonical_template_parms; |
124 | |
125 | #define UNIFY_ALLOW_NONE0 0 |
126 | #define UNIFY_ALLOW_MORE_CV_QUAL1 1 |
127 | #define UNIFY_ALLOW_LESS_CV_QUAL2 2 |
128 | #define UNIFY_ALLOW_DERIVED4 4 |
129 | #define UNIFY_ALLOW_INTEGER8 8 |
130 | #define UNIFY_ALLOW_OUTER_LEVEL16 16 |
131 | #define UNIFY_ALLOW_OUTER_MORE_CV_QUAL32 32 |
132 | #define UNIFY_ALLOW_OUTER_LESS_CV_QUAL64 64 |
133 | |
134 | enum template_base_result { |
135 | tbr_incomplete_type, |
136 | tbr_ambiguous_baseclass, |
137 | tbr_success |
138 | }; |
139 | |
140 | static bool resolve_overloaded_unification (tree, tree, tree, tree, |
141 | unification_kind_t, int, |
142 | bool); |
143 | static int try_one_overload (tree, tree, tree, tree, tree, |
144 | unification_kind_t, int, bool, bool); |
145 | static int unify (tree, tree, tree, tree, int, bool); |
146 | static void add_pending_template (tree); |
147 | static tree reopen_tinst_level (struct tinst_level *); |
148 | static tree tsubst_initializer_list (tree, tree); |
149 | static tree get_partial_spec_bindings (tree, tree, tree); |
150 | static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t, |
151 | bool, bool); |
152 | static tree coerce_innermost_template_parms (tree, tree, tree, tsubst_flags_t, |
153 | bool, bool); |
154 | static void tsubst_enum (tree, tree, tree); |
155 | static tree add_to_template_args (tree, tree); |
156 | static bool check_instantiated_args (tree, tree, tsubst_flags_t); |
157 | static int check_non_deducible_conversion (tree, tree, int, int, |
158 | struct conversion **, bool); |
159 | static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*, |
160 | tree); |
161 | static int type_unification_real (tree, tree, tree, const tree *, |
162 | unsigned int, int, unification_kind_t, |
163 | vec<deferred_access_check, va_gc> **, |
164 | bool); |
165 | static void note_template_header (int); |
166 | static tree convert_nontype_argument_function (tree, tree, tsubst_flags_t); |
167 | static tree convert_nontype_argument (tree, tree, tsubst_flags_t); |
168 | static tree convert_template_argument (tree, tree, tree, |
169 | tsubst_flags_t, int, tree); |
170 | static tree for_each_template_parm (tree, tree_fn_t, void*, |
171 | hash_set<tree> *, bool, tree_fn_t = NULL__null); |
172 | static tree expand_template_argument_pack (tree); |
173 | static tree build_template_parm_index (int, int, int, tree, tree); |
174 | static bool inline_needs_template_parms (tree, bool); |
175 | static void push_inline_template_parms_recursive (tree, int); |
176 | static tree reduce_template_parm_level (tree, tree, int, tree, tsubst_flags_t); |
177 | static int mark_template_parm (tree, void *); |
178 | static int template_parm_this_level_p (tree, void *); |
179 | static tree tsubst_friend_function (tree, tree); |
180 | static tree tsubst_friend_class (tree, tree); |
181 | static int can_complete_type_without_circularity (tree); |
182 | static tree get_bindings (tree, tree, tree, bool); |
183 | static int template_decl_level (tree); |
184 | static int check_cv_quals_for_unify (int, tree, tree); |
185 | static int unify_pack_expansion (tree, tree, tree, |
186 | tree, unification_kind_t, bool, bool); |
187 | static tree copy_template_args (tree); |
188 | static tree tsubst_template_parms (tree, tree, tsubst_flags_t); |
189 | tree most_specialized_partial_spec (tree, tsubst_flags_t); |
190 | static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int); |
191 | static tree tsubst_arg_types (tree, tree, tree, tsubst_flags_t, tree); |
192 | static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree); |
193 | static bool check_specialization_scope (void); |
194 | static tree process_partial_specialization (tree); |
195 | static void set_current_access_from_decl (tree); |
196 | static enum template_base_result get_template_base (tree, tree, tree, tree, |
197 | bool , tree *); |
198 | static tree try_class_unification (tree, tree, tree, tree, bool); |
199 | static bool class_nttp_const_wrapper_p (tree t); |
200 | static int coerce_template_template_parms (tree, tree, tsubst_flags_t, |
201 | tree, tree); |
202 | static bool template_template_parm_bindings_ok_p (tree, tree); |
203 | static void tsubst_default_arguments (tree, tsubst_flags_t); |
204 | static tree for_each_template_parm_r (tree *, int *, void *); |
205 | static tree copy_default_args_to_explicit_spec_1 (tree, tree); |
206 | static void copy_default_args_to_explicit_spec (tree); |
207 | static bool invalid_nontype_parm_type_p (tree, tsubst_flags_t); |
208 | static bool dependent_template_arg_p (tree); |
209 | static bool any_template_arguments_need_structural_equality_p (tree); |
210 | static bool dependent_type_p_r (tree); |
211 | static tree tsubst_copy (tree, tree, tsubst_flags_t, tree); |
212 | static tree tsubst_decl (tree, tree, tsubst_flags_t); |
213 | static void perform_instantiation_time_access_checks (tree, tree); |
214 | static tree listify (tree); |
215 | static tree listify_autos (tree, tree); |
216 | static tree tsubst_template_parm (tree, tree, tsubst_flags_t); |
217 | static tree instantiate_alias_template (tree, tree, tsubst_flags_t); |
218 | static bool complex_alias_template_p (const_tree tmpl); |
219 | static tree get_underlying_template (tree); |
220 | static tree tsubst_attributes (tree, tree, tsubst_flags_t, tree); |
221 | static tree canonicalize_expr_argument (tree, tsubst_flags_t); |
222 | static tree make_argument_pack (tree); |
223 | static void register_parameter_specializations (tree, tree); |
224 | static tree enclosing_instantiation_of (tree tctx); |
225 | static void instantiate_body (tree pattern, tree args, tree d, bool nested); |
226 | |
227 | /* Make the current scope suitable for access checking when we are |
228 | processing T. T can be FUNCTION_DECL for instantiated function |
229 | template, VAR_DECL for static member variable, or TYPE_DECL for |
230 | alias template (needed by instantiate_decl). */ |
231 | |
232 | void |
233 | push_access_scope (tree t) |
234 | { |
235 | gcc_assert (VAR_OR_FUNCTION_DECL_P (t)((void)(!((((enum tree_code) (t)->base.code) == VAR_DECL || ((enum tree_code) (t)->base.code) == FUNCTION_DECL) || (( enum tree_code) (t)->base.code) == TYPE_DECL) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 236, __FUNCTION__), 0 : 0)) |
236 | || TREE_CODE (t) == TYPE_DECL)((void)(!((((enum tree_code) (t)->base.code) == VAR_DECL || ((enum tree_code) (t)->base.code) == FUNCTION_DECL) || (( enum tree_code) (t)->base.code) == TYPE_DECL) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 236, __FUNCTION__), 0 : 0)); |
237 | |
238 | if (DECL_FRIEND_CONTEXT (t)(((((enum tree_code) (t)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (t)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && !((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__))->decl_common.virtual_flag) && !((tree_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (t)->base.code) == FUNCTION_DECL || (((enum tree_code) (t)->base.code) == TEMPLATE_DECL && (( struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 238, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) |
239 | push_nested_class (DECL_FRIEND_CONTEXT (t)(((((enum tree_code) (t)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (t)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && !((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__))->decl_common.virtual_flag) && !((tree_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (t)->base.code) == FUNCTION_DECL || (((enum tree_code) (t)->base.code) == TEMPLATE_DECL && (( struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 239, __FUNCTION__); <->u.fn; })->context : (tree ) __null)); |
240 | else if (DECL_CLASS_SCOPE_P (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 240, __FUNCTION__))->decl_minimal.context) && (tree_code_type [(int) (((enum tree_code) (((contains_struct_check ((t), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 240, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) |
241 | push_nested_class (DECL_CONTEXT (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 241, __FUNCTION__))->decl_minimal.context)); |
242 | else |
243 | push_to_top_level (); |
244 | |
245 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FUNCTION_DECL) |
246 | { |
247 | vec_safe_push (saved_access_scope, current_function_decl); |
248 | current_function_decl = t; |
249 | } |
250 | } |
251 | |
252 | /* Restore the scope set up by push_access_scope. T is the node we |
253 | are processing. */ |
254 | |
255 | void |
256 | pop_access_scope (tree t) |
257 | { |
258 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FUNCTION_DECL) |
259 | current_function_decl = saved_access_scope->pop(); |
260 | |
261 | if (DECL_FRIEND_CONTEXT (t)(((((enum tree_code) (t)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (t)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && !((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__))->decl_common.virtual_flag) && !((tree_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (t)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (t)->base.code) == FUNCTION_DECL || (((enum tree_code) (t)->base.code) == TEMPLATE_DECL && (( struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__); <->u.fn; })->context : (tree ) __null) || DECL_CLASS_SCOPE_P (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__))->decl_minimal.context) && (tree_code_type [(int) (((enum tree_code) (((contains_struct_check ((t), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 261, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type))) |
262 | pop_nested_class (); |
263 | else |
264 | pop_from_top_level (); |
265 | } |
266 | |
267 | /* Do any processing required when DECL (a member template |
268 | declaration) is finished. Returns the TEMPLATE_DECL corresponding |
269 | to DECL, unless it is a specialization, in which case the DECL |
270 | itself is returned. */ |
271 | |
272 | tree |
273 | finish_member_template_decl (tree decl) |
274 | { |
275 | if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
276 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
277 | |
278 | gcc_assert (DECL_P (decl))((void)(!((tree_code_type[(int) (((enum tree_code) (decl)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 278, __FUNCTION__), 0 : 0)); |
279 | |
280 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL) |
281 | { |
282 | tree type; |
283 | |
284 | type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 284, __FUNCTION__))->typed.type); |
285 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
286 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
287 | if (MAYBE_CLASS_TYPE_P (type)((((enum tree_code) (type)->base.code) == TEMPLATE_TYPE_PARM || ((enum tree_code) (type)->base.code) == TYPENAME_TYPE || ((enum tree_code) (type)->base.code) == TYPEOF_TYPE || (( enum tree_code) (type)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || ((enum tree_code) (type)->base.code) == DECLTYPE_TYPE) || (((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 287, __FUNCTION__))->type_common.lang_flag_5))) |
288 | && CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 288, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 288, __FUNCTION__))->type_non_common.lang_1)) |
289 | && !CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 289, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 2)) |
290 | { |
291 | tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 291, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 291, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 291, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
292 | check_member_template (tmpl); |
293 | return tmpl; |
294 | } |
295 | return NULL_TREE(tree) __null; |
296 | } |
297 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL) |
298 | error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 298, __FUNCTION__))->decl_minimal.locus), |
299 | "data member %qD cannot be a member template", decl); |
300 | else if (DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 300, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 300, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info)) |
301 | { |
302 | if (!DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 302, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2)) |
303 | { |
304 | check_member_template (DECL_TI_TEMPLATE (decl)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 304, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 304, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 304, __FUNCTION__, (TEMPLATE_INFO))))->tmpl); |
305 | return DECL_TI_TEMPLATE (decl)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 305, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 305, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 305, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
306 | } |
307 | else |
308 | return decl; |
309 | } |
310 | else |
311 | error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 311, __FUNCTION__))->decl_minimal.locus), |
312 | "invalid member template declaration %qD", decl); |
313 | |
314 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
315 | } |
316 | |
317 | /* Create a template info node. */ |
318 | |
319 | tree |
320 | build_template_info (tree template_decl, tree template_args) |
321 | { |
322 | tree result = make_node (TEMPLATE_INFO); |
323 | TI_TEMPLATE (result)((struct tree_template_info*)(tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 323, __FUNCTION__, (TEMPLATE_INFO))))->tmpl = template_decl; |
324 | TI_ARGS (result)((struct tree_template_info*)(tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 324, __FUNCTION__, (TEMPLATE_INFO))))->args = template_args; |
325 | return result; |
326 | } |
327 | |
328 | /* Return the template info node corresponding to T, whatever T is. */ |
329 | |
330 | tree |
331 | get_template_info (const_tree t) |
332 | { |
333 | tree tinfo = NULL_TREE(tree) __null; |
334 | |
335 | if (!t || t == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
336 | return NULL__null; |
337 | |
338 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == NAMESPACE_DECL |
339 | || TREE_CODE (t)((enum tree_code) (t)->base.code) == PARM_DECL) |
340 | return NULL__null; |
341 | |
342 | if (DECL_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))] == tcc_declaration) && DECL_LANG_SPECIFIC (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 342, __FUNCTION__))->decl_common.lang_specific)) |
343 | tinfo = DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 343, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 343, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info); |
344 | |
345 | if (!tinfo && DECL_IMPLICIT_TYPEDEF_P (t)(((enum tree_code) (t)->base.code) == TYPE_DECL && ((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 345, __FUNCTION__))->decl_common.lang_flag_2))) |
346 | t = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 346, __FUNCTION__))->typed.type); |
347 | |
348 | if (OVERLOAD_TYPE_P (t)((((((enum tree_code) (t)->base.code)) == RECORD_TYPE || ( ((enum tree_code) (t)->base.code)) == UNION_TYPE) && ((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 348, __FUNCTION__))->type_common.lang_flag_5)) || ((enum tree_code) (t)->base.code) == ENUMERAL_TYPE)) |
349 | tinfo = TYPE_TEMPLATE_INFO (t)(((enum tree_code) (t)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (t)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t)->base.code) == RECORD_TYPE || ( (enum tree_code) (t)->base.code) == UNION_TYPE || ((enum tree_code ) (t)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 349, __FUNCTION__))->type_non_common.lang_1) : (tree) __null ); |
350 | else if (TREE_CODE (t)((enum tree_code) (t)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM) |
351 | tinfo = TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t)(((tree_class_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 351, __FUNCTION__, (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 351, __FUNCTION__))->type_non_common.lang_1)); |
352 | |
353 | return tinfo; |
354 | } |
355 | |
356 | /* Returns the template nesting level of the indicated class TYPE. |
357 | |
358 | For example, in: |
359 | template <class T> |
360 | struct A |
361 | { |
362 | template <class U> |
363 | struct B {}; |
364 | }; |
365 | |
366 | A<T>::B<U> has depth two, while A<T> has depth one. |
367 | Both A<T>::B<int> and A<int>::B<U> have depth one, if |
368 | they are instantiations, not specializations. |
369 | |
370 | This function is guaranteed to return 0 if passed NULL_TREE so |
371 | that, for example, `template_class_depth (current_class_type)' is |
372 | always safe. */ |
373 | |
374 | int |
375 | template_class_depth (tree type) |
376 | { |
377 | int depth; |
378 | |
379 | for (depth = 0; type && TREE_CODE (type)((enum tree_code) (type)->base.code) != NAMESPACE_DECL; ) |
380 | { |
381 | tree tinfo = get_template_info (type); |
382 | |
383 | if (tinfo && PRIMARY_TEMPLATE_P (TI_TEMPLATE (tinfo))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 383, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 383, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 383, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 383, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 383, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)) |
384 | && uses_template_parms (INNERMOST_TEMPLATE_ARGS (TI_ARGS (tinfo))(get_innermost_template_args ((((struct tree_template_info*)( tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 384, __FUNCTION__, (TEMPLATE_INFO))))->args), 1)))) |
385 | ++depth; |
386 | |
387 | if (DECL_P (type)(tree_code_type[(int) (((enum tree_code) (type)->base.code ))] == tcc_declaration)) |
388 | { |
389 | if (tree fctx = DECL_FRIEND_CONTEXT (type)(((((enum tree_code) (type)->base.code) == FUNCTION_DECL || (((enum tree_code) (type)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) && !((contains_struct_check ((type), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__))->decl_common.virtual_flag) && !((tree_check (((((enum tree_code) (type)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__, (TEMPLATE_DECL))))))))->result : type )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor )) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (type)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__, (TEMPLATE_DECL))))))))->result : type )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__))->decl_common.lang_specific); if (!(( (enum tree_code) (type)->base.code) == FUNCTION_DECL || (( (enum tree_code) (type)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base .code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 389, __FUNCTION__); <->u.fn; })->context : (tree ) __null)) |
390 | type = fctx; |
391 | else |
392 | type = CP_DECL_CONTEXT (type)(!(! (((contains_struct_check ((type), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 392, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((type), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 392, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((type) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 392, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]); |
393 | } |
394 | else if (LAMBDA_TYPE_P (type)(((enum tree_code) (type)->base.code) == RECORD_TYPE && ((((tree_class_check ((((tree_class_check ((type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name))->base.code))] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name))) && ((tree_check ((((((tree_class_check ((((tree_class_check ((type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name) && (tree_code_type [(int) (((enum tree_code) (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name))->base.code))] == tcc_declaration) ? ((contains_struct_check ((((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->decl_minimal.name) : ((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag )) && LAMBDA_TYPE_EXTRA_SCOPE (type)((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 394, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope))) |
395 | type = LAMBDA_TYPE_EXTRA_SCOPE (type)((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 395, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 395, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope)); |
396 | else |
397 | type = CP_TYPE_CONTEXT (type)(!(! (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 397, __FUNCTION__))->type_common.context)) || ((enum tree_code ) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 397, __FUNCTION__))->type_common.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 397, __FUNCTION__))->type_common.context) : cp_global_trees [CPTI_GLOBAL]); |
398 | } |
399 | |
400 | return depth; |
401 | } |
402 | |
403 | /* Return TRUE if NODE instantiates a template that has arguments of |
404 | its own, be it directly a primary template or indirectly through a |
405 | partial specializations. */ |
406 | static bool |
407 | instantiates_primary_template_p (tree node) |
408 | { |
409 | tree tinfo = get_template_info (node); |
410 | if (!tinfo) |
411 | return false; |
412 | |
413 | tree tmpl = TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 413, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
414 | if (PRIMARY_TEMPLATE_P (tmpl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 414, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 414, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 414, __FUNCTION__))->typed.type))) == (tmpl))) |
415 | return true; |
416 | |
417 | if (!DECL_TEMPLATE_SPECIALIZATION (tmpl)((((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 417, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2)) |
418 | return false; |
419 | |
420 | /* So now we know we have a specialization, but it could be a full |
421 | or a partial specialization. To tell which, compare the depth of |
422 | its template arguments with those of its context. */ |
423 | |
424 | tree ctxt = DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 424, __FUNCTION__))->decl_minimal.context); |
425 | tree ctinfo = get_template_info (ctxt); |
426 | if (!ctinfo) |
427 | return true; |
428 | |
429 | return (TMPL_ARGS_DEPTH (TI_ARGS (tinfo))((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__, (TEMPLATE_INFO))))->args && ( (tree_check ((((struct tree_template_info*)(tree_check ((tinfo ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((((struct tree_template_info *)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((((struct tree_template_info *)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 429, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) |
430 | > TMPL_ARGS_DEPTH (TI_ARGS (ctinfo))((((struct tree_template_info*)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__, (TEMPLATE_INFO))))->args && ( (tree_check ((((struct tree_template_info*)(tree_check ((ctinfo ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((((struct tree_template_info *)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((((struct tree_template_info *)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((((struct tree_template_info*)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 430, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)); |
431 | } |
432 | |
433 | /* Subroutine of maybe_begin_member_template_processing. |
434 | Returns true if processing DECL needs us to push template parms. */ |
435 | |
436 | static bool |
437 | inline_needs_template_parms (tree decl, bool nsdmi) |
438 | { |
439 | if (!decl || (!nsdmi && ! DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 439, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 439, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info))) |
440 | return false; |
441 | |
442 | return (TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (most_general_template (decl)))((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((most_general_template (decl)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 442, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 442, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 442, __FUNCTION__)))) |
443 | > (processing_template_declscope_chain->x_processing_template_decl + DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 443, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2))); |
444 | } |
445 | |
446 | /* Subroutine of maybe_begin_member_template_processing. |
447 | Push the template parms in PARMS, starting from LEVELS steps into the |
448 | chain, and ending at the beginning, since template parms are listed |
449 | innermost first. */ |
450 | |
451 | static void |
452 | push_inline_template_parms_recursive (tree parmlist, int levels) |
453 | { |
454 | tree parms = TREE_VALUE (parmlist)((tree_check ((parmlist), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 454, __FUNCTION__, (TREE_LIST)))->list.value); |
455 | int i; |
456 | |
457 | if (levels > 1) |
458 | push_inline_template_parms_recursive (TREE_CHAIN (parmlist)((contains_struct_check ((parmlist), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 458, __FUNCTION__))->common.chain), levels - 1); |
459 | |
460 | ++processing_template_declscope_chain->x_processing_template_decl; |
461 | current_template_parmsscope_chain->template_parms |
462 | = tree_cons (size_int (processing_template_decl)size_int_kind (scope_chain->x_processing_template_decl, stk_sizetype ), |
463 | parms, current_template_parmsscope_chain->template_parms); |
464 | TEMPLATE_PARMS_FOR_INLINE (current_template_parms)((tree_not_check2 ((scope_chain->template_parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 464, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) = 1; |
465 | |
466 | begin_scope (TREE_VEC_LENGTH (parms)((tree_check ((parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 466, __FUNCTION__, (TREE_VEC)))->base.u.length) ? sk_template_parms : sk_template_spec, |
467 | NULL__null); |
468 | for (i = 0; i < TREE_VEC_LENGTH (parms)((tree_check ((parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 468, __FUNCTION__, (TREE_VEC)))->base.u.length); ++i) |
469 | { |
470 | tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check ((parms), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 470, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 470, __FUNCTION__, (TREE_LIST)))->list.value); |
471 | |
472 | if (error_operand_p (parm)((parm) == global_trees[TI_ERROR_MARK] || ((parm) && ( (contains_struct_check (((parm)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 472, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ]))) |
473 | continue; |
474 | |
475 | gcc_assert (DECL_P (parm))((void)(!((tree_code_type[(int) (((enum tree_code) (parm)-> base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 475, __FUNCTION__), 0 : 0)); |
476 | |
477 | switch (TREE_CODE (parm)((enum tree_code) (parm)->base.code)) |
478 | { |
479 | case TYPE_DECL: |
480 | case TEMPLATE_DECL: |
481 | pushdecl (parm); |
482 | break; |
483 | |
484 | case PARM_DECL: |
485 | /* Push the CONST_DECL. */ |
486 | pushdecl (TEMPLATE_PARM_DECL (DECL_INITIAL (parm))(((template_parm_index*)(tree_check ((((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 486, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 486, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->decl)); |
487 | break; |
488 | |
489 | default: |
490 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 490, __FUNCTION__)); |
491 | } |
492 | } |
493 | } |
494 | |
495 | /* Restore the template parameter context for a member template, a |
496 | friend template defined in a class definition, or a non-template |
497 | member of template class. */ |
498 | |
499 | void |
500 | maybe_begin_member_template_processing (tree decl) |
501 | { |
502 | tree parms; |
503 | int levels = 0; |
504 | bool nsdmi = TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL; |
505 | |
506 | if (nsdmi) |
507 | { |
508 | tree ctx = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 508, __FUNCTION__))->decl_minimal.context); |
509 | decl = (CLASSTYPE_TEMPLATE_INFO (ctx)(((tree_class_check (((tree_check3 ((ctx), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 509, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 509, __FUNCTION__))->type_non_common.lang_1)) |
510 | /* Disregard full specializations (c++/60999). */ |
511 | && uses_template_parms (ctx) |
512 | ? CLASSTYPE_TI_TEMPLATE (ctx)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((ctx), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 512, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 512, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 512, __FUNCTION__, (TEMPLATE_INFO))))->tmpl : NULL_TREE(tree) __null); |
513 | } |
514 | |
515 | if (inline_needs_template_parms (decl, nsdmi)) |
516 | { |
517 | parms = DECL_TEMPLATE_PARMS (most_general_template (decl))((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((most_general_template (decl)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 517, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments; |
518 | levels = TMPL_PARMS_DEPTH (parms)((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 518, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 518, __FUNCTION__)))) - processing_template_declscope_chain->x_processing_template_decl; |
519 | |
520 | if (DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 520, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2)) |
521 | { |
522 | --levels; |
523 | parms = TREE_CHAIN (parms)((contains_struct_check ((parms), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 523, __FUNCTION__))->common.chain); |
524 | } |
525 | |
526 | push_inline_template_parms_recursive (parms, levels); |
527 | } |
528 | |
529 | /* Remember how many levels of template parameters we pushed so that |
530 | we can pop them later. */ |
531 | inline_parm_levels.safe_push (levels); |
532 | } |
533 | |
534 | /* Undo the effects of maybe_begin_member_template_processing. */ |
535 | |
536 | void |
537 | maybe_end_member_template_processing (void) |
538 | { |
539 | int i; |
540 | int last; |
541 | |
542 | if (inline_parm_levels.length () == 0) |
543 | return; |
544 | |
545 | last = inline_parm_levels.pop (); |
546 | for (i = 0; i < last; ++i) |
547 | { |
548 | --processing_template_declscope_chain->x_processing_template_decl; |
549 | current_template_parmsscope_chain->template_parms = TREE_CHAIN (current_template_parms)((contains_struct_check ((scope_chain->template_parms), (TS_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 549, __FUNCTION__))->common.chain); |
550 | poplevel (0, 0, 0); |
551 | } |
552 | } |
553 | |
554 | /* Return a new template argument vector which contains all of ARGS, |
555 | but has as its innermost set of arguments the EXTRA_ARGS. */ |
556 | |
557 | static tree |
558 | add_to_template_args (tree args, tree extra_args) |
559 | { |
560 | tree new_args; |
561 | int extra_depth; |
562 | int i; |
563 | int j; |
564 | |
565 | if (args == NULL_TREE(tree) __null || extra_args == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
566 | return extra_args; |
567 | |
568 | extra_depth = TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 568, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((extra_args ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 568, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 568, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 568, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1); |
569 | new_args = make_tree_vec (TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 569, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 569, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 569, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 569, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) + extra_depth); |
570 | |
571 | for (i = 1; i <= TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 571, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 571, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 571, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 571, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1); ++i) |
572 | SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (args, i))((*((const_cast<tree *> (tree_vec_elt_check ((new_args) , ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 572, __FUNCTION__))))) = (((args && ((tree_check (( args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 572, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 572, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 572, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((args), ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 572, __FUNCTION__))))) : (args)))); |
573 | |
574 | for (j = 1; j <= extra_depth; ++j, ++i) |
575 | SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (extra_args, j))((*((const_cast<tree *> (tree_vec_elt_check ((new_args) , ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 575, __FUNCTION__))))) = (((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 575, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((extra_args ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 575, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 575, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((extra_args), ((j) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 575, __FUNCTION__))))) : (extra_args)))); |
576 | |
577 | return new_args; |
578 | } |
579 | |
580 | /* Like add_to_template_args, but only the outermost ARGS are added to |
581 | the EXTRA_ARGS. In particular, all but TMPL_ARGS_DEPTH |
582 | (EXTRA_ARGS) levels are added. This function is used to combine |
583 | the template arguments from a partial instantiation with the |
584 | template arguments used to attain the full instantiation from the |
585 | partial instantiation. |
586 | |
587 | If ARGS is a TEMPLATE_DECL, use its parameters as args. */ |
588 | |
589 | tree |
590 | add_outermost_template_args (tree args, tree extra_args) |
591 | { |
592 | tree new_args; |
593 | |
594 | if (!args) |
595 | return extra_args; |
596 | if (TREE_CODE (args)((enum tree_code) (args)->base.code) == TEMPLATE_DECL) |
597 | { |
598 | tree ti = get_template_info (DECL_TEMPLATE_RESULT (args)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 598, __FUNCTION__, (TEMPLATE_DECL))))))))->result); |
599 | args = TI_ARGS (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 599, __FUNCTION__, (TEMPLATE_INFO))))->args; |
600 | } |
601 | |
602 | /* If there are more levels of EXTRA_ARGS than there are ARGS, |
603 | something very fishy is going on. */ |
604 | gcc_assert (TMPL_ARGS_DEPTH (args) >= TMPL_ARGS_DEPTH (extra_args))((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) >= ((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((extra_args ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 604, __FUNCTION__), 0 : 0)); |
605 | |
606 | /* If *all* the new arguments will be the EXTRA_ARGS, just return |
607 | them. */ |
608 | if (TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) == TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((extra_args ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 608, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) |
609 | return extra_args; |
610 | |
611 | /* For the moment, we make ARGS look like it contains fewer levels. */ |
612 | TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 612, __FUNCTION__, (TREE_VEC)))->base.u.length) -= TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 612, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((extra_args ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 612, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 612, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 612, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1); |
613 | |
614 | new_args = add_to_template_args (args, extra_args); |
615 | |
616 | /* Now, we restore ARGS to its full dimensions. */ |
617 | TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 617, __FUNCTION__, (TREE_VEC)))->base.u.length) += TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 617, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((extra_args ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 617, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 617, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 617, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1); |
618 | |
619 | return new_args; |
620 | } |
621 | |
622 | /* Return the N levels of innermost template arguments from the ARGS. */ |
623 | |
624 | tree |
625 | get_innermost_template_args (tree args, int n) |
626 | { |
627 | tree new_args; |
628 | int extra_levels; |
629 | int i; |
630 | |
631 | gcc_assert (n >= 0)((void)(!(n >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 631, __FUNCTION__), 0 : 0)); |
632 | |
633 | /* If N is 1, just return the innermost set of template arguments. */ |
634 | if (n == 1) |
635 | return TMPL_ARGS_LEVEL (args, TMPL_ARGS_DEPTH (args))((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((args), ((((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) - 1 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 635, __FUNCTION__))))) : (args)); |
636 | |
637 | /* If we're not removing anything, just return the arguments we were |
638 | given. */ |
639 | extra_levels = TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 639, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 639, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 639, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 639, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) - n; |
640 | gcc_assert (extra_levels >= 0)((void)(!(extra_levels >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 640, __FUNCTION__), 0 : 0)); |
641 | if (extra_levels == 0) |
642 | return args; |
643 | |
644 | /* Make a new set of arguments, not containing the outer arguments. */ |
645 | new_args = make_tree_vec (n); |
646 | for (i = 1; i <= n; ++i) |
647 | SET_TMPL_ARGS_LEVEL (new_args, i,((*((const_cast<tree *> (tree_vec_elt_check ((new_args) , ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))) = (((args && ((tree_check (( args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((args), ((i + extra_levels ) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))) : (args)))) |
648 | TMPL_ARGS_LEVEL (args, i + extra_levels))((*((const_cast<tree *> (tree_vec_elt_check ((new_args) , ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))) = (((args && ((tree_check (( args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((args), ((i + extra_levels ) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 648, __FUNCTION__))))) : (args)))); |
649 | |
650 | return new_args; |
651 | } |
652 | |
653 | /* The inverse of get_innermost_template_args: Return all but the innermost |
654 | EXTRA_LEVELS levels of template arguments from the ARGS. */ |
655 | |
656 | static tree |
657 | strip_innermost_template_args (tree args, int extra_levels) |
658 | { |
659 | tree new_args; |
660 | int n = TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 660, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 660, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 660, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 660, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) - extra_levels; |
661 | int i; |
662 | |
663 | gcc_assert (n >= 0)((void)(!(n >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 663, __FUNCTION__), 0 : 0)); |
664 | |
665 | /* If N is 1, just return the outermost set of template arguments. */ |
666 | if (n == 1) |
667 | return TMPL_ARGS_LEVEL (args, 1)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 667, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 667, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 667, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((args), ((1) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 667, __FUNCTION__))))) : (args)); |
668 | |
669 | /* If we're not removing anything, just return the arguments we were |
670 | given. */ |
671 | gcc_assert (extra_levels >= 0)((void)(!(extra_levels >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 671, __FUNCTION__), 0 : 0)); |
672 | if (extra_levels == 0) |
673 | return args; |
674 | |
675 | /* Make a new set of arguments, not containing the inner arguments. */ |
676 | new_args = make_tree_vec (n); |
677 | for (i = 1; i <= n; ++i) |
678 | SET_TMPL_ARGS_LEVEL (new_args, i,((*((const_cast<tree *> (tree_vec_elt_check ((new_args) , ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))) = (((args && ((tree_check (( args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((args), ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))) : (args)))) |
679 | TMPL_ARGS_LEVEL (args, i))((*((const_cast<tree *> (tree_vec_elt_check ((new_args) , ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))) = (((args && ((tree_check (( args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast <tree *> (tree_vec_elt_check ((args), ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 679, __FUNCTION__))))) : (args)))); |
680 | |
681 | return new_args; |
682 | } |
683 | |
684 | /* We've got a template header coming up; push to a new level for storing |
685 | the parms. */ |
686 | |
687 | void |
688 | begin_template_parm_list (void) |
689 | { |
690 | /* We use a non-tag-transparent scope here, which causes pushtag to |
691 | put tags in this scope, rather than in the enclosing class or |
692 | namespace scope. This is the right thing, since we want |
693 | TEMPLATE_DECLS, and not TYPE_DECLS for template classes. For a |
694 | global template class, push_template_decl handles putting the |
695 | TEMPLATE_DECL into top-level scope. For a nested template class, |
696 | e.g.: |
697 | |
698 | template <class T> struct S1 { |
699 | template <class T> struct S2 {}; |
700 | }; |
701 | |
702 | pushtag contains special code to insert the TEMPLATE_DECL for S2 |
703 | at the right scope. */ |
704 | begin_scope (sk_template_parms, NULL__null); |
705 | ++processing_template_declscope_chain->x_processing_template_decl; |
706 | ++processing_template_parmlist; |
707 | note_template_header (0); |
708 | |
709 | /* Add a dummy parameter level while we process the parameter list. */ |
710 | current_template_parmsscope_chain->template_parms |
711 | = tree_cons (size_int (processing_template_decl)size_int_kind (scope_chain->x_processing_template_decl, stk_sizetype ), |
712 | make_tree_vec (0), |
713 | current_template_parmsscope_chain->template_parms); |
714 | } |
715 | |
716 | /* This routine is called when a specialization is declared. If it is |
717 | invalid to declare a specialization here, an error is reported and |
718 | false is returned, otherwise this routine will return true. */ |
719 | |
720 | static bool |
721 | check_specialization_scope (void) |
722 | { |
723 | tree scope = current_scope (); |
724 | |
725 | /* [temp.expl.spec] |
726 | |
727 | An explicit specialization shall be declared in the namespace of |
728 | which the template is a member, or, for member templates, in the |
729 | namespace of which the enclosing class or enclosing class |
730 | template is a member. An explicit specialization of a member |
731 | function, member class or static data member of a class template |
732 | shall be declared in the namespace of which the class template |
733 | is a member. */ |
734 | if (scope && TREE_CODE (scope)((enum tree_code) (scope)->base.code) != NAMESPACE_DECL) |
735 | { |
736 | error ("explicit specialization in non-namespace scope %qD", scope); |
737 | return false; |
738 | } |
739 | |
740 | /* [temp.expl.spec] |
741 | |
742 | In an explicit specialization declaration for a member of a class |
743 | template or a member template that appears in namespace scope, |
744 | the member template and some of its enclosing class templates may |
745 | remain unspecialized, except that the declaration shall not |
746 | explicitly specialize a class member template if its enclosing |
747 | class templates are not explicitly specialized as well. */ |
748 | if (current_template_parmsscope_chain->template_parms) |
749 | { |
750 | error ("enclosing class templates are not explicitly specialized"); |
751 | return false; |
752 | } |
753 | |
754 | return true; |
755 | } |
756 | |
757 | /* We've just seen template <>. */ |
758 | |
759 | bool |
760 | begin_specialization (void) |
761 | { |
762 | begin_scope (sk_template_spec, NULL__null); |
763 | note_template_header (1); |
764 | return check_specialization_scope (); |
765 | } |
766 | |
767 | /* Called at then end of processing a declaration preceded by |
768 | template<>. */ |
769 | |
770 | void |
771 | end_specialization (void) |
772 | { |
773 | finish_scope (); |
774 | reset_specialization (); |
775 | } |
776 | |
777 | /* Any template <>'s that we have seen thus far are not referring to a |
778 | function specialization. */ |
779 | |
780 | void |
781 | reset_specialization (void) |
782 | { |
783 | processing_specializationscope_chain->x_processing_specialization = 0; |
784 | template_header_count = 0; |
785 | } |
786 | |
787 | /* We've just seen a template header. If SPECIALIZATION is nonzero, |
788 | it was of the form template <>. */ |
789 | |
790 | static void |
791 | note_template_header (int specialization) |
792 | { |
793 | processing_specializationscope_chain->x_processing_specialization = specialization; |
794 | template_header_count++; |
795 | } |
796 | |
797 | /* We're beginning an explicit instantiation. */ |
798 | |
799 | void |
800 | begin_explicit_instantiation (void) |
801 | { |
802 | gcc_assert (!processing_explicit_instantiation)((void)(!(!scope_chain->x_processing_explicit_instantiation ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 802, __FUNCTION__), 0 : 0)); |
803 | processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation = true; |
804 | } |
805 | |
806 | |
807 | void |
808 | end_explicit_instantiation (void) |
809 | { |
810 | gcc_assert (processing_explicit_instantiation)((void)(!(scope_chain->x_processing_explicit_instantiation ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 810, __FUNCTION__), 0 : 0)); |
811 | processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation = false; |
812 | } |
813 | |
814 | /* An explicit specialization or partial specialization of TMPL is being |
815 | declared. Check that the namespace in which the specialization is |
816 | occurring is permissible. Returns false iff it is invalid to |
817 | specialize TMPL in the current namespace. */ |
818 | |
819 | static bool |
820 | check_specialization_namespace (tree tmpl) |
821 | { |
822 | tree tpl_ns = decl_namespace_context (tmpl); |
823 | |
824 | /* [tmpl.expl.spec] |
825 | |
826 | An explicit specialization shall be declared in a namespace enclosing the |
827 | specialized template. An explicit specialization whose declarator-id is |
828 | not qualified shall be declared in the nearest enclosing namespace of the |
829 | template, or, if the namespace is inline (7.3.1), any namespace from its |
830 | enclosing namespace set. */ |
831 | if (current_scope() != DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 831, __FUNCTION__))->decl_minimal.context) |
832 | && !at_namespace_scope_p ()) |
833 | { |
834 | error ("specialization of %qD must appear at namespace scope", tmpl); |
835 | return false; |
836 | } |
837 | |
838 | if (is_nested_namespace (current_namespacescope_chain->old_namespace, tpl_ns, cxx_dialect < cxx11)) |
839 | /* Same or enclosing namespace. */ |
840 | return true; |
841 | else |
842 | { |
843 | auto_diagnostic_group d; |
844 | if (permerror (input_location, |
845 | "specialization of %qD in different namespace", tmpl)) |
846 | inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 846, __FUNCTION__))->decl_minimal.locus), |
847 | " from definition of %q#D", tmpl); |
848 | return false; |
849 | } |
850 | } |
851 | |
852 | /* SPEC is an explicit instantiation. Check that it is valid to |
853 | perform this explicit instantiation in the current namespace. */ |
854 | |
855 | static void |
856 | check_explicit_instantiation_namespace (tree spec) |
857 | { |
858 | tree ns; |
859 | |
860 | /* DR 275: An explicit instantiation shall appear in an enclosing |
861 | namespace of its template. */ |
862 | ns = decl_namespace_context (spec); |
863 | if (!is_nested_namespace (current_namespacescope_chain->old_namespace, ns)) |
864 | permerror (input_location, "explicit instantiation of %qD in namespace %qD " |
865 | "(which does not enclose namespace %qD)", |
866 | spec, current_namespacescope_chain->old_namespace, ns); |
867 | } |
868 | |
869 | /* Returns the type of a template specialization only if that |
870 | specialization needs to be defined. Otherwise (e.g., if the type has |
871 | already been defined), the function returns NULL_TREE. */ |
872 | |
873 | static tree |
874 | maybe_new_partial_specialization (tree type) |
875 | { |
876 | /* An implicit instantiation of an incomplete type implies |
877 | the definition of a new class template. |
878 | |
879 | template<typename T> |
880 | struct S; |
881 | |
882 | template<typename T> |
883 | struct S<T*>; |
884 | |
885 | Here, S<T*> is an implicit instantiation of S whose type |
886 | is incomplete. */ |
887 | if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 887, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 1) && !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 887, __FUNCTION__))->type_common.size) != (tree) __null)) |
888 | return type; |
889 | |
890 | /* It can also be the case that TYPE is a completed specialization. |
891 | Continuing the previous example, suppose we also declare: |
892 | |
893 | template<typename T> |
894 | requires Integral<T> |
895 | struct S<T*>; |
896 | |
897 | Here, S<T*> refers to the specialization S<T*> defined |
898 | above. However, we need to differentiate definitions because |
899 | we intend to define a new partial specialization. In this case, |
900 | we rely on the fact that the constraints are different for |
901 | this declaration than that above. |
902 | |
903 | Note that we also get here for injected class names and |
904 | late-parsed template definitions. We must ensure that we |
905 | do not create new type declarations for those cases. */ |
906 | if (flag_conceptsglobal_options.x_flag_concepts && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 906, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 2)) |
907 | { |
908 | tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 908, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 908, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 908, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
909 | tree args = CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 909, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 909, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 909, __FUNCTION__, (TEMPLATE_INFO))))->args; |
910 | |
911 | /* If there are no template parameters, this cannot be a new |
912 | partial template specialization? */ |
913 | if (!current_template_parmsscope_chain->template_parms) |
914 | return NULL_TREE(tree) __null; |
915 | |
916 | /* The injected-class-name is not a new partial specialization. */ |
917 | if (DECL_SELF_REFERENCE_P (TYPE_NAME (type))(((enum tree_code) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 917, __FUNCTION__))->type_common.name))->base.code) == TYPE_DECL && ((contains_struct_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 917, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 917, __FUNCTION__))->decl_common.lang_flag_4))) |
918 | return NULL_TREE(tree) __null; |
919 | |
920 | /* If the constraints are not the same as those of the primary |
921 | then, we can probably create a new specialization. */ |
922 | tree type_constr = current_template_constraints (); |
923 | |
924 | if (type == TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 924, __FUNCTION__))->typed.type)) |
925 | { |
926 | tree main_constr = get_constraints (tmpl); |
927 | if (equivalent_constraints (type_constr, main_constr)) |
928 | return NULL_TREE(tree) __null; |
929 | } |
930 | |
931 | /* Also, if there's a pre-existing specialization with matching |
932 | constraints, then this also isn't new. */ |
933 | tree specs = DECL_TEMPLATE_SPECIALIZATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 933, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 933, __FUNCTION__))->decl_common.size); |
934 | while (specs) |
935 | { |
936 | tree spec_tmpl = TREE_VALUE (specs)((tree_check ((specs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 936, __FUNCTION__, (TREE_LIST)))->list.value); |
937 | tree spec_args = TREE_PURPOSE (specs)((tree_check ((specs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 937, __FUNCTION__, (TREE_LIST)))->list.purpose); |
938 | tree spec_constr = get_constraints (spec_tmpl); |
939 | if (comp_template_args (args, spec_args) |
940 | && equivalent_constraints (type_constr, spec_constr)) |
941 | return NULL_TREE(tree) __null; |
942 | specs = TREE_CHAIN (specs)((contains_struct_check ((specs), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 942, __FUNCTION__))->common.chain); |
943 | } |
944 | |
945 | /* Create a new type node (and corresponding type decl) |
946 | for the newly declared specialization. */ |
947 | tree t = make_class_type (TREE_CODE (type)((enum tree_code) (type)->base.code)); |
948 | CLASSTYPE_DECLARED_CLASS (t)((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 948, __FUNCTION__))->type_with_lang_specific.lang_specific ))->declared_class) = CLASSTYPE_DECLARED_CLASS (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 948, __FUNCTION__))->type_with_lang_specific.lang_specific ))->declared_class); |
949 | SET_TYPE_TEMPLATE_INFO (t, build_template_info (tmpl, args))(((void)(!(((enum tree_code) (t)->base.code) == ENUMERAL_TYPE || ((((((enum tree_code) (t)->base.code)) == RECORD_TYPE || (((enum tree_code) (t)->base.code)) == UNION_TYPE) && ((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__))->type_common.lang_flag_5)) && !((tree_code_type[(int) (((enum tree_code) (t)->base.code ))] == tcc_type) && ((tree_class_check ((t), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__))->type_common.name) && ((enum tree_code) (((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__))->type_common.name))->base.code) == TYPE_DECL && ((contains_struct_check (((tree_check ( (((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__))->decl_common.lang_flag_6)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__), 0 : 0)), (((tree_class_check ((t), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 949, __FUNCTION__))->type_non_common.lang_1) = (build_template_info (tmpl, args)))); |
950 | |
951 | /* We only need a separate type node for storing the definition of this |
952 | partial specialization; uses of S<T*> are unconstrained, so all are |
953 | equivalent. So keep TYPE_CANONICAL the same. */ |
954 | TYPE_CANONICAL (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 954, __FUNCTION__))->type_common.canonical) = TYPE_CANONICAL (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 954, __FUNCTION__))->type_common.canonical); |
955 | |
956 | /* Build the corresponding type decl. */ |
957 | tree d = create_implicit_typedef (DECL_NAME (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 957, __FUNCTION__))->decl_minimal.name), t); |
958 | DECL_CONTEXT (d)((contains_struct_check ((d), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 958, __FUNCTION__))->decl_minimal.context) = TYPE_CONTEXT (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 958, __FUNCTION__))->type_common.context); |
959 | DECL_SOURCE_LOCATION (d)((contains_struct_check ((d), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 959, __FUNCTION__))->decl_minimal.locus) = input_location; |
960 | TREE_PRIVATE (d)((d)->base.private_flag) = (current_access_specifierscope_chain->access_specifier == access_private_nodeglobal_trees[TI_PRIVATE]); |
961 | TREE_PROTECTED (d)((d)->base.protected_flag) = (current_access_specifierscope_chain->access_specifier == access_protected_nodeglobal_trees[TI_PROTECTED]); |
962 | |
963 | set_instantiating_module (d); |
964 | DECL_MODULE_EXPORT_P (d)((tree_not_check2 ((d), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 964, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_3) = DECL_MODULE_EXPORT_P (tmpl)((tree_not_check2 ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 964, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_3); |
965 | |
966 | return t; |
967 | } |
968 | |
969 | return NULL_TREE(tree) __null; |
970 | } |
971 | |
972 | /* The TYPE is being declared. If it is a template type, that means it |
973 | is a partial specialization. Do appropriate error-checking. */ |
974 | |
975 | tree |
976 | maybe_process_partial_specialization (tree type) |
977 | { |
978 | tree context; |
979 | |
980 | if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
981 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
982 | |
983 | /* A lambda that appears in specialization context is not itself a |
984 | specialization. */ |
985 | if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 985, __FUNCTION__))->type_common.lang_flag_5)) && CLASSTYPE_LAMBDA_EXPR (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 985, __FUNCTION__))->type_with_lang_specific.lang_specific ))->lambda_expr)) |
986 | return type; |
987 | |
988 | if (TREE_CODE (type)((enum tree_code) (type)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM) |
989 | { |
990 | error ("name of class shadows template template parameter %qD", |
991 | TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 991, __FUNCTION__))->type_common.name)); |
992 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
993 | } |
994 | |
995 | context = TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 995, __FUNCTION__))->type_common.context); |
996 | |
997 | if (TYPE_ALIAS_P (type)((tree_code_type[(int) (((enum tree_code) (type)->base.code ))] == tcc_type) && ((tree_class_check ((type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 997, __FUNCTION__))->type_common.name) && ((enum tree_code) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 997, __FUNCTION__))->type_common.name))->base.code) == TYPE_DECL && ((contains_struct_check (((tree_check ( (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 997, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 997, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 997, __FUNCTION__))->decl_common.lang_flag_6))) |
998 | { |
999 | tree tinfo = TYPE_ALIAS_TEMPLATE_INFO (type)(((contains_struct_check ((((tree_class_check ((type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 999, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 999, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check ((template_info_decl_check ((((tree_class_check ((type), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 999, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 999, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 999, __FUNCTION__))->decl_common.lang_specific) ->u.min .template_info) : (tree) __null); |
1000 | |
1001 | if (tinfo && DECL_ALIAS_TEMPLATE_P (TI_TEMPLATE (tinfo))((((enum tree_code) (((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)->base.code ) == TEMPLATE_DECL && ((struct tree_template_decl *)( const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == TYPE_DECL) && !((contains_struct_check ( (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1001, __FUNCTION__))->decl_common.artificial_flag))) |
1002 | error ("specialization of alias template %qD", |
1003 | TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1003, __FUNCTION__, (TEMPLATE_INFO))))->tmpl); |
1004 | else |
1005 | error ("explicit specialization of non-template %qT", type); |
1006 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1007 | } |
1008 | else if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1008, __FUNCTION__))->type_common.lang_flag_5)) && CLASSTYPE_USE_TEMPLATE (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1008, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template)) |
1009 | { |
1010 | /* This is for ordinary explicit specialization and partial |
1011 | specialization of a template class such as: |
1012 | |
1013 | template <> class C<int>; |
1014 | |
1015 | or: |
1016 | |
1017 | template <class T> class C<T*>; |
1018 | |
1019 | Make sure that `C<int>' and `C<T*>' are implicit instantiations. */ |
1020 | |
1021 | if (tree t = maybe_new_partial_specialization (type)) |
1022 | { |
1023 | if (!check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (t)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1023, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1023, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1023, __FUNCTION__, (TEMPLATE_INFO))))->tmpl) |
1024 | && !at_namespace_scope_p ()) |
1025 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1026 | SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (t)(((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1026, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) = 2); |
1027 | DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (t))((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1027, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1027, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1027, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1027, __FUNCTION__))->decl_minimal.locus) = input_location; |
1028 | if (processing_template_declscope_chain->x_processing_template_decl) |
1029 | { |
1030 | tree decl = push_template_decl (TYPE_MAIN_DECL (t)((((contains_struct_check (((tree_class_check ((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1030, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1030, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1030, __FUNCTION__))->common.chain)))); |
1031 | if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1032 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1033 | return TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1033, __FUNCTION__))->typed.type); |
1034 | } |
1035 | } |
1036 | else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1036, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) & 1)) |
1037 | error ("specialization of %qT after instantiation", type); |
1038 | else if (errorcount(global_dc)->diagnostic_count[(int) (DK_ERROR)] && !processing_specializationscope_chain->x_processing_specialization |
1039 | && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1039, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 2) |
1040 | && !uses_template_parms (CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1040, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1040, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1040, __FUNCTION__, (TEMPLATE_INFO))))->args)) |
1041 | /* Trying to define a specialization either without a template<> header |
1042 | or in an inappropriate place. We've already given an error, so just |
1043 | bail now so we don't actually define the specialization. */ |
1044 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1045 | } |
1046 | else if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE || (((enum tree_code) (type)->base.code)) == UNION_TYPE) && ((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1046, __FUNCTION__))->type_common.lang_flag_5)) |
1047 | && !CLASSTYPE_USE_TEMPLATE (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1047, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) |
1048 | && CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1048, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1048, __FUNCTION__))->type_non_common.lang_1)) |
1049 | && context && CLASS_TYPE_P (context)(((((enum tree_code) (context)->base.code)) == RECORD_TYPE || (((enum tree_code) (context)->base.code)) == UNION_TYPE ) && ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1049, __FUNCTION__))->type_common.lang_flag_5)) |
1050 | && CLASSTYPE_TEMPLATE_INFO (context)(((tree_class_check (((tree_check3 ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1050, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1050, __FUNCTION__))->type_non_common.lang_1))) |
1051 | { |
1052 | /* This is for an explicit specialization of member class |
1053 | template according to [temp.expl.spec/18]: |
1054 | |
1055 | template <> template <class U> class C<int>::D; |
1056 | |
1057 | The context `C<int>' must be an implicit instantiation. |
1058 | Otherwise this is just a member class template declared |
1059 | earlier like: |
1060 | |
1061 | template <> class C<int> { template <class U> class D; }; |
1062 | template <> template <class U> class C<int>::D; |
1063 | |
1064 | In the first case, `C<int>::D' is a specialization of `C<T>::D' |
1065 | while in the second case, `C<int>::D' is a primary template |
1066 | and `C<T>::D' may not exist. */ |
1067 | |
1068 | if (CLASSTYPE_IMPLICIT_INSTANTIATION (context)(((((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1068, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 1) |
1069 | && !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1069, __FUNCTION__))->type_common.size) != (tree) __null )) |
1070 | { |
1071 | tree t; |
1072 | tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1072, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1072, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1072, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
1073 | |
1074 | if (current_namespacescope_chain->old_namespace |
1075 | != decl_namespace_context (tmpl)) |
1076 | { |
1077 | if (permerror (input_location, |
1078 | "specialization of %qD in different namespace", |
1079 | type)) |
1080 | inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1080, __FUNCTION__))->decl_minimal.locus), |
1081 | "from definition of %q#D", tmpl); |
1082 | } |
1083 | |
1084 | /* Check for invalid specialization after instantiation: |
1085 | |
1086 | template <> template <> class C<int>::D<int>; |
1087 | template <> template <class U> class C<int>::D; */ |
1088 | |
1089 | for (t = DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1089, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1089, __FUNCTION__))->decl_common.size_unit); |
1090 | t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1090, __FUNCTION__))->common.chain)) |
1091 | { |
1092 | tree inst = TREE_VALUE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1092, __FUNCTION__, (TREE_LIST)))->list.value); |
1093 | if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)(((((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1093, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 2) |
1094 | || !COMPLETE_OR_OPEN_TYPE_P (inst)((((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1094, __FUNCTION__))->type_common.size) != (tree) __null ) || ((((((enum tree_code) (inst)->base.code)) == RECORD_TYPE || (((enum tree_code) (inst)->base.code)) == UNION_TYPE) && ((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1094, __FUNCTION__))->type_common.lang_flag_5)) && ((((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1094, __FUNCTION__))->type_with_lang_specific.lang_specific ))->being_defined)))) |
1095 | { |
1096 | /* We already have a full specialization of this partial |
1097 | instantiation, or a full specialization has been |
1098 | looked up but not instantiated. Reassign it to the |
1099 | new member specialization template. */ |
1100 | spec_entry elt; |
1101 | spec_entry *entry; |
1102 | |
1103 | elt.tmpl = most_general_template (tmpl); |
1104 | elt.args = CLASSTYPE_TI_ARGS (inst)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((inst), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1104, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1104, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1104, __FUNCTION__, (TEMPLATE_INFO))))->args; |
1105 | elt.spec = inst; |
1106 | |
1107 | type_specializations->remove_elt (&elt); |
1108 | |
1109 | elt.tmpl = tmpl; |
1110 | CLASSTYPE_TI_ARGS (inst)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((inst), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1110, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1110, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1110, __FUNCTION__, (TEMPLATE_INFO))))->args |
1111 | = elt.args = INNERMOST_TEMPLATE_ARGS (elt.args)(get_innermost_template_args ((elt.args), 1)); |
1112 | |
1113 | spec_entry **slot |
1114 | = type_specializations->find_slot (&elt, INSERT); |
1115 | entry = ggc_alloc<spec_entry> (); |
1116 | *entry = elt; |
1117 | *slot = entry; |
1118 | } |
1119 | else |
1120 | /* But if we've had an implicit instantiation, that's a |
1121 | problem ([temp.expl.spec]/6). */ |
1122 | error ("specialization %qT after instantiation %qT", |
1123 | type, inst); |
1124 | } |
1125 | |
1126 | /* Mark TYPE as a specialization. And as a result, we only |
1127 | have one level of template argument for the innermost |
1128 | class template. */ |
1129 | SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1129, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) = 2); |
1130 | DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type))((contains_struct_check ((((((contains_struct_check (((tree_class_check ((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1130, __FUNCTION__))->type_common.main_variant)), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1130, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1130, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1130, __FUNCTION__))->decl_minimal.locus) = input_location; |
1131 | CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1131, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1131, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1131, __FUNCTION__, (TEMPLATE_INFO))))->args |
1132 | = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type))(get_innermost_template_args ((((struct tree_template_info*)( tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1132, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1132, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1132, __FUNCTION__, (TEMPLATE_INFO))))->args), 1)); |
1133 | } |
1134 | } |
1135 | else if (processing_specializationscope_chain->x_processing_specialization) |
1136 | { |
1137 | /* Someday C++0x may allow for enum template specialization. */ |
1138 | if (cxx_dialect > cxx98 && TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE |
1139 | && CLASS_TYPE_P (context)(((((enum tree_code) (context)->base.code)) == RECORD_TYPE || (((enum tree_code) (context)->base.code)) == UNION_TYPE ) && ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1139, __FUNCTION__))->type_common.lang_flag_5)) && CLASSTYPE_USE_TEMPLATE (context)((((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1139, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template)) |
1140 | pedwarn (input_location, OPT_Wpedantic, "template specialization " |
1141 | "of %qD not allowed by ISO C++", type); |
1142 | else |
1143 | { |
1144 | error ("explicit specialization of non-template %qT", type); |
1145 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1146 | } |
1147 | } |
1148 | |
1149 | return type; |
1150 | } |
1151 | |
1152 | /* Returns nonzero if we can optimize the retrieval of specializations |
1153 | for TMPL, a TEMPLATE_DECL. In particular, for such a template, we |
1154 | do not use DECL_TEMPLATE_SPECIALIZATIONS at all. */ |
1155 | |
1156 | static inline bool |
1157 | optimize_specialization_lookup_p (tree tmpl) |
1158 | { |
1159 | return (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1159, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1159, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL) |
1160 | && DECL_CLASS_SCOPE_P (tmpl)(((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1160, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1160, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)) |
1161 | /* DECL_CLASS_SCOPE_P holds of T::f even if T is a template |
1162 | parameter. */ |
1163 | && CLASS_TYPE_P (DECL_CONTEXT (tmpl))(((((enum tree_code) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1163, __FUNCTION__))->decl_minimal.context))->base.code )) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1163, __FUNCTION__))->decl_minimal.context))->base.code )) == UNION_TYPE) && ((tree_class_check ((((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1163, __FUNCTION__))->decl_minimal.context)), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1163, __FUNCTION__))->type_common.lang_flag_5)) |
1164 | /* The optimized lookup depends on the fact that the |
1165 | template arguments for the member function template apply |
1166 | purely to the containing class, which is not true if the |
1167 | containing class is an explicit or partial |
1168 | specialization. */ |
1169 | && !CLASSTYPE_TEMPLATE_SPECIALIZATION (DECL_CONTEXT (tmpl))(((((tree_class_check ((((contains_struct_check ((tmpl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1169, __FUNCTION__))->decl_minimal.context)), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1169, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 2) |
1170 | && !DECL_MEMBER_TEMPLATE_P (tmpl)(((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1170, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1170, __FUNCTION__))->decl_common.lang_flag_1)) |
1171 | && !DECL_CONV_FN_P (tmpl)((((tree_not_check2 (((tree_check ((((contains_struct_check ( (tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1171, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
1172 | /* It is possible to have a template that is not a member |
1173 | template and is not a member of a template class: |
1174 | |
1175 | template <typename T> |
1176 | struct S { friend A::f(); }; |
1177 | |
1178 | Here, the friend function is a template, but the context does |
1179 | not have template information. The optimized lookup relies |
1180 | on having ARGS be the template arguments for both the class |
1181 | and the function template. */ |
1182 | && !DECL_UNIQUE_FRIEND_P (DECL_TEMPLATE_RESULT (tmpl))(((contains_struct_check (((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1182, __FUNCTION__, (TEMPLATE_DECL))))))))->result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1182, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1182, __FUNCTION__))->decl_common.lang_specific) ->u. base.friend_or_tls)); |
1183 | } |
1184 | |
1185 | /* Make sure ARGS doesn't use any inappropriate typedefs; we should have |
1186 | gone through coerce_template_parms by now. */ |
1187 | |
1188 | static void |
1189 | verify_unstripped_args_1 (tree inner) |
1190 | { |
1191 | for (int i = 0; i < TREE_VEC_LENGTH (inner)((tree_check ((inner), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1191, __FUNCTION__, (TREE_VEC)))->base.u.length); ++i) |
1192 | { |
1193 | tree arg = TREE_VEC_ELT (inner, i)(*((const_cast<tree *> (tree_vec_elt_check ((inner), (i ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1193, __FUNCTION__))))); |
1194 | if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL) |
1195 | /* OK */; |
1196 | else if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code) )] == tcc_type)) |
1197 | gcc_assert (strip_typedefs (arg, NULL) == arg)((void)(!(strip_typedefs (arg, __null) == arg) ? fancy_abort ( "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1197, __FUNCTION__), 0 : 0)); |
1198 | else if (ARGUMENT_PACK_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK || ((enum tree_code) (arg)->base.code) == NONTYPE_ARGUMENT_PACK )) |
1199 | verify_unstripped_args_1 (ARGUMENT_PACK_ARGS (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK ? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1199, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1199, __FUNCTION__))))))); |
1200 | else if (strip_typedefs (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1200, __FUNCTION__))->typed.type), NULL__null) != TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1200, __FUNCTION__))->typed.type)) |
1201 | /* Allow typedefs on the type of a non-type argument, since a |
1202 | parameter can have them. */; |
1203 | else |
1204 | gcc_assert (strip_typedefs_expr (arg, NULL) == arg)((void)(!(strip_typedefs_expr (arg, __null) == arg) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1204, __FUNCTION__), 0 : 0)); |
1205 | } |
1206 | } |
1207 | |
1208 | static void |
1209 | verify_unstripped_args (tree args) |
1210 | { |
1211 | ++processing_template_declscope_chain->x_processing_template_decl; |
1212 | if (!any_dependent_template_arguments_p (args)) |
1213 | verify_unstripped_args_1 (INNERMOST_TEMPLATE_ARGS (args)(get_innermost_template_args ((args), 1))); |
1214 | --processing_template_declscope_chain->x_processing_template_decl; |
1215 | } |
1216 | |
1217 | /* Retrieve the specialization (in the sense of [temp.spec] - a |
1218 | specialization is either an instantiation or an explicit |
1219 | specialization) of TMPL for the given template ARGS. If there is |
1220 | no such specialization, return NULL_TREE. The ARGS are a vector of |
1221 | arguments, or a vector of vectors of arguments, in the case of |
1222 | templates with more than one level of parameters. |
1223 | |
1224 | If TMPL is a type template and CLASS_SPECIALIZATIONS_P is true, |
1225 | then we search for a partial specialization matching ARGS. This |
1226 | parameter is ignored if TMPL is not a class template. |
1227 | |
1228 | We can also look up a FIELD_DECL, if it is a lambda capture pack; the |
1229 | result is a NONTYPE_ARGUMENT_PACK. */ |
1230 | |
1231 | static tree |
1232 | retrieve_specialization (tree tmpl, tree args, hashval_t hash) |
1233 | { |
1234 | if (tmpl == NULL_TREE(tree) __null) |
1235 | return NULL_TREE(tree) __null; |
1236 | |
1237 | if (args == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1238 | return NULL_TREE(tree) __null; |
1239 | |
1240 | gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL((void)(!(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL || ((enum tree_code) (tmpl)->base.code) == FIELD_DECL) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1241, __FUNCTION__), 0 : 0)) |
1241 | || TREE_CODE (tmpl) == FIELD_DECL)((void)(!(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL || ((enum tree_code) (tmpl)->base.code) == FIELD_DECL) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1241, __FUNCTION__), 0 : 0)); |
1242 | |
1243 | /* There should be as many levels of arguments as there are |
1244 | levels of parameters. */ |
1245 | gcc_assert (TMPL_ARGS_DEPTH (args)((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) == (((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? ( (long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__)))) : template_class_depth (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__), 0 : 0)) |
1246 | == (TREE_CODE (tmpl) == TEMPLATE_DECL((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) == (((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? ( (long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__)))) : template_class_depth (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__), 0 : 0)) |
1247 | ? TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) == (((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? ( (long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__)))) : template_class_depth (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__), 0 : 0)) |
1248 | : template_class_depth (DECL_CONTEXT (tmpl))))((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((args), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1245, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) == (((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? ( (long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1247, __FUNCTION__)))) : template_class_depth (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1248, __FUNCTION__), 0 : 0)); |
1249 | |
1250 | if (flag_checkingglobal_options.x_flag_checking) |
1251 | verify_unstripped_args (args); |
1252 | |
1253 | /* Lambda functions in templates aren't instantiated normally, but through |
1254 | tsubst_lambda_expr. */ |
1255 | if (lambda_fn_in_template_p (tmpl)) |
1256 | return NULL_TREE(tree) __null; |
1257 | |
1258 | if (optimize_specialization_lookup_p (tmpl)) |
1259 | { |
1260 | /* The template arguments actually apply to the containing |
1261 | class. Find the class specialization with those |
1262 | arguments. */ |
1263 | tree class_template = CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (tmpl))((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((((contains_struct_check ((tmpl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1263, __FUNCTION__))->decl_minimal.context)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1263, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1263, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1263, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
1264 | tree class_specialization |
1265 | = retrieve_specialization (class_template, args, 0); |
1266 | if (!class_specialization) |
1267 | return NULL_TREE(tree) __null; |
1268 | |
1269 | /* Find the instance of TMPL. */ |
1270 | tree fns = get_class_binding (class_specialization, DECL_NAME (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1270, __FUNCTION__))->decl_minimal.name)); |
1271 | for (ovl_iterator iter (fns); iter; ++iter) |
1272 | { |
1273 | tree fn = *iter; |
1274 | if (tree ti = get_template_info (fn)) |
1275 | if (TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1275, __FUNCTION__, (TEMPLATE_INFO))))->tmpl == tmpl |
1276 | /* using-declarations can bring in a different |
1277 | instantiation of tmpl as a member of a different |
1278 | instantiation of tmpl's class. We don't want those |
1279 | here. */ |
1280 | && DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1280, __FUNCTION__))->decl_minimal.context) == class_specialization) |
1281 | return fn; |
1282 | } |
1283 | return NULL_TREE(tree) __null; |
1284 | } |
1285 | else |
1286 | { |
1287 | spec_entry *found; |
1288 | spec_entry elt; |
1289 | spec_hash_table *specializations; |
1290 | |
1291 | elt.tmpl = tmpl; |
1292 | elt.args = args; |
1293 | elt.spec = NULL_TREE(tree) __null; |
1294 | |
1295 | if (DECL_CLASS_TEMPLATE_P (tmpl)((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1295, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1295, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == TYPE_DECL) && (((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> (( ((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1295, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == TYPE_DECL && ((contains_struct_check (( ((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1295, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1295, __FUNCTION__))->decl_common.lang_flag_2)))) |
1296 | specializations = type_specializations; |
1297 | else |
1298 | specializations = decl_specializations; |
1299 | |
1300 | if (hash == 0) |
1301 | hash = spec_hasher::hash (&elt); |
1302 | found = specializations->find_with_hash (&elt, hash); |
1303 | if (found) |
1304 | return found->spec; |
1305 | } |
1306 | |
1307 | return NULL_TREE(tree) __null; |
1308 | } |
1309 | |
1310 | /* Like retrieve_specialization, but for local declarations. */ |
1311 | |
1312 | tree |
1313 | retrieve_local_specialization (tree tmpl) |
1314 | { |
1315 | if (local_specializationsscope_chain->x_local_specializations == NULL__null) |
1316 | return NULL_TREE(tree) __null; |
1317 | |
1318 | tree *slot = local_specializationsscope_chain->x_local_specializations->get (tmpl); |
1319 | return slot ? *slot : NULL_TREE(tree) __null; |
1320 | } |
1321 | |
1322 | /* Returns nonzero iff DECL is a specialization of TMPL. */ |
1323 | |
1324 | int |
1325 | is_specialization_of (tree decl, tree tmpl) |
1326 | { |
1327 | tree t; |
1328 | |
1329 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) |
1330 | { |
1331 | for (t = decl; |
1332 | t != NULL_TREE(tree) __null; |
1333 | t = DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1333, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1333, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) ? DECL_TI_TEMPLATE (t)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1333, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1333, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1333, __FUNCTION__, (TEMPLATE_INFO))))->tmpl : NULL_TREE(tree) __null) |
1334 | if (t == tmpl) |
1335 | return 1; |
1336 | } |
1337 | else |
1338 | { |
1339 | gcc_assert (TREE_CODE (decl) == TYPE_DECL)((void)(!(((enum tree_code) (decl)->base.code) == TYPE_DECL ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1339, __FUNCTION__), 0 : 0)); |
1340 | |
1341 | for (t = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1341, __FUNCTION__))->typed.type); |
1342 | t != NULL_TREE(tree) __null; |
1343 | t = CLASSTYPE_USE_TEMPLATE (t)((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1343, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) |
1344 | ? TREE_TYPE (CLASSTYPE_TI_TEMPLATE (t))((contains_struct_check ((((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1344, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1344, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1344, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1344, __FUNCTION__))->typed.type) : NULL_TREE(tree) __null) |
1345 | if (same_type_ignoring_top_level_qualifiers_p (t, TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1345, __FUNCTION__))->typed.type))) |
1346 | return 1; |
1347 | } |
1348 | |
1349 | return 0; |
1350 | } |
1351 | |
1352 | /* Returns nonzero iff DECL is a specialization of friend declaration |
1353 | FRIEND_DECL according to [temp.friend]. */ |
1354 | |
1355 | bool |
1356 | is_specialization_of_friend (tree decl, tree friend_decl) |
1357 | { |
1358 | bool need_template = true; |
1359 | int template_depth; |
1360 | |
1361 | gcc_assert (TREE_CODE (decl) == FUNCTION_DECL((void)(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1362, __FUNCTION__), 0 : 0)) |
1362 | || TREE_CODE (decl) == TYPE_DECL)((void)(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL || ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1362, __FUNCTION__), 0 : 0)); |
1363 | |
1364 | /* For [temp.friend/6] when FRIEND_DECL is an ordinary member function |
1365 | of a template class, we want to check if DECL is a specialization |
1366 | if this. */ |
1367 | if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) == FUNCTION_DECL |
1368 | && DECL_TEMPLATE_INFO (friend_decl)(((contains_struct_check ((template_info_decl_check ((friend_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1368, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1368, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) |
1369 | && !DECL_USE_TEMPLATE (friend_decl)(((contains_struct_check ((friend_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1369, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template)) |
1370 | { |
1371 | /* We want a TEMPLATE_DECL for `is_specialization_of'. */ |
1372 | friend_decl = DECL_TI_TEMPLATE (friend_decl)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((friend_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1372, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1372, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1372, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
1373 | need_template = false; |
1374 | } |
1375 | else if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) == TEMPLATE_DECL |
1376 | && !PRIMARY_TEMPLATE_P (friend_decl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((friend_decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1376, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1376, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1376, __FUNCTION__))->typed.type))) == (friend_decl))) |
1377 | need_template = false; |
1378 | |
1379 | /* There is nothing to do if this is not a template friend. */ |
1380 | if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) != TEMPLATE_DECL) |
1381 | return false; |
1382 | |
1383 | if (is_specialization_of (decl, friend_decl)) |
1384 | return true; |
1385 | |
1386 | /* [temp.friend/6] |
1387 | A member of a class template may be declared to be a friend of a |
1388 | non-template class. In this case, the corresponding member of |
1389 | every specialization of the class template is a friend of the |
1390 | class granting friendship. |
1391 | |
1392 | For example, given a template friend declaration |
1393 | |
1394 | template <class T> friend void A<T>::f(); |
1395 | |
1396 | the member function below is considered a friend |
1397 | |
1398 | template <> struct A<int> { |
1399 | void f(); |
1400 | }; |
1401 | |
1402 | For this type of template friend, TEMPLATE_DEPTH below will be |
1403 | nonzero. To determine if DECL is a friend of FRIEND, we first |
1404 | check if the enclosing class is a specialization of another. */ |
1405 | |
1406 | template_depth = template_class_depth (CP_DECL_CONTEXT (friend_decl)(!(! (((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1406, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1406, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((friend_decl ), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1406, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL])); |
1407 | if (template_depth |
1408 | && DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1408, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1408, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)) |
1409 | && is_specialization_of (TYPE_NAME (DECL_CONTEXT (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1409, __FUNCTION__))->decl_minimal.context)), (tcc_type) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1409, __FUNCTION__))->type_common.name), |
1410 | CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (friend_decl))((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1410, __FUNCTION__))->decl_minimal.context)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1410, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1410, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1410, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)) |
1411 | { |
1412 | /* Next, we check the members themselves. In order to handle |
1413 | a few tricky cases, such as when FRIEND_DECL's are |
1414 | |
1415 | template <class T> friend void A<T>::g(T t); |
1416 | template <class T> template <T t> friend void A<T>::h(); |
1417 | |
1418 | and DECL's are |
1419 | |
1420 | void A<int>::g(int); |
1421 | template <int> void A<int>::h(); |
1422 | |
1423 | we need to figure out ARGS, the template arguments from |
1424 | the context of DECL. This is required for template substitution |
1425 | of `T' in the function parameter of `g' and template parameter |
1426 | of `h' in the above examples. Here ARGS corresponds to `int'. */ |
1427 | |
1428 | tree context = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1428, __FUNCTION__))->decl_minimal.context); |
1429 | tree args = NULL_TREE(tree) __null; |
1430 | int current_depth = 0; |
1431 | |
1432 | while (current_depth < template_depth) |
1433 | { |
1434 | if (CLASSTYPE_TEMPLATE_INFO (context)(((tree_class_check (((tree_check3 ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1434, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1434, __FUNCTION__))->type_non_common.lang_1))) |
1435 | { |
1436 | if (current_depth == 0) |
1437 | args = TYPE_TI_ARGS (context)(((struct tree_template_info*)(tree_check (((((enum tree_code ) (context)->base.code) == ENUMERAL_TYPE || ((enum tree_code ) (context)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (context)->base.code) == RECORD_TYPE || ((enum tree_code) (context)->base.code) == UNION_TYPE || ( (enum tree_code) (context)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1437, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1437, __FUNCTION__, (TEMPLATE_INFO))))->args); |
1438 | else |
1439 | args = add_to_template_args (TYPE_TI_ARGS (context)(((struct tree_template_info*)(tree_check (((((enum tree_code ) (context)->base.code) == ENUMERAL_TYPE || ((enum tree_code ) (context)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (context)->base.code) == RECORD_TYPE || ((enum tree_code) (context)->base.code) == UNION_TYPE || ( (enum tree_code) (context)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1439, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1439, __FUNCTION__, (TEMPLATE_INFO))))->args), args); |
1440 | current_depth++; |
1441 | } |
1442 | context = TYPE_CONTEXT (context)((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1442, __FUNCTION__))->type_common.context); |
1443 | } |
1444 | |
1445 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) |
1446 | { |
1447 | bool is_template; |
1448 | tree friend_type; |
1449 | tree decl_type; |
1450 | tree friend_args_type; |
1451 | tree decl_args_type; |
1452 | |
1453 | /* Make sure that both DECL and FRIEND_DECL are templates or |
1454 | non-templates. */ |
1455 | is_template = DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1455, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1455, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) |
1456 | && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check (((((contains_struct_check ( (template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1456, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)); |
1457 | if (need_template ^ is_template) |
1458 | return false; |
1459 | else if (is_template) |
1460 | { |
1461 | /* If both are templates, check template parameter list. */ |
1462 | tree friend_parms |
1463 | = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_decl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((friend_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1463, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments, |
1464 | args, tf_none); |
1465 | if (!comp_template_parms |
1466 | (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (decl))((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1466, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1466, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1466, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1466, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments, |
1467 | friend_parms)) |
1468 | return false; |
1469 | |
1470 | decl_type = TREE_TYPE (DECL_TI_TEMPLATE (decl))((contains_struct_check ((((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1470, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1470, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1470, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1470, __FUNCTION__))->typed.type); |
1471 | } |
1472 | else |
1473 | decl_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1473, __FUNCTION__))->typed.type); |
1474 | |
1475 | friend_type = tsubst_function_type (TREE_TYPE (friend_decl)((contains_struct_check ((friend_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1475, __FUNCTION__))->typed.type), args, |
1476 | tf_none, NULL_TREE(tree) __null); |
1477 | if (friend_type == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1478 | return false; |
1479 | |
1480 | /* Check if return types match. */ |
1481 | if (!same_type_p (TREE_TYPE (decl_type), TREE_TYPE (friend_type))comptypes ((((contains_struct_check ((decl_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1481, __FUNCTION__))->typed.type)), (((contains_struct_check ((friend_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1481, __FUNCTION__))->typed.type)), 0)) |
1482 | return false; |
1483 | |
1484 | /* Check if function parameter types match, ignoring the |
1485 | `this' parameter. */ |
1486 | friend_args_type = TYPE_ARG_TYPES (friend_type)((tree_check2 ((friend_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1486, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
1487 | decl_args_type = TYPE_ARG_TYPES (decl_type)((tree_check2 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1487, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
1488 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (friend_decl)(((enum tree_code) (((contains_struct_check ((friend_decl), ( TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1488, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) |
1489 | friend_args_type = TREE_CHAIN (friend_args_type)((contains_struct_check ((friend_args_type), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1489, __FUNCTION__))->common.chain); |
1490 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1490, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) |
1491 | decl_args_type = TREE_CHAIN (decl_args_type)((contains_struct_check ((decl_args_type), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1491, __FUNCTION__))->common.chain); |
1492 | |
1493 | return compparms (decl_args_type, friend_args_type); |
1494 | } |
1495 | else |
1496 | { |
1497 | /* DECL is a TYPE_DECL */ |
1498 | bool is_template; |
1499 | tree decl_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1499, __FUNCTION__))->typed.type); |
1500 | |
1501 | /* Make sure that both DECL and FRIEND_DECL are templates or |
1502 | non-templates. */ |
1503 | is_template |
1504 | = CLASSTYPE_TEMPLATE_INFO (decl_type)(((tree_class_check (((tree_check3 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1504, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1504, __FUNCTION__))->type_non_common.lang_1)) |
1505 | && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (decl_type))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((tree_class_check (((tree_check3 ((decl_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1505, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)); |
1506 | |
1507 | if (need_template ^ is_template) |
1508 | return false; |
1509 | else if (is_template) |
1510 | { |
1511 | tree friend_parms; |
1512 | /* If both are templates, check the name of the two |
1513 | TEMPLATE_DECL's first because is_friend didn't. */ |
1514 | if (DECL_NAME (CLASSTYPE_TI_TEMPLATE (decl_type))((contains_struct_check ((((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1514, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1514, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1514, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1514, __FUNCTION__))->decl_minimal.name) |
1515 | != DECL_NAME (friend_decl)((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1515, __FUNCTION__))->decl_minimal.name)) |
1516 | return false; |
1517 | |
1518 | /* Now check template parameter list. */ |
1519 | friend_parms |
1520 | = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_decl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((friend_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1520, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments, |
1521 | args, tf_none); |
1522 | return comp_template_parms |
1523 | (DECL_TEMPLATE_PARMS (CLASSTYPE_TI_TEMPLATE (decl_type))((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1523, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1523, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1523, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1523, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments, |
1524 | friend_parms); |
1525 | } |
1526 | else |
1527 | return (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1527, __FUNCTION__))->decl_minimal.name) |
1528 | == DECL_NAME (friend_decl)((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1528, __FUNCTION__))->decl_minimal.name)); |
1529 | } |
1530 | } |
1531 | return false; |
1532 | } |
1533 | |
1534 | /* Register the specialization SPEC as a specialization of TMPL with |
1535 | the indicated ARGS. IS_FRIEND indicates whether the specialization |
1536 | is actually just a friend declaration. ATTRLIST is the list of |
1537 | attributes that the specialization is declared with or NULL when |
1538 | it isn't. Returns SPEC, or an equivalent prior declaration, if |
1539 | available. |
1540 | |
1541 | We also store instantiations of field packs in the hash table, even |
1542 | though they are not themselves templates, to make lookup easier. */ |
1543 | |
1544 | static tree |
1545 | register_specialization (tree spec, tree tmpl, tree args, bool is_friend, |
1546 | hashval_t hash) |
1547 | { |
1548 | tree fn; |
1549 | spec_entry **slot = NULL__null; |
1550 | spec_entry elt; |
1551 | |
1552 | gcc_assert ((TREE_CODE (tmpl) == TEMPLATE_DECL && DECL_P (spec))((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && (tree_code_type[(int) (((enum tree_code) (spec)-> base.code))] == tcc_declaration)) || (((enum tree_code) (tmpl )->base.code) == FIELD_DECL && ((enum tree_code) ( spec)->base.code) == NONTYPE_ARGUMENT_PACK)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1554, __FUNCTION__), 0 : 0)) |
1553 | || (TREE_CODE (tmpl) == FIELD_DECL((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && (tree_code_type[(int) (((enum tree_code) (spec)-> base.code))] == tcc_declaration)) || (((enum tree_code) (tmpl )->base.code) == FIELD_DECL && ((enum tree_code) ( spec)->base.code) == NONTYPE_ARGUMENT_PACK)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1554, __FUNCTION__), 0 : 0)) |
1554 | && TREE_CODE (spec) == NONTYPE_ARGUMENT_PACK))((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && (tree_code_type[(int) (((enum tree_code) (spec)-> base.code))] == tcc_declaration)) || (((enum tree_code) (tmpl )->base.code) == FIELD_DECL && ((enum tree_code) ( spec)->base.code) == NONTYPE_ARGUMENT_PACK)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1554, __FUNCTION__), 0 : 0)); |
1555 | |
1556 | if (TREE_CODE (spec)((enum tree_code) (spec)->base.code) == FUNCTION_DECL |
1557 | && uses_template_parms (DECL_TI_ARGS (spec)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((spec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1557, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1557, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1557, __FUNCTION__, (TEMPLATE_INFO))))->args)) |
1558 | /* This is the FUNCTION_DECL for a partial instantiation. Don't |
1559 | register it; we want the corresponding TEMPLATE_DECL instead. |
1560 | We use `uses_template_parms (DECL_TI_ARGS (spec))' rather than |
1561 | the more obvious `uses_template_parms (spec)' to avoid problems |
1562 | with default function arguments. In particular, given |
1563 | something like this: |
1564 | |
1565 | template <class T> void f(T t1, T t = T()) |
1566 | |
1567 | the default argument expression is not substituted for in an |
1568 | instantiation unless and until it is actually needed. */ |
1569 | return spec; |
1570 | |
1571 | if (optimize_specialization_lookup_p (tmpl)) |
1572 | /* We don't put these specializations in the hash table, but we might |
1573 | want to give an error about a mismatch. */ |
1574 | fn = retrieve_specialization (tmpl, args, 0); |
1575 | else |
1576 | { |
1577 | elt.tmpl = tmpl; |
1578 | elt.args = args; |
1579 | elt.spec = spec; |
1580 | |
1581 | if (hash == 0) |
1582 | hash = spec_hasher::hash (&elt); |
1583 | |
1584 | slot = decl_specializations->find_slot_with_hash (&elt, hash, INSERT); |
1585 | if (*slot) |
1586 | fn = (*slot)->spec; |
1587 | else |
1588 | fn = NULL_TREE(tree) __null; |
1589 | } |
1590 | |
1591 | /* We can sometimes try to re-register a specialization that we've |
1592 | already got. In particular, regenerate_decl_from_template calls |
1593 | duplicate_decls which will update the specialization list. But, |
1594 | we'll still get called again here anyhow. It's more convenient |
1595 | to simply allow this than to try to prevent it. */ |
1596 | if (fn == spec) |
1597 | return spec; |
1598 | else if (fn && DECL_TEMPLATE_SPECIALIZATION (spec)((((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1598, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2)) |
1599 | { |
1600 | if (DECL_TEMPLATE_INSTANTIATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1600, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) & 1)) |
1601 | { |
1602 | if (DECL_ODR_USED (fn)(((contains_struct_check (((tree_check2 ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1602, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1602, __FUNCTION__))->decl_common.lang_specific) ->u. base.odr_used) |
1603 | || DECL_EXPLICIT_INSTANTIATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1603, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 3)) |
1604 | { |
1605 | error ("specialization of %qD after instantiation", |
1606 | fn); |
1607 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1608 | } |
1609 | else |
1610 | { |
1611 | tree clone; |
1612 | /* This situation should occur only if the first |
1613 | specialization is an implicit instantiation, the |
1614 | second is an explicit specialization, and the |
1615 | implicit instantiation has not yet been used. That |
1616 | situation can occur if we have implicitly |
1617 | instantiated a member function and then specialized |
1618 | it later. |
1619 | |
1620 | We can also wind up here if a friend declaration that |
1621 | looked like an instantiation turns out to be a |
1622 | specialization: |
1623 | |
1624 | template <class T> void foo(T); |
1625 | class S { friend void foo<>(int) }; |
1626 | template <> void foo(int); |
1627 | |
1628 | We transform the existing DECL in place so that any |
1629 | pointers to it become pointers to the updated |
1630 | declaration. |
1631 | |
1632 | If there was a definition for the template, but not |
1633 | for the specialization, we want this to look as if |
1634 | there were no definition, and vice versa. */ |
1635 | DECL_INITIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1635, __FUNCTION__))->decl_common.initial) = NULL_TREE(tree) __null; |
1636 | duplicate_decls (spec, fn, /*hiding=*/is_friend); |
1637 | /* The call to duplicate_decls will have applied |
1638 | [temp.expl.spec]: |
1639 | |
1640 | An explicit specialization of a function template |
1641 | is inline only if it is explicitly declared to be, |
1642 | and independently of whether its function template |
1643 | is. |
1644 | |
1645 | to the primary function; now copy the inline bits to |
1646 | the various clones. */ |
1647 | FOR_EACH_CLONE (clone, fn)if (!(((enum tree_code) (fn)->base.code) == FUNCTION_DECL && ((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((fn), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ; else for (clone = (((contains_struct_check (((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->common.chain)); clone && ( ((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check ((clone ), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check ((clone) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER]))); clone = (((contains_struct_check ( ((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1647, __FUNCTION__))->common.chain))) |
1648 | { |
1649 | DECL_DECLARED_INLINE_P (clone)((tree_check ((clone), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1649, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ) |
1650 | = DECL_DECLARED_INLINE_P (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1650, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag ); |
1651 | DECL_SOURCE_LOCATION (clone)((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1651, __FUNCTION__))->decl_minimal.locus) |
1652 | = DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1652, __FUNCTION__))->decl_minimal.locus); |
1653 | 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1653, __FUNCTION__, (TEMPLATE_DECL))))))))->result : clone )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1653, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1653, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((clone ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1653, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1653, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ) |
1654 | = 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1654, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1654, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1654, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1654, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1654, __FUNCTION__); <->u.fn; })->min.base.threadprivate_or_deleted_p ); |
1655 | } |
1656 | check_specialization_namespace (tmpl); |
1657 | |
1658 | return fn; |
1659 | } |
1660 | } |
1661 | else if (DECL_TEMPLATE_SPECIALIZATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1661, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2)) |
1662 | { |
1663 | tree dd = duplicate_decls (spec, fn, /*hiding=*/is_friend); |
1664 | if (dd == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
1665 | /* We've already complained in duplicate_decls. */ |
1666 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
1667 | |
1668 | if (dd == NULL_TREE(tree) __null && DECL_INITIAL (spec)((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1668, __FUNCTION__))->decl_common.initial)) |
1669 | /* Dup decl failed, but this is a new definition. Set the |
1670 | line number so any errors match this new |
1671 | definition. */ |
1672 | DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1672, __FUNCTION__))->decl_minimal.locus) = DECL_SOURCE_LOCATION (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1672, __FUNCTION__))->decl_minimal.locus); |
1673 | |
1674 | return fn; |
1675 | } |
1676 | } |
1677 | else if (fn) |
1678 | return duplicate_decls (spec, fn, /*hiding=*/is_friend); |
1679 | |
1680 | /* A specialization must be declared in the same namespace as the |
1681 | template it is specializing. */ |
1682 | if (DECL_P (spec)(tree_code_type[(int) (((enum tree_code) (spec)->base.code ))] == tcc_declaration) && DECL_TEMPLATE_SPECIALIZATION (spec)((((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1682, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) == 2) |
1683 | && !check_specialization_namespace (tmpl)) |
1684 | DECL_CONTEXT (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1684, __FUNCTION__))->decl_minimal.context) = DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1684, __FUNCTION__))->decl_minimal.context); |
1685 | |
1686 | if (slot != NULL__null /* !optimize_specialization_lookup_p (tmpl) */) |
1687 | { |
1688 | spec_entry *entry = ggc_alloc<spec_entry> (); |
1689 | gcc_assert (tmpl && args && spec)((void)(!(tmpl && args && spec) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1689, __FUNCTION__), 0 : 0)); |
1690 | *entry = elt; |
1691 | *slot = entry; |
1692 | if ((TREE_CODE (spec)((enum tree_code) (spec)->base.code) == FUNCTION_DECL && DECL_NAMESPACE_SCOPE_P (spec)(!(((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1692, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (spec)->base.code) == CONST_DECL || (( enum tree_code) (spec)->base.code) == PARM_DECL || ((enum tree_code ) (spec)->base.code) == TYPE_DECL || ((enum tree_code) (spec )->base.code) == TEMPLATE_DECL)) && ((enum tree_code ) ((!(! (((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1692, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1692, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((spec) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1692, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL) |
1693 | && PRIMARY_TEMPLATE_P (tmpl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1693, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1693, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1693, __FUNCTION__))->typed.type))) == (tmpl)) |
1694 | && DECL_SAVED_TREE (DECL_TEMPLATE_RESULT (tmpl))((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1694, __FUNCTION__, (TEMPLATE_DECL))))))))->result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1694, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree ) == NULL_TREE(tree) __null) |
1695 | || variable_template_p (tmpl)) |
1696 | /* If TMPL is a forward declaration of a template function, keep a list |
1697 | of all specializations in case we need to reassign them to a friend |
1698 | template later in tsubst_friend_function. |
1699 | |
1700 | Also keep a list of all variable template instantiations so that |
1701 | process_partial_specialization can check whether a later partial |
1702 | specialization would have used it. */ |
1703 | DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1703, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1703, __FUNCTION__))->decl_common.size_unit) |
1704 | = tree_cons (args, spec, DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1704, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1704, __FUNCTION__))->decl_common.size_unit)); |
1705 | } |
1706 | |
1707 | return spec; |
1708 | } |
1709 | |
1710 | /* Restricts tree and type comparisons. */ |
1711 | int comparing_specializations; |
1712 | |
1713 | /* Returns true iff two spec_entry nodes are equivalent. */ |
1714 | |
1715 | bool |
1716 | spec_hasher::equal (spec_entry *e1, spec_entry *e2) |
1717 | { |
1718 | int equal; |
1719 | |
1720 | ++comparing_specializations; |
1721 | equal = (e1->tmpl == e2->tmpl |
1722 | && comp_template_args (e1->args, e2->args)); |
1723 | if (equal && flag_conceptsglobal_options.x_flag_concepts |
1724 | /* tmpl could be a FIELD_DECL for a capture pack. */ |
1725 | && TREE_CODE (e1->tmpl)((enum tree_code) (e1->tmpl)->base.code) == TEMPLATE_DECL |
1726 | && VAR_P (DECL_TEMPLATE_RESULT (e1->tmpl))(((enum tree_code) (((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((e1->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1726, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == VAR_DECL) |
1727 | && uses_template_parms (e1->args)) |
1728 | { |
1729 | /* Partial specializations of a variable template can be distinguished by |
1730 | constraints. */ |
1731 | tree c1 = e1->spec ? get_constraints (e1->spec) : NULL_TREE(tree) __null; |
1732 | tree c2 = e2->spec ? get_constraints (e2->spec) : NULL_TREE(tree) __null; |
1733 | equal = equivalent_constraints (c1, c2); |
1734 | } |
1735 | --comparing_specializations; |
1736 | |
1737 | return equal; |
1738 | } |
1739 | |
1740 | /* Returns a hash for a template TMPL and template arguments ARGS. */ |
1741 | |
1742 | static hashval_t |
1743 | hash_tmpl_and_args (tree tmpl, tree args) |
1744 | { |
1745 | hashval_t val = iterative_hash_object (DECL_UID (tmpl), 0)iterative_hash (&((contains_struct_check ((tmpl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1745, __FUNCTION__))->decl_minimal.uid), sizeof (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1745, __FUNCTION__))->decl_minimal.uid)), 0); |
1746 | return iterative_hash_template_arg (args, val); |
1747 | } |
1748 | |
1749 | /* Returns a hash for a spec_entry node based on the TMPL and ARGS members, |
1750 | ignoring SPEC. */ |
1751 | |
1752 | hashval_t |
1753 | spec_hasher::hash (spec_entry *e) |
1754 | { |
1755 | return hash_tmpl_and_args (e->tmpl, e->args); |
1756 | } |
1757 | |
1758 | /* Recursively calculate a hash value for a template argument ARG, for use |
1759 | in the hash tables of template specializations. We must be |
1760 | careful to (at least) skip the same entities template_args_equal |
1761 | does. */ |
1762 | |
1763 | hashval_t |
1764 | iterative_hash_template_arg (tree arg, hashval_t val) |
1765 | { |
1766 | if (arg == NULL_TREE(tree) __null) |
1767 | return iterative_hash_object (arg, val)iterative_hash (&arg, sizeof (arg), val); |
1768 | |
1769 | if (!TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code) )] == tcc_type)) |
1770 | /* Strip nop-like things, but not the same as STRIP_NOPS. */ |
1771 | while (CONVERT_EXPR_P (arg)((((enum tree_code) (arg)->base.code)) == NOP_EXPR || (((enum tree_code) (arg)->base.code)) == CONVERT_EXPR) |
1772 | || TREE_CODE (arg)((enum tree_code) (arg)->base.code) == NON_LVALUE_EXPR |
1773 | || class_nttp_const_wrapper_p (arg)) |
1774 | arg = TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1774, __FUNCTION__))))); |
1775 | |
1776 | enum tree_code code = TREE_CODE (arg)((enum tree_code) (arg)->base.code); |
1777 | |
1778 | val = iterative_hash_object (code, val)iterative_hash (&code, sizeof (code), val); |
1779 | |
1780 | switch (code) |
1781 | { |
1782 | case ARGUMENT_PACK_SELECT: |
1783 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1783, __FUNCTION__)); |
1784 | |
1785 | case ERROR_MARK: |
1786 | return val; |
1787 | |
1788 | case IDENTIFIER_NODE: |
1789 | return iterative_hash_object (IDENTIFIER_HASH_VALUE (arg), val)iterative_hash (&((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1789, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value ), sizeof (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1789, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value )), val); |
1790 | |
1791 | case TREE_VEC: |
1792 | for (int i = 0, len = TREE_VEC_LENGTH (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1792, __FUNCTION__, (TREE_VEC)))->base.u.length); i < len; ++i) |
1793 | val = iterative_hash_template_arg (TREE_VEC_ELT (arg, i)(*((const_cast<tree *> (tree_vec_elt_check ((arg), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1793, __FUNCTION__))))), val); |
1794 | return val; |
1795 | |
1796 | case TYPE_PACK_EXPANSION: |
1797 | case EXPR_PACK_EXPANSION: |
1798 | val = iterative_hash_template_arg (PACK_EXPANSION_PATTERN (arg)(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1798, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1798, __FUNCTION__)))))), val); |
1799 | return iterative_hash_template_arg (PACK_EXPANSION_EXTRA_ARGS (arg)*(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION ? &((tree_class_check ((arg), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1799, __FUNCTION__))->type_non_common.maxval) : &(*( (const_cast<tree*> (tree_operand_check (((arg)), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1799, __FUNCTION__)))))), val); |
1800 | |
1801 | case TYPE_ARGUMENT_PACK: |
1802 | case NONTYPE_ARGUMENT_PACK: |
1803 | return iterative_hash_template_arg (ARGUMENT_PACK_ARGS (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK ? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1803, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1803, __FUNCTION__)))))), val); |
1804 | |
1805 | case TREE_LIST: |
1806 | for (; arg; arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1806, __FUNCTION__))->common.chain)) |
1807 | val = iterative_hash_template_arg (TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1807, __FUNCTION__, (TREE_LIST)))->list.value), val); |
1808 | return val; |
1809 | |
1810 | case OVERLOAD: |
1811 | for (lkp_iterator iter (arg); iter; ++iter) |
1812 | val = iterative_hash_template_arg (*iter, val); |
1813 | return val; |
1814 | |
1815 | case CONSTRUCTOR: |
1816 | { |
1817 | tree field, value; |
1818 | unsigned i; |
1819 | iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1819, __FUNCTION__))->typed.type), val); |
1820 | FOR_EACH_CONSTRUCTOR_ELT (CONSTRUCTOR_ELTS (arg), i, field, value)for (i = 0; (i >= vec_safe_length (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1820, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))) ? false : (((void) (value = (*((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1820, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))[ i].value)), (field = (*((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1820, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts))[ i].index), true); (i)++) |
1821 | { |
1822 | val = iterative_hash_template_arg (field, val); |
1823 | val = iterative_hash_template_arg (value, val); |
1824 | } |
1825 | return val; |
1826 | } |
1827 | |
1828 | case PARM_DECL: |
1829 | if (!DECL_ARTIFICIAL (arg)((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1829, __FUNCTION__))->decl_common.artificial_flag)) |
1830 | { |
1831 | val = iterative_hash_object (DECL_PARM_INDEX (arg), val)iterative_hash (&(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1831, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (arg)->base.code) != PARM_DECL || lt->u .base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1831, __FUNCTION__); <->u.parm; })->index), sizeof ((__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1831, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (arg)->base.code) != PARM_DECL || lt->u .base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1831, __FUNCTION__); <->u.parm; })->index)), val ); |
1832 | val = iterative_hash_object (DECL_PARM_LEVEL (arg), val)iterative_hash (&(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1832, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (arg)->base.code) != PARM_DECL || lt->u .base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1832, __FUNCTION__); <->u.parm; })->level), sizeof ((__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1832, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (arg)->base.code) != PARM_DECL || lt->u .base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1832, __FUNCTION__); <->u.parm; })->level)), val ); |
1833 | } |
1834 | return iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1834, __FUNCTION__))->typed.type), val); |
1835 | |
1836 | case TARGET_EXPR: |
1837 | return iterative_hash_template_arg (TARGET_EXPR_INITIAL (arg)(*(tree_operand_check_code ((arg), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1837, __FUNCTION__))), val); |
1838 | |
1839 | case PTRMEM_CST: |
1840 | val = iterative_hash_template_arg (PTRMEM_CST_CLASS (arg)((((enum tree_code) (((contains_struct_check (((tree_check (( arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__))->typed.type))->base.code) == OFFSET_TYPE ) ? ((tree_check ((((contains_struct_check (((tree_check ((arg ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval ) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real ((((contains_struct_check ((((tree_check3 ((((contains_struct_check (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__))->typed.type)), (cp_type_quals (((contains_struct_check (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__))->typed.type))), tf_warning_or_error ))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1840, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .maxval)), val); |
1841 | return iterative_hash_template_arg (PTRMEM_CST_MEMBER (arg)(((ptrmem_cst_t)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1841, __FUNCTION__, (PTRMEM_CST))))->member), val); |
1842 | |
1843 | case TEMPLATE_PARM_INDEX: |
1844 | val = iterative_hash_template_arg |
1845 | (TREE_TYPE (TEMPLATE_PARM_DECL (arg))((contains_struct_check (((((template_parm_index*)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1845, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->decl)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1845, __FUNCTION__))->typed.type), val); |
1846 | val = iterative_hash_object (TEMPLATE_PARM_LEVEL (arg), val)iterative_hash (&(((template_parm_index*)(tree_check ((arg ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1846, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level), sizeof ((((template_parm_index*)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1846, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)), val ); |
1847 | return iterative_hash_object (TEMPLATE_PARM_IDX (arg), val)iterative_hash (&(((template_parm_index*)(tree_check ((arg ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1847, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index), sizeof ((((template_parm_index*)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1847, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)), val ); |
1848 | |
1849 | case TRAIT_EXPR: |
1850 | val = iterative_hash_object (TRAIT_EXPR_KIND (arg), val)iterative_hash (&(((struct tree_trait_expr *)(tree_check ( (arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1850, __FUNCTION__, (TRAIT_EXPR))))->kind), sizeof ((((struct tree_trait_expr *)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1850, __FUNCTION__, (TRAIT_EXPR))))->kind)), val); |
1851 | val = iterative_hash_template_arg (TRAIT_EXPR_TYPE1 (arg)(((struct tree_trait_expr *)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1851, __FUNCTION__, (TRAIT_EXPR))))->type1), val); |
1852 | return iterative_hash_template_arg (TRAIT_EXPR_TYPE2 (arg)(((struct tree_trait_expr *)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1852, __FUNCTION__, (TRAIT_EXPR))))->type2), val); |
1853 | |
1854 | case BASELINK: |
1855 | val = iterative_hash_template_arg (BINFO_TYPE (BASELINK_BINFO (arg))((contains_struct_check (((tree_check (((((struct tree_baselink *) (tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1855, __FUNCTION__, (BASELINK))))->binfo)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1855, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1855, __FUNCTION__))->typed.type), |
1856 | val); |
1857 | return iterative_hash_template_arg (DECL_NAME (get_first_fn (arg))((contains_struct_check ((get_first_fn (arg)), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1857, __FUNCTION__))->decl_minimal.name), |
1858 | val); |
1859 | |
1860 | case MODOP_EXPR: |
1861 | val = iterative_hash_template_arg (TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1861, __FUNCTION__))))), val); |
1862 | code = TREE_CODE (TREE_OPERAND (arg, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check ((arg), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1862, __FUNCTION__))))))->base.code); |
1863 | val = iterative_hash_object (code, val)iterative_hash (&code, sizeof (code), val); |
1864 | return iterative_hash_template_arg (TREE_OPERAND (arg, 2)(*((const_cast<tree*> (tree_operand_check ((arg), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1864, __FUNCTION__))))), val); |
1865 | |
1866 | case LAMBDA_EXPR: |
1867 | /* [temp.over.link] Two lambda-expressions are never considered |
1868 | equivalent. |
1869 | |
1870 | So just hash the closure type. */ |
1871 | return iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1871, __FUNCTION__))->typed.type), val); |
1872 | |
1873 | case CAST_EXPR: |
1874 | case IMPLICIT_CONV_EXPR: |
1875 | case STATIC_CAST_EXPR: |
1876 | case REINTERPRET_CAST_EXPR: |
1877 | case CONST_CAST_EXPR: |
1878 | case DYNAMIC_CAST_EXPR: |
1879 | case NEW_EXPR: |
1880 | val = iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1880, __FUNCTION__))->typed.type), val); |
1881 | /* Now hash operands as usual. */ |
1882 | break; |
1883 | |
1884 | case CALL_EXPR: |
1885 | { |
1886 | tree fn = CALL_EXPR_FN (arg)(*((const_cast<tree*> (tree_operand_check (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1886, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1886, __FUNCTION__))))); |
1887 | if (tree name = dependent_name (fn)) |
1888 | { |
1889 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_ID_EXPR) |
1890 | val = iterative_hash_template_arg (TREE_OPERAND (fn, 1)(*((const_cast<tree*> (tree_operand_check ((fn), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1890, __FUNCTION__))))), val); |
1891 | fn = name; |
1892 | } |
1893 | val = iterative_hash_template_arg (fn, val); |
1894 | call_expr_arg_iterator ai; |
1895 | for (tree x = first_call_expr_arg (arg, &ai); x; |
1896 | x = next_call_expr_arg (&ai)) |
1897 | val = iterative_hash_template_arg (x, val); |
1898 | return val; |
1899 | } |
1900 | |
1901 | default: |
1902 | break; |
1903 | } |
1904 | |
1905 | char tclass = TREE_CODE_CLASS (code)tree_code_type[(int) (code)]; |
1906 | switch (tclass) |
1907 | { |
1908 | case tcc_type: |
1909 | if (tree ats = alias_template_specialization_p (arg, nt_transparent)) |
1910 | { |
1911 | // We want an alias specialization that survived strip_typedefs |
1912 | // to hash differently from its TYPE_CANONICAL, to avoid hash |
1913 | // collisions that compare as different in template_args_equal. |
1914 | // These could be dependent specializations that strip_typedefs |
1915 | // left alone, or untouched specializations because |
1916 | // coerce_template_parms returns the unconverted template |
1917 | // arguments if it sees incomplete argument packs. |
1918 | tree ti = TYPE_ALIAS_TEMPLATE_INFO (ats)(((contains_struct_check ((((tree_class_check ((ats), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1918, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1918, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check ((template_info_decl_check ((((tree_class_check ((ats), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1918, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1918, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1918, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) : (tree) __null); |
1919 | return hash_tmpl_and_args (TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1919, __FUNCTION__, (TEMPLATE_INFO))))->tmpl, TI_ARGS (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1919, __FUNCTION__, (TEMPLATE_INFO))))->args); |
1920 | } |
1921 | |
1922 | switch (TREE_CODE (arg)((enum tree_code) (arg)->base.code)) |
1923 | { |
1924 | case TEMPLATE_TEMPLATE_PARM: |
1925 | { |
1926 | tree tpi = TEMPLATE_TYPE_PARM_INDEX (arg)(((tree_class_check (((tree_check3 (((arg)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1926, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1926, __FUNCTION__))->type_non_common.values)); |
1927 | |
1928 | /* Do not recurse with TPI directly, as that is unbounded |
1929 | recursion. */ |
1930 | val = iterative_hash_object (TEMPLATE_PARM_LEVEL (tpi), val)iterative_hash (&(((template_parm_index*)(tree_check ((tpi ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1930, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level), sizeof ((((template_parm_index*)(tree_check ((tpi), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1930, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)), val ); |
1931 | val = iterative_hash_object (TEMPLATE_PARM_IDX (tpi), val)iterative_hash (&(((template_parm_index*)(tree_check ((tpi ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1931, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index), sizeof ((((template_parm_index*)(tree_check ((tpi), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1931, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)), val ); |
1932 | } |
1933 | break; |
1934 | |
1935 | case DECLTYPE_TYPE: |
1936 | val = iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg)(((tree_class_check (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1936, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1936, __FUNCTION__))->type_non_common.values)), val); |
1937 | break; |
1938 | |
1939 | default: |
1940 | if (tree canonical = TYPE_CANONICAL (arg)((tree_class_check ((arg), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1940, __FUNCTION__))->type_common.canonical)) |
1941 | val = iterative_hash_object (TYPE_HASH (canonical), val)iterative_hash (&(((tree_class_check ((canonical), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1941, __FUNCTION__))->type_common.uid)), sizeof ((((tree_class_check ((canonical), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1941, __FUNCTION__))->type_common.uid))), val); |
1942 | break; |
1943 | } |
1944 | |
1945 | return val; |
1946 | |
1947 | case tcc_declaration: |
1948 | case tcc_constant: |
1949 | return iterative_hash_expr (arg, val); |
1950 | |
1951 | default: |
1952 | gcc_assert (IS_EXPR_CODE_CLASS (tclass))((void)(!(((tclass) >= tcc_reference && (tclass) <= tcc_expression)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1952, __FUNCTION__), 0 : 0)); |
1953 | for (int i = 0, n = cp_tree_operand_length (arg); i < n; ++i) |
1954 | val = iterative_hash_template_arg (TREE_OPERAND (arg, i)(*((const_cast<tree*> (tree_operand_check ((arg), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1954, __FUNCTION__))))), val); |
1955 | return val; |
1956 | } |
1957 | |
1958 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1958, __FUNCTION__)); |
1959 | return 0; |
1960 | } |
1961 | |
1962 | /* Unregister the specialization SPEC as a specialization of TMPL. |
1963 | Replace it with NEW_SPEC, if NEW_SPEC is non-NULL. Returns true |
1964 | if the SPEC was listed as a specialization of TMPL. |
1965 | |
1966 | Note that SPEC has been ggc_freed, so we can't look inside it. */ |
1967 | |
1968 | bool |
1969 | reregister_specialization (tree spec, tree tinfo, tree new_spec) |
1970 | { |
1971 | spec_entry *entry; |
1972 | spec_entry elt; |
1973 | |
1974 | elt.tmpl = most_general_template (TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1974, __FUNCTION__, (TEMPLATE_INFO))))->tmpl); |
1975 | elt.args = TI_ARGS (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1975, __FUNCTION__, (TEMPLATE_INFO))))->args; |
1976 | elt.spec = NULL_TREE(tree) __null; |
1977 | |
1978 | entry = decl_specializations->find (&elt); |
1979 | if (entry != NULL__null) |
1980 | { |
1981 | gcc_assert (entry->spec == spec || entry->spec == new_spec)((void)(!(entry->spec == spec || entry->spec == new_spec ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1981, __FUNCTION__), 0 : 0)); |
1982 | gcc_assert (new_spec != NULL_TREE)((void)(!(new_spec != (tree) __null) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1982, __FUNCTION__), 0 : 0)); |
1983 | entry->spec = new_spec; |
1984 | return 1; |
1985 | } |
1986 | |
1987 | return 0; |
1988 | } |
1989 | |
1990 | /* Like register_specialization, but for local declarations. We are |
1991 | registering SPEC, an instantiation of TMPL. */ |
1992 | |
1993 | void |
1994 | register_local_specialization (tree spec, tree tmpl) |
1995 | { |
1996 | gcc_assert (tmpl != spec)((void)(!(tmpl != spec) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 1996, __FUNCTION__), 0 : 0)); |
1997 | local_specializationsscope_chain->x_local_specializations->put (tmpl, spec); |
1998 | } |
1999 | |
2000 | /* TYPE is a class type. Returns true if TYPE is an explicitly |
2001 | specialized class. */ |
2002 | |
2003 | bool |
2004 | explicit_class_specialization_p (tree type) |
2005 | { |
2006 | if (!CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2006, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 2)) |
2007 | return false; |
2008 | return !uses_template_parms (CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2008, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2008, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2008, __FUNCTION__, (TEMPLATE_INFO))))->args); |
2009 | } |
2010 | |
2011 | /* Print the list of functions at FNS, going through all the overloads |
2012 | for each element of the list. Alternatively, FNS cannot be a |
2013 | TREE_LIST, in which case it will be printed together with all the |
2014 | overloads. |
2015 | |
2016 | MORE and *STR should respectively be FALSE and NULL when the function |
2017 | is called from the outside. They are used internally on recursive |
2018 | calls. print_candidates manages the two parameters and leaves NULL |
2019 | in *STR when it ends. */ |
2020 | |
2021 | static void |
2022 | print_candidates_1 (tree fns, char **str, bool more = false) |
2023 | { |
2024 | if (TREE_CODE (fns)((enum tree_code) (fns)->base.code) == TREE_LIST) |
2025 | for (; fns; fns = TREE_CHAIN (fns)((contains_struct_check ((fns), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2025, __FUNCTION__))->common.chain)) |
2026 | print_candidates_1 (TREE_VALUE (fns)((tree_check ((fns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2026, __FUNCTION__, (TREE_LIST)))->list.value), str, more || TREE_CHAIN (fns)((contains_struct_check ((fns), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2026, __FUNCTION__))->common.chain)); |
2027 | else |
2028 | for (lkp_iterator iter (fns); iter;) |
2029 | { |
2030 | tree cand = *iter; |
2031 | ++iter; |
2032 | |
2033 | const char *pfx = *str; |
2034 | if (!pfx) |
2035 | { |
2036 | if (more || iter) |
2037 | pfx = _("candidates are:")gettext ("candidates are:"); |
2038 | else |
2039 | pfx = _("candidate is:")gettext ("candidate is:"); |
2040 | *str = get_spaces (pfx); |
2041 | } |
2042 | inform (DECL_SOURCE_LOCATION (cand)((contains_struct_check ((cand), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2042, __FUNCTION__))->decl_minimal.locus), "%s %#qD", pfx, cand); |
2043 | } |
2044 | } |
2045 | |
2046 | /* Print the list of candidate FNS in an error message. FNS can also |
2047 | be a TREE_LIST of non-functions in the case of an ambiguous lookup. */ |
2048 | |
2049 | void |
2050 | print_candidates (tree fns) |
2051 | { |
2052 | char *str = NULL__null; |
2053 | print_candidates_1 (fns, &str); |
2054 | free (str); |
2055 | } |
2056 | |
2057 | /* Get a (possibly) constrained template declaration for the |
2058 | purpose of ordering candidates. */ |
2059 | static tree |
2060 | get_template_for_ordering (tree list) |
2061 | { |
2062 | gcc_assert (TREE_CODE (list) == TREE_LIST)((void)(!(((enum tree_code) (list)->base.code) == TREE_LIST ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2062, __FUNCTION__), 0 : 0)); |
2063 | tree f = TREE_VALUE (list)((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2063, __FUNCTION__, (TREE_LIST)))->list.value); |
2064 | if (tree ti = DECL_TEMPLATE_INFO (f)(((contains_struct_check ((template_info_decl_check ((f), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2064, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2064, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)) |
2065 | return TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2065, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
2066 | return f; |
2067 | } |
2068 | |
2069 | /* Among candidates having the same signature, return the |
2070 | most constrained or NULL_TREE if there is no best candidate. |
2071 | If the signatures of candidates vary (e.g., template |
2072 | specialization vs. member function), then there can be no |
2073 | most constrained. |
2074 | |
2075 | Note that we don't compare constraints on the functions |
2076 | themselves, but rather those of their templates. */ |
2077 | static tree |
2078 | most_constrained_function (tree candidates) |
2079 | { |
2080 | // Try to find the best candidate in a first pass. |
2081 | tree champ = candidates; |
2082 | for (tree c = TREE_CHAIN (champ)((contains_struct_check ((champ), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2082, __FUNCTION__))->common.chain); c; c = TREE_CHAIN (c)((contains_struct_check ((c), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2082, __FUNCTION__))->common.chain)) |
2083 | { |
2084 | int winner = more_constrained (get_template_for_ordering (champ), |
2085 | get_template_for_ordering (c)); |
2086 | if (winner == -1) |
2087 | champ = c; // The candidate is more constrained |
2088 | else if (winner == 0) |
2089 | return NULL_TREE(tree) __null; // Neither is more constrained |
2090 | } |
2091 | |
2092 | // Verify that the champ is better than previous candidates. |
2093 | for (tree c = candidates; c != champ; c = TREE_CHAIN (c)((contains_struct_check ((c), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2093, __FUNCTION__))->common.chain)) { |
2094 | if (!more_constrained (get_template_for_ordering (champ), |
2095 | get_template_for_ordering (c))) |
2096 | return NULL_TREE(tree) __null; |
2097 | } |
2098 | |
2099 | return champ; |
2100 | } |
2101 | |
2102 | |
2103 | /* Returns the template (one of the functions given by TEMPLATE_ID) |
2104 | which can be specialized to match the indicated DECL with the |
2105 | explicit template args given in TEMPLATE_ID. The DECL may be |
2106 | NULL_TREE if none is available. In that case, the functions in |
2107 | TEMPLATE_ID are non-members. |
2108 | |
2109 | If NEED_MEMBER_TEMPLATE is nonzero the function is known to be a |
2110 | specialization of a member template. |
2111 | |
2112 | The TEMPLATE_COUNT is the number of references to qualifying |
2113 | template classes that appeared in the name of the function. See |
2114 | check_explicit_specialization for a more accurate description. |
2115 | |
2116 | TSK indicates what kind of template declaration (if any) is being |
2117 | declared. TSK_TEMPLATE indicates that the declaration given by |
2118 | DECL, though a FUNCTION_DECL, has template parameters, and is |
2119 | therefore a template function. |
2120 | |
2121 | The template args (those explicitly specified and those deduced) |
2122 | are output in a newly created vector *TARGS_OUT. |
2123 | |
2124 | If it is impossible to determine the result, an error message is |
2125 | issued. The error_mark_node is returned to indicate failure. */ |
2126 | |
2127 | static tree |
2128 | determine_specialization (tree template_id, |
2129 | tree decl, |
2130 | tree* targs_out, |
2131 | int need_member_template, |
2132 | int template_count, |
2133 | tmpl_spec_kind tsk) |
2134 | { |
2135 | tree fns; |
2136 | tree targs; |
2137 | tree explicit_targs; |
2138 | tree candidates = NULL_TREE(tree) __null; |
2139 | |
2140 | /* A TREE_LIST of templates of which DECL may be a specialization. |
2141 | The TREE_VALUE of each node is a TEMPLATE_DECL. The |
2142 | corresponding TREE_PURPOSE is the set of template arguments that, |
2143 | when used to instantiate the template, would produce a function |
2144 | with the signature of DECL. */ |
2145 | tree templates = NULL_TREE(tree) __null; |
2146 | int header_count; |
2147 | cp_binding_level *b; |
2148 | |
2149 | *targs_out = NULL_TREE(tree) __null; |
2150 | |
2151 | if (template_id == error_mark_nodeglobal_trees[TI_ERROR_MARK] || decl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2152 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2153 | |
2154 | /* We shouldn't be specializing a member template of an |
2155 | unspecialized class template; we already gave an error in |
2156 | check_specialization_scope, now avoid crashing. */ |
2157 | if (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) |
2158 | && template_count && DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2158, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2158, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)) |
2159 | && template_class_depth (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2159, __FUNCTION__))->decl_minimal.context)) > 0) |
2160 | { |
2161 | gcc_assert (errorcount)((void)(!((global_dc)->diagnostic_count[(int) (DK_ERROR)]) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2161, __FUNCTION__), 0 : 0)); |
2162 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2163 | } |
2164 | |
2165 | fns = TREE_OPERAND (template_id, 0)(*((const_cast<tree*> (tree_operand_check ((template_id ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2165, __FUNCTION__))))); |
2166 | explicit_targs = TREE_OPERAND (template_id, 1)(*((const_cast<tree*> (tree_operand_check ((template_id ), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2166, __FUNCTION__))))); |
2167 | |
2168 | if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2169 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2170 | |
2171 | /* Check for baselinks. */ |
2172 | if (BASELINK_P (fns)(((enum tree_code) (fns)->base.code) == BASELINK)) |
2173 | fns = BASELINK_FUNCTIONS (fns)(((struct tree_baselink*) (tree_check ((fns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2173, __FUNCTION__, (BASELINK))))->functions); |
2174 | |
2175 | if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL && !is_overloaded_fn (fns)) |
2176 | { |
2177 | error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2177, __FUNCTION__))->decl_minimal.locus), |
2178 | "%qD is not a function template", fns); |
2179 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2180 | } |
2181 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && !variable_template_p (fns)) |
2182 | { |
2183 | error ("%qD is not a variable template", fns); |
2184 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2185 | } |
2186 | |
2187 | /* Count the number of template headers specified for this |
2188 | specialization. */ |
2189 | header_count = 0; |
2190 | for (b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) && ((cfun + 0)->language)->bindings ? &((cfun + 0)-> language)->bindings : &scope_chain->bindings)); |
2191 | b->kind == sk_template_parms; |
2192 | b = b->level_chain) |
2193 | ++header_count; |
2194 | |
2195 | tree orig_fns = fns; |
2196 | |
2197 | if (variable_template_p (fns)) |
2198 | { |
2199 | tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (fns))((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2199, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2199, __FUNCTION__, (TREE_LIST)))->list.value); |
2200 | targs = coerce_template_parms (parms, explicit_targs, fns, |
2201 | tf_warning_or_error, |
2202 | /*req_all*/true, /*use_defarg*/true); |
2203 | if (targs != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2204 | templates = tree_cons (targs, fns, templates); |
2205 | } |
2206 | else for (lkp_iterator iter (fns); iter; ++iter) |
2207 | { |
2208 | tree fn = *iter; |
2209 | |
2210 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL) |
2211 | { |
2212 | tree decl_arg_types; |
2213 | tree fn_arg_types; |
2214 | tree insttype; |
2215 | |
2216 | /* In case of explicit specialization, we need to check if |
2217 | the number of template headers appearing in the specialization |
2218 | is correct. This is usually done in check_explicit_specialization, |
2219 | but the check done there cannot be exhaustive when specializing |
2220 | member functions. Consider the following code: |
2221 | |
2222 | template <> void A<int>::f(int); |
2223 | template <> template <> void A<int>::f(int); |
2224 | |
2225 | Assuming that A<int> is not itself an explicit specialization |
2226 | already, the first line specializes "f" which is a non-template |
2227 | member function, whilst the second line specializes "f" which |
2228 | is a template member function. So both lines are syntactically |
2229 | correct, and check_explicit_specialization does not reject |
2230 | them. |
2231 | |
2232 | Here, we can do better, as we are matching the specialization |
2233 | against the declarations. We count the number of template |
2234 | headers, and we check if they match TEMPLATE_COUNT + 1 |
2235 | (TEMPLATE_COUNT is the number of qualifying template classes, |
2236 | plus there must be another header for the member template |
2237 | itself). |
2238 | |
2239 | Notice that if header_count is zero, this is not a |
2240 | specialization but rather a template instantiation, so there |
2241 | is no check we can perform here. */ |
2242 | if (header_count && header_count != template_count + 1) |
2243 | continue; |
2244 | |
2245 | /* Check that the number of template arguments at the |
2246 | innermost level for DECL is the same as for FN. */ |
2247 | if (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) && ((cfun + 0)->language)->bindings ? &((cfun + 0)-> language)->bindings : &scope_chain->bindings))->kind == sk_template_parms |
2248 | && !current_binding_level(*((cfun + 0) && ((cfun + 0)->language) && ((cfun + 0)->language)->bindings ? &((cfun + 0)-> language)->bindings : &scope_chain->bindings))->explicit_spec_p |
2249 | && (TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (fn))((tree_check ((((tree_check ((((struct tree_template_decl *)( const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2249, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2249, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2249, __FUNCTION__, (TREE_VEC)))->base.u.length) |
2250 | != TREE_VEC_LENGTH (INNERMOST_TEMPLATE_PARMS((tree_check ((((tree_check ((scope_chain->template_parms) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2251, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2251, __FUNCTION__, (TREE_VEC)))->base.u.length) |
2251 | (current_template_parms))((tree_check ((((tree_check ((scope_chain->template_parms) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2251, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2251, __FUNCTION__, (TREE_VEC)))->base.u.length))) |
2252 | continue; |
2253 | |
2254 | /* DECL might be a specialization of FN. */ |
2255 | decl_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2255, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2255, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
2256 | fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2256, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2256, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
2257 | |
2258 | /* For a non-static member function, we need to make sure |
2259 | that the const qualification is the same. Since |
2260 | get_bindings does not try to merge the "this" parameter, |
2261 | we must do the comparison explicitly. */ |
2262 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2262, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) |
2263 | { |
2264 | if (!same_type_p (TREE_VALUE (fn_arg_types),comptypes ((((tree_check ((fn_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2264, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check ((decl_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2265, __FUNCTION__, (TREE_LIST)))->list.value)), 0) |
2265 | TREE_VALUE (decl_arg_types))comptypes ((((tree_check ((fn_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2264, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check ((decl_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2265, __FUNCTION__, (TREE_LIST)))->list.value)), 0)) |
2266 | continue; |
2267 | |
2268 | /* And the ref-qualification. */ |
2269 | if (type_memfn_rqual (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2269, __FUNCTION__))->typed.type)) |
2270 | != type_memfn_rqual (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2270, __FUNCTION__))->typed.type))) |
2271 | continue; |
2272 | } |
2273 | |
2274 | /* Skip the "this" parameter and, for constructors of |
2275 | classes with virtual bases, the VTT parameter. A |
2276 | full specialization of a constructor will have a VTT |
2277 | parameter, but a template never will. */ |
2278 | decl_arg_types |
2279 | = skip_artificial_parms_for (decl, decl_arg_types); |
2280 | fn_arg_types |
2281 | = skip_artificial_parms_for (fn, fn_arg_types); |
2282 | |
2283 | /* Function templates cannot be specializations; there are |
2284 | no partial specializations of functions. Therefore, if |
2285 | the type of DECL does not match FN, there is no |
2286 | match. |
2287 | |
2288 | Note that it should never be the case that we have both |
2289 | candidates added here, and for regular member functions |
2290 | below. */ |
2291 | if (tsk == tsk_template) |
2292 | { |
2293 | if (!comp_template_parms (DECL_TEMPLATE_PARMS (fn)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2293, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments, |
2294 | current_template_parmsscope_chain->template_parms)) |
2295 | continue; |
2296 | if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),comptypes ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2296, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2296, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2297, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2297, __FUNCTION__))->typed.type)), 0) |
2297 | TREE_TYPE (TREE_TYPE (fn)))comptypes ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2296, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2296, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2297, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2297, __FUNCTION__))->typed.type)), 0)) |
2298 | continue; |
2299 | if (!compparms (fn_arg_types, decl_arg_types)) |
2300 | continue; |
2301 | |
2302 | tree freq = get_trailing_function_requirements (fn); |
2303 | tree dreq = get_trailing_function_requirements (decl); |
2304 | if (!freq != !dreq) |
2305 | continue; |
2306 | if (freq) |
2307 | { |
2308 | tree fargs = DECL_TI_ARGS (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2308, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2308, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2308, __FUNCTION__, (TEMPLATE_INFO))))->args; |
2309 | tsubst_flags_t complain = tf_none; |
2310 | freq = tsubst_constraint (freq, fargs, complain, fn); |
2311 | if (!cp_tree_equal (freq, dreq)) |
2312 | continue; |
2313 | } |
2314 | |
2315 | candidates = tree_cons (NULL_TREE(tree) __null, fn, candidates); |
2316 | continue; |
2317 | } |
2318 | |
2319 | /* See whether this function might be a specialization of this |
2320 | template. Suppress access control because we might be trying |
2321 | to make this specialization a friend, and we have already done |
2322 | access control for the declaration of the specialization. */ |
2323 | push_deferring_access_checks (dk_no_check); |
2324 | targs = get_bindings (fn, decl, explicit_targs, /*check_ret=*/true); |
2325 | pop_deferring_access_checks (); |
2326 | |
2327 | if (!targs) |
2328 | /* We cannot deduce template arguments that when used to |
2329 | specialize TMPL will produce DECL. */ |
2330 | continue; |
2331 | |
2332 | if (uses_template_parms (targs)) |
2333 | /* We deduced something involving 'auto', which isn't a valid |
2334 | template argument. */ |
2335 | continue; |
2336 | |
2337 | /* Remove, from the set of candidates, all those functions |
2338 | whose constraints are not satisfied. */ |
2339 | if (flag_conceptsglobal_options.x_flag_concepts && !constraints_satisfied_p (fn, targs)) |
2340 | continue; |
2341 | |
2342 | // Then, try to form the new function type. |
2343 | insttype = tsubst (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2343, __FUNCTION__))->typed.type), targs, tf_fndecl_type, NULL_TREE(tree) __null); |
2344 | if (insttype == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2345 | continue; |
2346 | fn_arg_types |
2347 | = skip_artificial_parms_for (fn, TYPE_ARG_TYPES (insttype)((tree_check2 ((insttype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2347, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values)); |
2348 | if (!compparms (fn_arg_types, decl_arg_types)) |
2349 | continue; |
2350 | |
2351 | /* Save this template, and the arguments deduced. */ |
2352 | templates = tree_cons (targs, fn, templates); |
2353 | } |
2354 | else if (need_member_template) |
2355 | /* FN is an ordinary member function, and we need a |
2356 | specialization of a member template. */ |
2357 | ; |
2358 | else if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) != FUNCTION_DECL) |
2359 | /* We can get IDENTIFIER_NODEs here in certain erroneous |
2360 | cases. */ |
2361 | ; |
2362 | else if (!DECL_FUNCTION_MEMBER_P (fn)((((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2362, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE ) || (__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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2362, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2362, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2362, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2362, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2362, __FUNCTION__); <->u.fn; })->static_function ))) |
2363 | /* This is just an ordinary non-member function. Nothing can |
2364 | be a specialization of that. */ |
2365 | ; |
2366 | else if (DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2366, __FUNCTION__))->decl_common.artificial_flag)) |
2367 | /* Cannot specialize functions that are created implicitly. */ |
2368 | ; |
2369 | else |
2370 | { |
2371 | tree decl_arg_types; |
2372 | |
2373 | /* This is an ordinary member function. However, since |
2374 | we're here, we can assume its enclosing class is a |
2375 | template class. For example, |
2376 | |
2377 | template <typename T> struct S { void f(); }; |
2378 | template <> void S<int>::f() {} |
2379 | |
2380 | Here, S<int>::f is a non-template, but S<int> is a |
2381 | template class. If FN has the same type as DECL, we |
2382 | might be in business. */ |
2383 | |
2384 | if (!DECL_TEMPLATE_INFO (fn)(((contains_struct_check ((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2384, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2384, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)) |
2385 | /* Its enclosing class is an explicit specialization |
2386 | of a template class. This is not a candidate. */ |
2387 | continue; |
2388 | |
2389 | if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),comptypes ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2389, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2389, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2390, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2390, __FUNCTION__))->typed.type)), 0) |
2390 | TREE_TYPE (TREE_TYPE (fn)))comptypes ((((contains_struct_check ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2389, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2389, __FUNCTION__))->typed.type)), (((contains_struct_check ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2390, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2390, __FUNCTION__))->typed.type)), 0)) |
2391 | /* The return types differ. */ |
2392 | continue; |
2393 | |
2394 | /* Adjust the type of DECL in case FN is a static member. */ |
2395 | decl_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2395, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2395, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
2396 | if (DECL_STATIC_FUNCTION_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? ( (struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2396, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn) ), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2396, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2396, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2396, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2396, __FUNCTION__); <->u.fn; })->static_function ) |
2397 | && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2397, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) |
2398 | decl_arg_types = TREE_CHAIN (decl_arg_types)((contains_struct_check ((decl_arg_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2398, __FUNCTION__))->common.chain); |
2399 | |
2400 | if (!compparms (TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2400, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2400, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values), |
2401 | decl_arg_types)) |
2402 | continue; |
2403 | |
2404 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2404, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE ) |
2405 | && (type_memfn_rqual (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2405, __FUNCTION__))->typed.type)) |
2406 | != type_memfn_rqual (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2406, __FUNCTION__))->typed.type)))) |
2407 | continue; |
2408 | |
2409 | // If the deduced arguments do not satisfy the constraints, |
2410 | // this is not a candidate. |
2411 | if (flag_conceptsglobal_options.x_flag_concepts && !constraints_satisfied_p (fn)) |
2412 | continue; |
2413 | |
2414 | // Add the candidate. |
2415 | candidates = tree_cons (NULL_TREE(tree) __null, fn, candidates); |
2416 | } |
2417 | } |
2418 | |
2419 | if (templates && TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2419, __FUNCTION__))->common.chain)) |
2420 | { |
2421 | /* We have: |
2422 | |
2423 | [temp.expl.spec] |
2424 | |
2425 | It is possible for a specialization with a given function |
2426 | signature to be instantiated from more than one function |
2427 | template. In such cases, explicit specification of the |
2428 | template arguments must be used to uniquely identify the |
2429 | function template specialization being specialized. |
2430 | |
2431 | Note that here, there's no suggestion that we're supposed to |
2432 | determine which of the candidate templates is most |
2433 | specialized. However, we, also have: |
2434 | |
2435 | [temp.func.order] |
2436 | |
2437 | Partial ordering of overloaded function template |
2438 | declarations is used in the following contexts to select |
2439 | the function template to which a function template |
2440 | specialization refers: |
2441 | |
2442 | -- when an explicit specialization refers to a function |
2443 | template. |
2444 | |
2445 | So, we do use the partial ordering rules, at least for now. |
2446 | This extension can only serve to make invalid programs valid, |
2447 | so it's safe. And, there is strong anecdotal evidence that |
2448 | the committee intended the partial ordering rules to apply; |
2449 | the EDG front end has that behavior, and John Spicer claims |
2450 | that the committee simply forgot to delete the wording in |
2451 | [temp.expl.spec]. */ |
2452 | tree tmpl = most_specialized_instantiation (templates); |
2453 | if (tmpl != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
2454 | { |
2455 | templates = tmpl; |
2456 | TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2456, __FUNCTION__))->common.chain) = NULL_TREE(tree) __null; |
2457 | } |
2458 | } |
2459 | |
2460 | // Concepts allows multiple declarations of member functions |
2461 | // with the same signature. Like above, we need to rely on |
2462 | // on the partial ordering of those candidates to determine which |
2463 | // is the best. |
2464 | if (flag_conceptsglobal_options.x_flag_concepts && candidates && TREE_CHAIN (candidates)((contains_struct_check ((candidates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2464, __FUNCTION__))->common.chain)) |
2465 | { |
2466 | if (tree cand = most_constrained_function (candidates)) |
2467 | { |
2468 | candidates = cand; |
2469 | TREE_CHAIN (cand)((contains_struct_check ((cand), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2469, __FUNCTION__))->common.chain) = NULL_TREE(tree) __null; |
2470 | } |
2471 | } |
2472 | |
2473 | if (templates == NULL_TREE(tree) __null && candidates == NULL_TREE(tree) __null) |
2474 | { |
2475 | error ("template-id %qD for %q+D does not match any template " |
2476 | "declaration", template_id, decl); |
2477 | if (header_count && header_count != template_count + 1) |
2478 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2478, __FUNCTION__))->decl_minimal.locus), |
2479 | "saw %d %<template<>%>, need %d for " |
2480 | "specializing a member function template", |
2481 | header_count, template_count + 1); |
2482 | else |
2483 | print_candidates (orig_fns); |
2484 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2485 | } |
2486 | else if ((templates && TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2486, __FUNCTION__))->common.chain)) |
2487 | || (candidates && TREE_CHAIN (candidates)((contains_struct_check ((candidates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2487, __FUNCTION__))->common.chain)) |
2488 | || (templates && candidates)) |
2489 | { |
2490 | error ("ambiguous template specialization %qD for %q+D", |
2491 | template_id, decl); |
2492 | candidates = chainon (candidates, templates); |
2493 | print_candidates (candidates); |
2494 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2495 | } |
2496 | |
2497 | /* We have one, and exactly one, match. */ |
2498 | if (candidates) |
2499 | { |
2500 | tree fn = TREE_VALUE (candidates)((tree_check ((candidates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2500, __FUNCTION__, (TREE_LIST)))->list.value); |
2501 | *targs_out = copy_node (DECL_TI_ARGS (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2501, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2501, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2501, __FUNCTION__, (TEMPLATE_INFO))))->args); |
2502 | |
2503 | /* Propagate the candidate's constraints to the declaration. */ |
2504 | if (tsk != tsk_template) |
2505 | set_constraints (decl, get_constraints (fn)); |
2506 | |
2507 | /* DECL is a re-declaration or partial instantiation of a template |
2508 | function. */ |
2509 | if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL) |
2510 | return fn; |
2511 | /* It was a specialization of an ordinary member function in a |
2512 | template class. */ |
2513 | return DECL_TI_TEMPLATE (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2513, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2513, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2513, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
2514 | } |
2515 | |
2516 | /* It was a specialization of a template. */ |
2517 | targs = DECL_TI_ARGS (DECL_TEMPLATE_RESULT (TREE_VALUE (templates)))((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((((struct tree_template_decl *)( const_cast<union tree_node *> ((((tree_check ((((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2517, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2517, __FUNCTION__, (TEMPLATE_DECL))))))))->result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2517, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2517, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2517, __FUNCTION__, (TEMPLATE_INFO))))->args; |
2518 | if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (targs)(targs && ((tree_check ((targs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2518, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((targs), ( 0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2518, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((targs), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2518, __FUNCTION__))))))->base.code) == TREE_VEC)) |
2519 | { |
2520 | *targs_out = copy_node (targs); |
2521 | SET_TMPL_ARGS_LEVEL (*targs_out,((*((const_cast<tree *> (tree_vec_elt_check ((*targs_out ), ((((*targs_out && ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((*targs_out ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((*targs_out), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2523, __FUNCTION__))))) = (((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2523, __FUNCTION__, (TREE_LIST)))->list.purpose))) |
2522 | TMPL_ARGS_DEPTH (*targs_out),((*((const_cast<tree *> (tree_vec_elt_check ((*targs_out ), ((((*targs_out && ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((*targs_out ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((*targs_out), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2523, __FUNCTION__))))) = (((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2523, __FUNCTION__, (TREE_LIST)))->list.purpose))) |
2523 | TREE_PURPOSE (templates))((*((const_cast<tree *> (tree_vec_elt_check ((*targs_out ), ((((*targs_out && ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((*targs_out ), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((*targs_out), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2522, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2523, __FUNCTION__))))) = (((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2523, __FUNCTION__, (TREE_LIST)))->list.purpose))); |
2524 | } |
2525 | else |
2526 | *targs_out = TREE_PURPOSE (templates)((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2526, __FUNCTION__, (TREE_LIST)))->list.purpose); |
2527 | return TREE_VALUE (templates)((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2527, __FUNCTION__, (TREE_LIST)))->list.value); |
2528 | } |
2529 | |
2530 | /* Returns a chain of parameter types, exactly like the SPEC_TYPES, |
2531 | but with the default argument values filled in from those in the |
2532 | TMPL_TYPES. */ |
2533 | |
2534 | static tree |
2535 | copy_default_args_to_explicit_spec_1 (tree spec_types, |
2536 | tree tmpl_types) |
2537 | { |
2538 | tree new_spec_types; |
2539 | |
2540 | if (!spec_types) |
2541 | return NULL_TREE(tree) __null; |
2542 | |
2543 | if (spec_types == void_list_nodeglobal_trees[TI_VOID_LIST_NODE]) |
2544 | return void_list_nodeglobal_trees[TI_VOID_LIST_NODE]; |
2545 | |
2546 | /* Substitute into the rest of the list. */ |
2547 | new_spec_types = |
2548 | copy_default_args_to_explicit_spec_1 (TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2548, __FUNCTION__))->common.chain), |
2549 | TREE_CHAIN (tmpl_types)((contains_struct_check ((tmpl_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2549, __FUNCTION__))->common.chain)); |
2550 | |
2551 | /* Add the default argument for this parameter. */ |
2552 | return hash_tree_cons (TREE_PURPOSE (tmpl_types)((tree_check ((tmpl_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2552, __FUNCTION__, (TREE_LIST)))->list.purpose), |
2553 | TREE_VALUE (spec_types)((tree_check ((spec_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2553, __FUNCTION__, (TREE_LIST)))->list.value), |
2554 | new_spec_types); |
2555 | } |
2556 | |
2557 | /* DECL is an explicit specialization. Replicate default arguments |
2558 | from the template it specializes. (That way, code like: |
2559 | |
2560 | template <class T> void f(T = 3); |
2561 | template <> void f(double); |
2562 | void g () { f (); } |
2563 | |
2564 | works, as required.) An alternative approach would be to look up |
2565 | the correct default arguments at the call-site, but this approach |
2566 | is consistent with how implicit instantiations are handled. */ |
2567 | |
2568 | static void |
2569 | copy_default_args_to_explicit_spec (tree decl) |
2570 | { |
2571 | tree tmpl; |
2572 | tree spec_types; |
2573 | tree tmpl_types; |
2574 | tree new_spec_types; |
2575 | tree old_type; |
2576 | tree new_type; |
2577 | tree t; |
2578 | tree object_type = NULL_TREE(tree) __null; |
2579 | tree in_charge = NULL_TREE(tree) __null; |
2580 | tree vtt = NULL_TREE(tree) __null; |
2581 | |
2582 | /* See if there's anything we need to do. */ |
2583 | tmpl = DECL_TI_TEMPLATE (decl)((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2583, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2583, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2583, __FUNCTION__, (TEMPLATE_INFO))))->tmpl; |
2584 | tmpl_types = TYPE_ARG_TYPES (TREE_TYPE (DECL_TEMPLATE_RESULT (tmpl)))((tree_check2 ((((contains_struct_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2584, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2584, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2584, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
2585 | for (t = tmpl_types; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2585, __FUNCTION__))->common.chain)) |
2586 | if (TREE_PURPOSE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2586, __FUNCTION__, (TREE_LIST)))->list.purpose)) |
2587 | break; |
2588 | if (!t) |
2589 | return; |
2590 | |
2591 | old_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2591, __FUNCTION__))->typed.type); |
2592 | spec_types = TYPE_ARG_TYPES (old_type)((tree_check2 ((old_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2592, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
2593 | |
2594 | if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2594, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) |
2595 | { |
2596 | /* Remove the this pointer, but remember the object's type for |
2597 | CV quals. */ |
2598 | object_type = TREE_TYPE (TREE_VALUE (spec_types))((contains_struct_check ((((tree_check ((spec_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2598, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2598, __FUNCTION__))->typed.type); |
2599 | spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2599, __FUNCTION__))->common.chain); |
2600 | tmpl_types = TREE_CHAIN (tmpl_types)((contains_struct_check ((tmpl_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2600, __FUNCTION__))->common.chain); |
2601 | |
2602 | if (DECL_HAS_IN_CHARGE_PARM_P (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2602, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2602, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2602, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2602, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2602, __FUNCTION__); <->u.fn; })->has_in_charge_parm_p )) |
2603 | { |
2604 | /* DECL may contain more parameters than TMPL due to the extra |
2605 | in-charge parameter in constructors and destructors. */ |
2606 | in_charge = spec_types; |
2607 | spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2607, __FUNCTION__))->common.chain); |
2608 | } |
2609 | if (DECL_HAS_VTT_PARM_P (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2609, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2609, __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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2609, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2609, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2609, __FUNCTION__); <->u.fn; })->has_vtt_parm_p )) |
2610 | { |
2611 | vtt = spec_types; |
2612 | spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2612, __FUNCTION__))->common.chain); |
2613 | } |
2614 | } |
2615 | |
2616 | /* Compute the merged default arguments. */ |
2617 | new_spec_types = |
2618 | copy_default_args_to_explicit_spec_1 (spec_types, tmpl_types); |
2619 | |
2620 | /* Compute the new FUNCTION_TYPE. */ |
2621 | if (object_type) |
2622 | { |
2623 | if (vtt) |
2624 | new_spec_types = hash_tree_cons (TREE_PURPOSE (vtt)((tree_check ((vtt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2624, __FUNCTION__, (TREE_LIST)))->list.purpose), |
2625 | TREE_VALUE (vtt)((tree_check ((vtt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2625, __FUNCTION__, (TREE_LIST)))->list.value), |
2626 | new_spec_types); |
2627 | |
2628 | if (in_charge) |
2629 | /* Put the in-charge parameter back. */ |
2630 | new_spec_types = hash_tree_cons (TREE_PURPOSE (in_charge)((tree_check ((in_charge), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2630, __FUNCTION__, (TREE_LIST)))->list.purpose), |
2631 | TREE_VALUE (in_charge)((tree_check ((in_charge), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2631, __FUNCTION__, (TREE_LIST)))->list.value), |
2632 | new_spec_types); |
2633 | |
2634 | new_type = build_method_type_directly (object_type, |
2635 | TREE_TYPE (old_type)((contains_struct_check ((old_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2635, __FUNCTION__))->typed.type), |
2636 | new_spec_types); |
2637 | } |
2638 | else |
2639 | new_type = build_function_type (TREE_TYPE (old_type)((contains_struct_check ((old_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2639, __FUNCTION__))->typed.type), |
2640 | new_spec_types); |
2641 | new_type = cp_build_type_attribute_variant (new_type, |
2642 | TYPE_ATTRIBUTES (old_type)((tree_class_check ((old_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2642, __FUNCTION__))->type_common.attributes)); |
2643 | new_type = cxx_copy_lang_qualifiers (new_type, old_type); |
2644 | |
2645 | TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2645, __FUNCTION__))->typed.type) = new_type; |
2646 | } |
2647 | |
2648 | /* Return the number of template headers we expect to see for a definition |
2649 | or specialization of CTYPE or one of its non-template members. */ |
2650 | |
2651 | int |
2652 | num_template_headers_for_class (tree ctype) |
2653 | { |
2654 | int num_templates = 0; |
2655 | |
2656 | while (ctype && 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2656, __FUNCTION__))->type_common.lang_flag_5))) |
2657 | { |
2658 | /* You're supposed to have one `template <...>' for every |
2659 | template class, but you don't need one for a full |
2660 | specialization. For example: |
2661 | |
2662 | template <class T> struct S{}; |
2663 | template <> struct S<int> { void f(); }; |
2664 | void S<int>::f () {} |
2665 | |
2666 | is correct; there shouldn't be a `template <>' for the |
2667 | definition of `S<int>::f'. */ |
2668 | if (!CLASSTYPE_TEMPLATE_INFO (ctype)(((tree_class_check (((tree_check3 ((ctype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2668, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2668, __FUNCTION__))->type_non_common.lang_1))) |
2669 | /* If CTYPE does not have template information of any |
2670 | kind, then it is not a template, nor is it nested |
2671 | within a template. */ |
2672 | break; |
2673 | if (explicit_class_specialization_p (ctype)) |
2674 | break; |
2675 | if (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (ctype))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((ctype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((tree_class_check (((tree_check3 ((ctype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2675, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))) |
2676 | ++num_templates; |
2677 | |
2678 | ctype = TYPE_CONTEXT (ctype)((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2678, __FUNCTION__))->type_common.context); |
2679 | } |
2680 | |
2681 | return num_templates; |
2682 | } |
2683 | |
2684 | /* Do a simple sanity check on the template headers that precede the |
2685 | variable declaration DECL. */ |
2686 | |
2687 | void |
2688 | check_template_variable (tree decl) |
2689 | { |
2690 | tree ctx = CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2690, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2690, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2690, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]); |
2691 | int wanted = num_template_headers_for_class (ctx); |
2692 | if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2692, __FUNCTION__))->decl_common.lang_specific) && DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2692, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2692, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) |
2693 | && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check (((((contains_struct_check ( (template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2693, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))) |
2694 | { |
2695 | if (cxx_dialect < cxx14) |
2696 | pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2696, __FUNCTION__))->decl_minimal.locus), 0, |
2697 | "variable templates only available with " |
2698 | "%<-std=c++14%> or %<-std=gnu++14%>"); |
2699 | |
2700 | // Namespace-scope variable templates should have a template header. |
2701 | ++wanted; |
2702 | } |
2703 | if (template_header_count > wanted) |
2704 | { |
2705 | auto_diagnostic_group d; |
2706 | bool warned = pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2706, __FUNCTION__))->decl_minimal.locus), 0, |
2707 | "too many template headers for %qD " |
2708 | "(should be %d)", |
2709 | decl, wanted); |
2710 | if (warned && CLASS_TYPE_P (ctx)(((((enum tree_code) (ctx)->base.code)) == RECORD_TYPE || ( ((enum tree_code) (ctx)->base.code)) == UNION_TYPE) && ((tree_class_check ((ctx), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2710, __FUNCTION__))->type_common.lang_flag_5)) |
2711 | && CLASSTYPE_TEMPLATE_SPECIALIZATION (ctx)(((((tree_class_check ((ctx), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2711, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) == 2)) |
2712 | inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2712, __FUNCTION__))->decl_minimal.locus), |
2713 | "members of an explicitly specialized class are defined " |
2714 | "without a template header"); |
2715 | } |
2716 | } |
2717 | |
2718 | /* An explicit specialization whose declarator-id or class-head-name is not |
2719 | qualified shall be declared in the nearest enclosing namespace of the |
2720 | template, or, if the namespace is inline (7.3.1), any namespace from its |
2721 | enclosing namespace set. |
2722 | |
2723 | If the name declared in the explicit instantiation is an unqualified name, |
2724 | the explicit instantiation shall appear in the namespace where its template |
2725 | is declared or, if that namespace is inline (7.3.1), any namespace from its |
2726 | enclosing namespace set. */ |
2727 | |
2728 | void |
2729 | check_unqualified_spec_or_inst (tree t, location_t loc) |
2730 | { |
2731 | tree tmpl = most_general_template (t); |
2732 | if (DECL_NAMESPACE_SCOPE_P (tmpl)(!(((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2732, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (tmpl)->base.code) == CONST_DECL || (( enum tree_code) (tmpl)->base.code) == PARM_DECL || ((enum tree_code ) (tmpl)->base.code) == TYPE_DECL || ((enum tree_code) (tmpl )->base.code) == TEMPLATE_DECL)) && ((enum tree_code ) ((!(! (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2732, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2732, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((tmpl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2732, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL) |
2733 | && !is_nested_namespace (current_namespacescope_chain->old_namespace, |
2734 | CP_DECL_CONTEXT (tmpl)(!(! (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2734, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2734, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((tmpl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2734, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]), true)) |
2735 | { |
2736 | if (processing_specializationscope_chain->x_processing_specialization) |
2737 | permerror (loc, "explicit specialization of %qD outside its " |
2738 | "namespace must use a nested-name-specifier", tmpl); |
2739 | else if (processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation |
2740 | && cxx_dialect >= cxx11) |
2741 | /* This was allowed in C++98, so only pedwarn. */ |
2742 | pedwarn (loc, OPT_Wpedantic, "explicit instantiation of %qD " |
2743 | "outside its namespace must use a nested-name-" |
2744 | "specifier", tmpl); |
2745 | } |
2746 | } |
2747 | |
2748 | /* Warn for a template specialization SPEC that is missing some of a set |
2749 | of function or type attributes that the template TEMPL is declared with. |
2750 | ATTRLIST is a list of additional attributes that SPEC should be taken |
2751 | to ultimately be declared with. */ |
2752 | |
2753 | static void |
2754 | warn_spec_missing_attributes (tree tmpl, tree spec, tree attrlist) |
2755 | { |
2756 | if (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2756, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2756, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) |
2757 | tmpl = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2757, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
2758 | |
2759 | /* Avoid warning if the difference between the primary and |
2760 | the specialization is not in one of the attributes below. */ |
2761 | const char* const blacklist[] = { |
2762 | "alloc_align", "alloc_size", "assume_aligned", "format", |
2763 | "format_arg", "malloc", "nonnull", NULL__null |
2764 | }; |
2765 | |
2766 | /* Put together a list of the black listed attributes that the primary |
2767 | template is declared with that the specialization is not, in case |
2768 | it's not apparent from the most recent declaration of the primary. */ |
2769 | pretty_printer str; |
2770 | unsigned nattrs = decls_mismatched_attributes (tmpl, spec, attrlist, |
2771 | blacklist, &str); |
2772 | |
2773 | if (!nattrs) |
2774 | return; |
2775 | |
2776 | auto_diagnostic_group d; |
2777 | if (warning_at (DECL_SOURCE_LOCATION (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2777, __FUNCTION__))->decl_minimal.locus), OPT_Wmissing_attributes, |
2778 | "explicit specialization %q#D may be missing attributes", |
2779 | spec)) |
2780 | inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2780, __FUNCTION__))->decl_minimal.locus), |
2781 | nattrs > 1 |
2782 | ? G_("missing primary template attributes %s")"missing primary template attributes %s" |
2783 | : G_("missing primary template attribute %s")"missing primary template attribute %s", |
2784 | pp_formatted_text (&str)); |
2785 | } |
2786 | |
2787 | /* Check to see if the function just declared, as indicated in |
2788 | DECLARATOR, and in DECL, is a specialization of a function |
2789 | template. We may also discover that the declaration is an explicit |
2790 | instantiation at this point. |
2791 | |
2792 | Returns DECL, or an equivalent declaration that should be used |
2793 | instead if all goes well. Issues an error message if something is |
2794 | amiss. Returns error_mark_node if the error is not easily |
2795 | recoverable. |
2796 | |
2797 | FLAGS is a bitmask consisting of the following flags: |
2798 | |
2799 | 2: The function has a definition. |
2800 | 4: The function is a friend. |
2801 | |
2802 | The TEMPLATE_COUNT is the number of references to qualifying |
2803 | template classes that appeared in the name of the function. For |
2804 | example, in |
2805 | |
2806 | template <class T> struct S { void f(); }; |
2807 | void S<int>::f(); |
2808 | |
2809 | the TEMPLATE_COUNT would be 1. However, explicitly specialized |
2810 | classes are not counted in the TEMPLATE_COUNT, so that in |
2811 | |
2812 | template <class T> struct S {}; |
2813 | template <> struct S<int> { void f(); } |
2814 | template <> void S<int>::f(); |
2815 | |
2816 | the TEMPLATE_COUNT would be 0. (Note that this declaration is |
2817 | invalid; there should be no template <>.) |
2818 | |
2819 | If the function is a specialization, it is marked as such via |
2820 | DECL_TEMPLATE_SPECIALIZATION. Furthermore, its DECL_TEMPLATE_INFO |
2821 | is set up correctly, and it is added to the list of specializations |
2822 | for that template. */ |
2823 | |
2824 | tree |
2825 | check_explicit_specialization (tree declarator, |
2826 | tree decl, |
2827 | int template_count, |
2828 | int flags, |
2829 | tree attrlist) |
2830 | { |
2831 | int have_def = flags & 2; |
2832 | int is_friend = flags & 4; |
2833 | bool is_concept = flags & 8; |
2834 | int specialization = 0; |
2835 | int explicit_instantiation = 0; |
2836 | int member_specialization = 0; |
2837 | tree ctype = DECL_CLASS_CONTEXT (decl)((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2837, __FUNCTION__))->decl_minimal.context) && ( tree_code_type[(int) (((enum tree_code) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2837, __FUNCTION__))->decl_minimal.context))->base.code ))] == tcc_type)) ? ((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2837, __FUNCTION__))->decl_minimal.context) : (tree) __null ); |
2838 | tree dname = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2838, __FUNCTION__))->decl_minimal.name); |
2839 | tmpl_spec_kind tsk; |
2840 | |
2841 | if (is_friend) |
2842 | { |
2843 | if (!processing_specializationscope_chain->x_processing_specialization) |
2844 | tsk = tsk_none; |
2845 | else |
2846 | tsk = tsk_excessive_parms; |
2847 | } |
2848 | else |
2849 | tsk = current_tmpl_spec_kind (template_count); |
2850 | |
2851 | switch (tsk) |
2852 | { |
2853 | case tsk_none: |
2854 | if (processing_specializationscope_chain->x_processing_specialization && !VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
2855 | { |
2856 | specialization = 1; |
2857 | SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2857, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) = 2); |
2858 | } |
2859 | else if (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR) |
2860 | { |
2861 | if (is_friend) |
2862 | /* This could be something like: |
2863 | |
2864 | template <class T> void f(T); |
2865 | class S { friend void f<>(int); } */ |
2866 | specialization = 1; |
2867 | else |
2868 | { |
2869 | /* This case handles bogus declarations like template <> |
2870 | template <class T> void f<int>(); */ |
2871 | |
2872 | error_at (cp_expr_loc_or_input_loc (declarator), |
2873 | "template-id %qE in declaration of primary template", |
2874 | declarator); |
2875 | return decl; |
2876 | } |
2877 | } |
2878 | break; |
2879 | |
2880 | case tsk_invalid_member_spec: |
2881 | /* The error has already been reported in |
2882 | check_specialization_scope. */ |
2883 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
2884 | |
2885 | case tsk_invalid_expl_inst: |
2886 | error ("template parameter list used in explicit instantiation"); |
2887 | |
2888 | /* Fall through. */ |
2889 | |
2890 | case tsk_expl_inst: |
2891 | if (have_def) |
2892 | error ("definition provided for explicit instantiation"); |
2893 | |
2894 | explicit_instantiation = 1; |
2895 | break; |
2896 | |
2897 | case tsk_excessive_parms: |
2898 | case tsk_insufficient_parms: |
2899 | if (tsk == tsk_excessive_parms) |
2900 | error ("too many template parameter lists in declaration of %qD", |
2901 | decl); |
2902 | else if (template_header_count) |
2903 | error("too few template parameter lists in declaration of %qD", decl); |
2904 | else |
2905 | error("explicit specialization of %qD must be introduced by " |
2906 | "%<template <>%>", decl); |
2907 | |
2908 | /* Fall through. */ |
2909 | case tsk_expl_spec: |
2910 | if (is_concept) |
2911 | error ("explicit specialization declared %<concept%>"); |
2912 | |
2913 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) != TEMPLATE_ID_EXPR) |
2914 | /* In cases like template<> constexpr bool v = true; |
2915 | We'll give an error in check_template_variable. */ |
2916 | break; |
2917 | |
2918 | SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2918, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) = 2); |
2919 | if (ctype) |
2920 | member_specialization = 1; |
2921 | else |
2922 | specialization = 1; |
2923 | break; |
2924 | |
2925 | case tsk_template: |
2926 | if (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR) |
2927 | { |
2928 | /* This case handles bogus declarations like template <> |
2929 | template <class T> void f<int>(); */ |
2930 | |
2931 | if (!uses_template_parms (TREE_OPERAND (declarator, 1)(*((const_cast<tree*> (tree_operand_check ((declarator) , (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2931, __FUNCTION__))))))) |
2932 | error_at (cp_expr_loc_or_input_loc (declarator), |
2933 | "template-id %qE in declaration of primary template", |
2934 | declarator); |
2935 | else if (variable_template_p (TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator) , (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2935, __FUNCTION__))))))) |
2936 | { |
2937 | /* Partial specialization of variable template. */ |
2938 | SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2938, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) = 2); |
2939 | specialization = 1; |
2940 | goto ok; |
2941 | } |
2942 | else if (cxx_dialect < cxx14) |
2943 | error_at (cp_expr_loc_or_input_loc (declarator), |
2944 | "non-type partial specialization %qE " |
2945 | "is not allowed", declarator); |
2946 | else |
2947 | error_at (cp_expr_loc_or_input_loc (declarator), |
2948 | "non-class, non-variable partial specialization %qE " |
2949 | "is not allowed", declarator); |
2950 | return decl; |
2951 | ok:; |
2952 | } |
2953 | |
2954 | if (ctype && CLASSTYPE_TEMPLATE_INSTANTIATION (ctype)(((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2954, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) & 1)) |
2955 | /* This is a specialization of a member template, without |
2956 | specialization the containing class. Something like: |
2957 | |
2958 | template <class T> struct S { |
2959 | template <class U> void f (U); |
2960 | }; |
2961 | template <> template <class U> void S<int>::f(U) {} |
2962 | |
2963 | That's a specialization -- but of the entire template. */ |
2964 | specialization = 1; |
2965 | break; |
2966 | |
2967 | default: |
2968 | gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2968, __FUNCTION__)); |
2969 | } |
2970 | |
2971 | if ((specialization || member_specialization) |
2972 | /* This doesn't apply to variable templates. */ |
2973 | && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2973, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE || ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2973, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) |
2974 | { |
2975 | tree t = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2975, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2975, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common .values); |
2976 | for (; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2976, __FUNCTION__))->common.chain)) |
2977 | if (TREE_PURPOSE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2977, __FUNCTION__, (TREE_LIST)))->list.purpose)) |
2978 | { |
2979 | permerror (input_location, |
2980 | "default argument specified in explicit specialization"); |
2981 | break; |
2982 | } |
2983 | } |
2984 | |
2985 | if (specialization || member_specialization || explicit_instantiation) |
2986 | { |
2987 | tree tmpl = NULL_TREE(tree) __null; |
2988 | tree targs = NULL_TREE(tree) __null; |
2989 | bool was_template_id = (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR); |
2990 | bool found_hidden = false; |
2991 | |
2992 | /* Make sure that the declarator is a TEMPLATE_ID_EXPR. */ |
2993 | if (!was_template_id) |
2994 | { |
2995 | tree fns; |
2996 | |
2997 | gcc_assert (identifier_p (declarator))((void)(!(identifier_p (declarator)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 2997, __FUNCTION__), 0 : 0)); |
2998 | if (ctype) |
2999 | fns = dname; |
3000 | else |
3001 | { |
3002 | /* If there is no class context, the explicit instantiation |
3003 | must be at namespace scope. */ |
3004 | gcc_assert (DECL_NAMESPACE_SCOPE_P (decl))((void)(!((!(((contains_struct_check ((decl), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3004, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (decl)->base.code) == CONST_DECL || (( enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code ) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl )->base.code) == TEMPLATE_DECL)) && ((enum tree_code ) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3004, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3004, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3004, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3004, __FUNCTION__), 0 : 0)); |
3005 | |
3006 | /* Find the namespace binding, using the declaration |
3007 | context. */ |
3008 | fns = lookup_qualified_name (CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3008, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3008, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3008, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]), dname, |
3009 | LOOK_want::NORMAL, true); |
3010 | if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
3011 | { |
3012 | /* If lookup fails, look for a friend declaration so we can |
3013 | give a better diagnostic. */ |
3014 | fns = (lookup_qualified_name |
3015 | (CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3015, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3015, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3015, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]), dname, |
3016 | LOOK_want::NORMAL | LOOK_want::HIDDEN_FRIEND, |
3017 | /*complain*/true)); |
3018 | found_hidden = true; |
3019 | } |
3020 | |
3021 | if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !is_overloaded_fn (fns)) |
3022 | { |
3023 | error ("%qD is not a template function", dname); |
3024 | fns = error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3025 | } |
3026 | } |
3027 | |
3028 | declarator = lookup_template_function (fns, NULL_TREE(tree) __null); |
3029 | } |
3030 | |
3031 | if (declarator == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
3032 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3033 | |
3034 | if (ctype != NULL_TREE(tree) __null && TYPE_BEING_DEFINED (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3034, __FUNCTION__))->type_with_lang_specific.lang_specific ))->being_defined)) |
3035 | { |
3036 | if (!explicit_instantiation) |
3037 | /* A specialization in class scope. This is invalid, |
3038 | but the error will already have been flagged by |
3039 | check_specialization_scope. */ |
3040 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3041 | else |
3042 | { |
3043 | /* It's not valid to write an explicit instantiation in |
3044 | class scope, e.g.: |
3045 | |
3046 | class C { template void f(); } |
3047 | |
3048 | This case is caught by the parser. However, on |
3049 | something like: |
3050 | |
3051 | template class C { void f(); }; |
3052 | |
3053 | (which is invalid) we can get here. The error will be |
3054 | issued later. */ |
3055 | ; |
3056 | } |
3057 | |
3058 | return decl; |
3059 | } |
3060 | else if (ctype != NULL_TREE(tree) __null |
3061 | && (identifier_p (TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator) , (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3061, __FUNCTION__)))))))) |
3062 | { |
3063 | // We'll match variable templates in start_decl. |
3064 | if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
3065 | return decl; |
3066 | |
3067 | /* Find the list of functions in ctype that have the same |
3068 | name as the declared function. */ |
3069 | tree name = TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator) , (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3069, __FUNCTION__))))); |
3070 | |
3071 | if (constructor_name_p (name, ctype)) |
3072 | { |
3073 | if (DECL_CONSTRUCTOR_P (decl)((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3073, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3073, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) |
3074 | ? !TYPE_HAS_USER_CONSTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3074, __FUNCTION__))->type_common.lang_flag_1)) |
3075 | : !CLASSTYPE_DESTRUCTOR (ctype)(get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER ]))) |
3076 | { |
3077 | /* From [temp.expl.spec]: |
3078 | |
3079 | If such an explicit specialization for the member |
3080 | of a class template names an implicitly-declared |
3081 | special member function (clause _special_), the |
3082 | program is ill-formed. |
3083 | |
3084 | Similar language is found in [temp.explicit]. */ |
3085 | error ("specialization of implicitly-declared special member function"); |
3086 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3087 | } |
3088 | |
3089 | name = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3089, __FUNCTION__))->decl_minimal.name); |
3090 | } |
3091 | |
3092 | /* For a type-conversion operator, We might be looking for |
3093 | `operator int' which will be a specialization of |
3094 | `operator T'. Grab all the conversion operators, and |
3095 | then select from them. */ |
3096 | tree fns = get_class_binding (ctype, IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3096, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3096, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3096, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3096, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1) & (!((tree_not_check2 (((tree_check ((name) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3096, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3096, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
3097 | ? conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER] : name); |
3098 | |
3099 | if (fns == NULL_TREE(tree) __null) |
3100 | { |
3101 | error ("no member function %qD declared in %qT", name, ctype); |
3102 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3103 | } |
3104 | else |
3105 | TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator) , (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3105, __FUNCTION__))))) = fns; |
3106 | } |
3107 | |
3108 | /* Figure out what exactly is being specialized at this point. |
3109 | Note that for an explicit instantiation, even one for a |
3110 | member function, we cannot tell a priori whether the |
3111 | instantiation is for a member template, or just a member |
3112 | function of a template class. Even if a member template is |
3113 | being instantiated, the member template arguments may be |
3114 | elided if they can be deduced from the rest of the |
3115 | declaration. */ |
3116 | tmpl = determine_specialization (declarator, decl, |
3117 | &targs, |
3118 | member_specialization, |
3119 | template_count, |
3120 | tsk); |
3121 | |
3122 | if (!tmpl || tmpl == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
3123 | /* We couldn't figure out what this declaration was |
3124 | specializing. */ |
3125 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3126 | else |
3127 | { |
3128 | if (found_hidden && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) |
3129 | { |
3130 | auto_diagnostic_group d; |
3131 | if (pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3131, __FUNCTION__))->decl_minimal.locus), 0, |
3132 | "friend declaration %qD is not visible to " |
3133 | "explicit specialization", tmpl)) |
3134 | inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3134, __FUNCTION__))->decl_minimal.locus), |
3135 | "friend declaration here"); |
3136 | } |
3137 | |
3138 | if (!ctype && !is_friend |
3139 | && CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3139, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3139, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3139, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]) == current_namespacescope_chain->old_namespace) |
3140 | check_unqualified_spec_or_inst (tmpl, DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3140, __FUNCTION__))->decl_minimal.locus)); |
3141 | |
3142 | tree gen_tmpl = most_general_template (tmpl); |
3143 | |
3144 | if (explicit_instantiation) |
3145 | { |
3146 | /* We don't set DECL_EXPLICIT_INSTANTIATION here; that |
3147 | is done by do_decl_instantiation later. */ |
3148 | |
3149 | int arg_depth = TMPL_ARGS_DEPTH (targs)((targs && ((tree_check ((targs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3149, __FUNCTION__, (TREE_VEC)))->base.u.length) && (*((const_cast<tree *> (tree_vec_elt_check ((targs), ( 0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3149, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast <tree *> (tree_vec_elt_check ((targs), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3149, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check ((targs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3149, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1); |
3150 | int parm_depth = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3150, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3150, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3150, __FUNCTION__)))); |
3151 | |
3152 | if (arg_depth > parm_depth) |
3153 | { |
3154 | /* If TMPL is not the most general template (for |
3155 | example, if TMPL is a friend template that is |
3156 | injected into namespace scope), then there will |
3157 | be too many levels of TARGS. Remove some of them |
3158 | here. */ |
3159 | int i; |
3160 | tree new_targs; |
3161 | |
3162 | new_targs = make_tree_vec (parm_depth); |
3163 | for (i = arg_depth - parm_depth; i < arg_depth; ++i) |
3164 | TREE_VEC_ELT (new_targs, i - (arg_depth - parm_depth))(*((const_cast<tree *> (tree_vec_elt_check ((new_targs) , (i - (arg_depth - parm_depth)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3164, __FUNCTION__))))) |
3165 | = TREE_VEC_ELT (targs, i)(*((const_cast<tree *> (tree_vec_elt_check ((targs), (i ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3165, __FUNCTION__))))); |
3166 | targs = new_targs; |
3167 | } |
3168 | |
3169 | return instantiate_template (tmpl, targs, tf_error); |
3170 | } |
3171 | |
3172 | /* If we thought that the DECL was a member function, but it |
3173 | turns out to be specializing a static member function, |
3174 | make DECL a static member function as well. */ |
3175 | if (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3175, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3175, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL) |
3176 | && DECL_STATIC_FUNCTION_P (tmpl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check (((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3176, __FUNCTION__, (TEMPLATE_DECL))))))))->result : tmpl )), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3176, __FUNCTION__))->decl_common.lang_specific); if (!( ((enum tree_code) (tmpl)->base.code) == FUNCTION_DECL || ( ((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3176, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3176, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn ) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3176, __FUNCTION__); <->u.fn; })->static_function ) |
3177 | && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3177, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE )) |
3178 | revert_static_member_fn (decl); |
3179 | |
3180 | /* If this is a specialization of a member template of a |
3181 | template class, we want to return the TEMPLATE_DECL, not |
3182 | the specialization of it. */ |
3183 | if (tsk == tsk_template && !was_template_id) |
3184 | { |
3185 | tree result = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3185, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
3186 | SET_DECL_TEMPLATE_SPECIALIZATION (tmpl)((((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3186, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) = 2); |
3187 | DECL_INITIAL (result)((contains_struct_check ((result), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3187, __FUNCTION__))->decl_common.initial) = NULL_TREE(tree) __null; |
3188 | if (have_def) |
3189 | { |
3190 | tree parm; |
3191 | DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3191, __FUNCTION__))->decl_minimal.locus) = DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3191, __FUNCTION__))->decl_minimal.locus); |
3192 | DECL_SOURCE_LOCATION (result)((contains_struct_check ((result), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3192, __FUNCTION__))->decl_minimal.locus) |
3193 | = DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3193, __FUNCTION__))->decl_minimal.locus); |
3194 | /* We want to use the argument list specified in the |
3195 | definition, not in the original declaration. */ |
3196 | DECL_ARGUMENTS (result)((tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3196, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ) = DECL_ARGUMENTS (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3196, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); |
3197 | for (parm = DECL_ARGUMENTS (result)((tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3197, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments ); parm; |
3198 | parm = DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3198, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3198, __FUNCTION__))->common.chain))) |
3199 | DECL_CONTEXT (parm)((contains_struct_check ((parm), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3199, __FUNCTION__))->decl_minimal.context) = result; |
3200 | } |
3201 | return register_specialization (tmpl, gen_tmpl, targs, |
3202 | is_friend, 0); |
3203 | } |
3204 | |
3205 | /* Set up the DECL_TEMPLATE_INFO for DECL. */ |
3206 | DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3206, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3206, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) = build_template_info (tmpl, targs); |
3207 | |
3208 | if (was_template_id) |
3209 | TINFO_USED_TEMPLATE_ID (DECL_TEMPLATE_INFO (decl))(((tree_not_check2 (((tree_check (((((contains_struct_check ( (template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3209, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3209, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3209, __FUNCTION__, (TEMPLATE_INFO)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3209, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) = true; |
3210 | |
3211 | /* Inherit default function arguments from the template |
3212 | DECL is specializing. */ |
3213 | if (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3213, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3213, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) |
3214 | copy_default_args_to_explicit_spec (decl); |
3215 | |
3216 | /* This specialization has the same protection as the |
3217 | template it specializes. */ |
3218 | TREE_PRIVATE (decl)((decl)->base.private_flag) = TREE_PRIVATE (gen_tmpl)((gen_tmpl)->base.private_flag); |
3219 | TREE_PROTECTED (decl)((decl)->base.protected_flag) = TREE_PROTECTED (gen_tmpl)((gen_tmpl)->base.protected_flag); |
3220 | |
3221 | /* 7.1.1-1 [dcl.stc] |
3222 | |
3223 | A storage-class-specifier shall not be specified in an |
3224 | explicit specialization... |
3225 | |
3226 | The parser rejects these, so unless action is taken here, |
3227 | explicit function specializations will always appear with |
3228 | global linkage. |
3229 | |
3230 | The action recommended by the C++ CWG in response to C++ |
3231 | defect report 605 is to make the storage class and linkage |
3232 | of the explicit specialization match the templated function: |
3233 | |
3234 | http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#605 |
3235 | */ |
3236 | if (tsk == tsk_expl_spec && DECL_FUNCTION_TEMPLATE_P (gen_tmpl)(((enum tree_code) (gen_tmpl)->base.code) == TEMPLATE_DECL && ((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((gen_tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3236, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree ) __null && ((enum tree_code) (((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((gen_tmpl ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3236, __FUNCTION__, (TEMPLATE_DECL))))))))->result)-> base.code) == FUNCTION_DECL)) |
3237 | { |
3238 | tree tmpl_func = DECL_TEMPLATE_RESULT (gen_tmpl)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((gen_tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3238, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
3239 | gcc_assert (TREE_CODE (tmpl_func) == FUNCTION_DECL)((void)(!(((enum tree_code) (tmpl_func)->base.code) == FUNCTION_DECL ) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3239, __FUNCTION__), 0 : 0)); |
3240 | |
3241 | /* A concept cannot be specialized. */ |
3242 | if (DECL_DECLARED_CONCEPT_P (tmpl_func)(((contains_struct_check ((tmpl_func), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3242, __FUNCTION__))->decl_common.lang_specific)->u.base .concept_p)) |
3243 | { |
3244 | error ("explicit specialization of function concept %qD", |
3245 | gen_tmpl); |
3246 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3247 | } |
3248 | |
3249 | /* This specialization has the same linkage and visibility as |
3250 | the function template it specializes. */ |
3251 | TREE_PUBLIC (decl)((decl)->base.public_flag) = TREE_PUBLIC (tmpl_func)((tmpl_func)->base.public_flag); |
3252 | if (! TREE_PUBLIC (decl)((decl)->base.public_flag)) |
3253 | { |
3254 | DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3254, __FUNCTION__))->decl_common.lang_flag_5) = 1; |
3255 | DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3255, __FUNCTION__))->decl_common.lang_specific)->u.base .not_really_extern) = 1; |
3256 | } |
3257 | DECL_THIS_STATIC (decl)((contains_struct_check (((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3257, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL )))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3257, __FUNCTION__))->decl_common.lang_flag_6) = DECL_THIS_STATIC (tmpl_func)((contains_struct_check (((tree_check3 ((tmpl_func), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3257, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL )))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3257, __FUNCTION__))->decl_common.lang_flag_6); |
3258 | if (DECL_VISIBILITY_SPECIFIED (tmpl_func)((contains_struct_check ((tmpl_func), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3258, __FUNCTION__))->decl_with_vis.visibility_specified )) |
3259 | { |
3260 | DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3260, __FUNCTION__))->decl_with_vis.visibility_specified ) = 1; |
3261 | DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3261, __FUNCTION__))->decl_with_vis.visibility) = DECL_VISIBILITY (tmpl_func)((contains_struct_check ((tmpl_func), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3261, __FUNCTION__))->decl_with_vis.visibility); |
3262 | } |
3263 | } |
3264 | |
3265 | /* If DECL is a friend declaration, declared using an |
3266 | unqualified name, the namespace associated with DECL may |
3267 | have been set incorrectly. For example, in: |
3268 | |
3269 | template <typename T> void f(T); |
3270 | namespace N { |
3271 | struct S { friend void f<int>(int); } |
3272 | } |
3273 | |
3274 | we will have set the DECL_CONTEXT for the friend |
3275 | declaration to N, rather than to the global namespace. */ |
3276 | if (DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3276, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (decl)->base.code) == CONST_DECL || (( enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code ) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl )->base.code) == TEMPLATE_DECL)) && ((enum tree_code ) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3276, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code ) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3276, __FUNCTION__))->decl_minimal.context))->base.code ) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl) , (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3276, __FUNCTION__))->decl_minimal.context) : cp_global_trees [CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)) |
3277 | DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3277, __FUNCTION__))->decl_minimal.context) = DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3277, __FUNCTION__))->decl_minimal.context); |
3278 | |
3279 | if (is_friend && !have_def) |
3280 | /* This is not really a declaration of a specialization. |
3281 | It's just the name of an instantiation. But, it's not |
3282 | a request for an instantiation, either. */ |
3283 | SET_DECL_IMPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3283, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) = 1); |
3284 | else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL) |
3285 | /* A specialization is not necessarily COMDAT. */ |
3286 | DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3286, __FUNCTION__))->decl_with_vis.comdat_flag) = (TREE_PUBLIC (decl)((decl)->base.public_flag) |
3287 | && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3287, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag )); |
3288 | else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)) |
3289 | DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3289, __FUNCTION__))->decl_with_vis.comdat_flag) = false; |
3290 | |
3291 | /* If this is a full specialization, register it so that we can find |
3292 | it again. Partial specializations will be registered in |
3293 | process_partial_specialization. */ |
3294 | if (!processing_template_declscope_chain->x_processing_template_decl) |
3295 | { |
3296 | warn_spec_missing_attributes (gen_tmpl, decl, attrlist); |
3297 | |
3298 | decl = register_specialization (decl, gen_tmpl, targs, |
3299 | is_friend, 0); |
3300 | } |
3301 | |
3302 | |
3303 | /* A 'structor should already have clones. */ |
3304 | gcc_assert (decl == error_mark_node((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p (tmpl) || !(((tree_check (((((enum tree_code) (decl)->base .code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) || ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) || (((contains_struct_check (((((contains_struct_check ((( contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check (((( (contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__), 0 : 0)) |
3305 | || variable_template_p (tmpl)((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p (tmpl) || !(((tree_check (((((enum tree_code) (decl)->base .code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) || ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) || (((contains_struct_check (((((contains_struct_check ((( contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check (((( (contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__), 0 : 0)) |
3306 | || !(DECL_CONSTRUCTOR_P (decl)((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p (tmpl) || !(((tree_check (((((enum tree_code) (decl)->base .code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) || ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) || (((contains_struct_check (((((contains_struct_check ((( contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check (((( (contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__), 0 : 0)) |
3307 | || DECL_DESTRUCTOR_P (decl))((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p (tmpl) || !(((tree_check (((((enum tree_code) (decl)->base .code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) || ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) || (((contains_struct_check (((((contains_struct_check ((( contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check (((( (contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__), 0 : 0)) |
3308 | || DECL_CLONED_FUNCTION_P (DECL_CHAIN (decl)))((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p (tmpl) || !(((tree_check (((((enum tree_code) (decl)->base .code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast <union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3306, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor ) || ((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast< union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3307, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor )) || (((contains_struct_check (((((contains_struct_check ((( contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) && ((!( (tree_not_check2 (((tree_check ((((contains_struct_check (((( (contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL) , "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__))->decl_minimal.name) == cp_global_trees [CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3308, __FUNCTION__), 0 : 0)); |
3309 | } |
3310 | } |
3311 | |
3312 | return decl; |
3313 | } |
3314 | |
3315 | /* Returns 1 iff PARMS1 and PARMS2 are identical sets of template |
3316 | parameters. These are represented in the same format used for |
3317 | DECL_TEMPLATE_PARMS. */ |
3318 | |
3319 | int |
3320 | comp_template_parms (const_tree parms1, const_tree parms2) |
3321 | { |
3322 | const_tree p1; |
3323 | const_tree p2; |
3324 | |
3325 | if (parms1 == parms2) |
3326 | return 1; |
3327 | |
3328 | for (p1 = parms1, p2 = parms2; |
3329 | p1 != NULL_TREE(tree) __null && p2 != NULL_TREE(tree) __null; |
3330 | p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3330, __FUNCTION__))->common.chain), p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3330, __FUNCTION__))->common.chain)) |
3331 | { |
3332 | tree t1 = TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3332, __FUNCTION__, (TREE_LIST)))->list.value); |
3333 | tree t2 = TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3333, __FUNCTION__, (TREE_LIST)))->list.value); |
3334 | int i; |
3335 | |
3336 | gcc_assert (TREE_CODE (t1) == TREE_VEC)((void)(!(((enum tree_code) (t1)->base.code) == TREE_VEC) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3336, __FUNCTION__), 0 : 0)); |
3337 | gcc_assert (TREE_CODE (t2) == TREE_VEC)((void)(!(((enum tree_code) (t2)->base.code) == TREE_VEC) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3337, __FUNCTION__), 0 : 0)); |
3338 | |
3339 | if (TREE_VEC_LENGTH (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3339, __FUNCTION__, (TREE_VEC)))->base.u.length) != TREE_VEC_LENGTH (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3339, __FUNCTION__, (TREE_VEC)))->base.u.length)) |
3340 | return 0; |
3341 | |
3342 | for (i = 0; i < TREE_VEC_LENGTH (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3342, __FUNCTION__, (TREE_VEC)))->base.u.length); ++i) |
3343 | { |
3344 | tree parm1 = TREE_VALUE (TREE_VEC_ELT (t1, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check ((t1), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3344, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3344, __FUNCTION__, (TREE_LIST)))->list.value); |
3345 | tree parm2 = TREE_VALUE (TREE_VEC_ELT (t2, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check ((t2), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3345, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3345, __FUNCTION__, (TREE_LIST)))->list.value); |
3346 | |
3347 | /* If either of the template parameters are invalid, assume |
3348 | they match for the sake of error recovery. */ |
3349 | if (error_operand_p (parm1)((parm1) == global_trees[TI_ERROR_MARK] || ((parm1) && ((contains_struct_check (((parm1)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3349, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ])) || error_operand_p (parm2)((parm2) == global_trees[TI_ERROR_MARK] || ((parm2) && ((contains_struct_check (((parm2)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3349, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ]))) |
3350 | return 1; |
3351 | |
3352 | if (TREE_CODE (parm1)((enum tree_code) (parm1)->base.code) != TREE_CODE (parm2)((enum tree_code) (parm2)->base.code)) |
3353 | return 0; |
3354 | |
3355 | if (TREE_CODE (parm1)((enum tree_code) (parm1)->base.code) == TEMPLATE_TYPE_PARM |
3356 | && (TEMPLATE_TYPE_PARAMETER_PACK (parm1)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3 (((parm1)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3356, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3356, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3356, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3356, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
3357 | == TEMPLATE_TYPE_PARAMETER_PACK (parm2)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3 (((parm2)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3357, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3357, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3357, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3357, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))))) |
3358 | continue; |
3359 | else if (!same_type_p (TREE_TYPE (parm1), TREE_TYPE (parm2))comptypes ((((contains_struct_check ((parm1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3359, __FUNCTION__))->typed.type)), (((contains_struct_check ((parm2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3359, __FUNCTION__))->typed.type)), 0)) |
3360 | return 0; |
3361 | } |
3362 | } |
3363 | |
3364 | if ((p1 != NULL_TREE(tree) __null) != (p2 != NULL_TREE(tree) __null)) |
3365 | /* One set of parameters has more parameters lists than the |
3366 | other. */ |
3367 | return 0; |
3368 | |
3369 | return 1; |
3370 | } |
3371 | |
3372 | /* Returns true if two template parameters are declared with |
3373 | equivalent constraints. */ |
3374 | |
3375 | static bool |
3376 | template_parameter_constraints_equivalent_p (const_tree parm1, const_tree parm2) |
3377 | { |
3378 | tree req1 = TREE_TYPE (parm1)((contains_struct_check ((parm1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3378, __FUNCTION__))->typed.type); |
3379 | tree req2 = TREE_TYPE (parm2)((contains_struct_check ((parm2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3379, __FUNCTION__))->typed.type); |
3380 | if (!req1 != !req2) |
3381 | return false; |
3382 | if (req1) |
3383 | return cp_tree_equal (req1, req2); |
3384 | return true; |
3385 | } |
3386 | |
3387 | /* Returns true when two template parameters are equivalent. */ |
3388 | |
3389 | static bool |
3390 | template_parameters_equivalent_p (const_tree parm1, const_tree parm2) |
3391 | { |
3392 | tree decl1 = TREE_VALUE (parm1)((tree_check ((parm1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3392, __FUNCTION__, (TREE_LIST)))->list.value); |
3393 | tree decl2 = TREE_VALUE (parm2)((tree_check ((parm2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3393, __FUNCTION__, (TREE_LIST)))->list.value); |
3394 | |
3395 | /* If either of the template parameters are invalid, assume |
3396 | they match for the sake of error recovery. */ |
3397 | if (error_operand_p (decl1)((decl1) == global_trees[TI_ERROR_MARK] || ((decl1) && ((contains_struct_check (((decl1)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3397, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ])) || error_operand_p (decl2)((decl2) == global_trees[TI_ERROR_MARK] || ((decl2) && ((contains_struct_check (((decl2)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3397, __FUNCTION__))->typed.type) == global_trees[TI_ERROR_MARK ]))) |
3398 | return true; |
3399 | |
3400 | /* ... they declare parameters of the same kind. */ |
3401 | if (TREE_CODE (decl1)((enum tree_code) (decl1)->base.code) != TREE_CODE (decl2)((enum tree_code) (decl2)->base.code)) |
3402 | return false; |
3403 | |
3404 | /* ... one parameter was introduced by a parameter declaration, then |
3405 | both are. This case arises as a result of eagerly rewriting declarations |
3406 | during parsing. */ |
3407 | if (DECL_VIRTUAL_P (decl1)((contains_struct_check ((decl1), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3407, __FUNCTION__))->decl_common.virtual_flag) != DECL_VIRTUAL_P (decl2)((contains_struct_check ((decl2), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3407, __FUNCTION__))->decl_common.virtual_flag)) |
3408 | return false; |
3409 | |
3410 | /* ... if either declares a pack, they both do. */ |
3411 | if (template_parameter_pack_p (decl1) != template_parameter_pack_p (decl2)) |
3412 | return false; |
3413 | |
3414 | if (TREE_CODE (decl1)((enum tree_code) (decl1)->base.code) == PARM_DECL) |
3415 | { |
3416 | /* ... if they declare non-type parameters, the types are equivalent. */ |
3417 | if (!same_type_p (TREE_TYPE (decl1), TREE_TYPE (decl2))comptypes ((((contains_struct_check ((decl1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3417, __FUNCTION__))->typed.type)), (((contains_struct_check ((decl2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3417, __FUNCTION__))->typed.type)), 0)) |
3418 | return false; |
3419 | } |
3420 | else if (TREE_CODE (decl2)((enum tree_code) (decl2)->base.code) == TEMPLATE_DECL) |
3421 | { |
3422 | /* ... if they declare template template parameters, their template |
3423 | parameter lists are equivalent. */ |
3424 | if (!template_heads_equivalent_p (decl1, decl2)) |
3425 | return false; |
3426 | } |
3427 | |
3428 | /* ... if they are declared with a qualified-concept name, they both |
3429 | are, and those names are equivalent. */ |
3430 | return template_parameter_constraints_equivalent_p (parm1, parm2); |
3431 | } |
3432 | |
3433 | /* Returns true if two template parameters lists are equivalent. |
3434 | Two template parameter lists are equivalent if they have the |
3435 | same length and their corresponding parameters are equivalent. |
3436 | |
3437 | PARMS1 and PARMS2 are TREE_LISTs containing TREE_VECs: the |
3438 | data structure returned by DECL_TEMPLATE_PARMS. |
3439 | |
3440 | This is generally the same implementation as comp_template_parms |
3441 | except that it also the concept names and arguments used to |
3442 | introduce parameters. */ |
3443 | |
3444 | static bool |
3445 | template_parameter_lists_equivalent_p (const_tree parms1, const_tree parms2) |
3446 | { |
3447 | if (parms1 == parms2) |
3448 | return true; |
3449 | |
3450 | const_tree p1 = parms1; |
3451 | const_tree p2 = parms2; |
3452 | while (p1 != NULL_TREE(tree) __null && p2 != NULL_TREE(tree) __null) |
3453 | { |
3454 | tree list1 = TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3454, __FUNCTION__, (TREE_LIST)))->list.value); |
3455 | tree list2 = TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3455, __FUNCTION__, (TREE_LIST)))->list.value); |
3456 | |
3457 | if (TREE_VEC_LENGTH (list1)((tree_check ((list1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3457, __FUNCTION__, (TREE_VEC)))->base.u.length) != TREE_VEC_LENGTH (list2)((tree_check ((list2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3457, __FUNCTION__, (TREE_VEC)))->base.u.length)) |
3458 | return 0; |
3459 | |
3460 | for (int i = 0; i < TREE_VEC_LENGTH (list2)((tree_check ((list2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3460, __FUNCTION__, (TREE_VEC)))->base.u.length); ++i) |
3461 | { |
3462 | tree parm1 = TREE_VEC_ELT (list1, i)(*((const_cast<tree *> (tree_vec_elt_check ((list1), (i ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3462, __FUNCTION__))))); |
3463 | tree parm2 = TREE_VEC_ELT (list2, i)(*((const_cast<tree *> (tree_vec_elt_check ((list2), (i ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3463, __FUNCTION__))))); |
3464 | if (!template_parameters_equivalent_p (parm1, parm2)) |
3465 | return false; |
3466 | } |
3467 | |
3468 | p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3468, __FUNCTION__))->common.chain); |
3469 | p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3469, __FUNCTION__))->common.chain); |
3470 | } |
3471 | |
3472 | if ((p1 != NULL_TREE(tree) __null) != (p2 != NULL_TREE(tree) __null)) |
3473 | return false; |
3474 | |
3475 | return true; |
3476 | } |
3477 | |
3478 | /* Return true if the requires-clause of the template parameter lists are |
3479 | equivalent and false otherwise. */ |
3480 | static bool |
3481 | template_requirements_equivalent_p (const_tree parms1, const_tree parms2) |
3482 | { |
3483 | tree req1 = TEMPLATE_PARMS_CONSTRAINTS (parms1)((contains_struct_check (((tree_check ((parms1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3483, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3483, __FUNCTION__))->typed.type); |
3484 | tree req2 = TEMPLATE_PARMS_CONSTRAINTS (parms2)((contains_struct_check (((tree_check ((parms2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3484, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3484, __FUNCTION__))->typed.type); |
3485 | if ((req1 != NULL_TREE(tree) __null) != (req2 != NULL_TREE(tree) __null)) |
3486 | return false; |
3487 | if (!cp_tree_equal (req1, req2)) |
3488 | return false; |
3489 | return true; |
3490 | } |
3491 | |
3492 | /* Returns true if two template heads are equivalent. 17.6.6.1p6: |
3493 | Two template heads are equivalent if their template parameter |
3494 | lists are equivalent and their requires clauses are equivalent. |
3495 | |
3496 | In pre-C++20, this is equivalent to calling comp_template_parms |
3497 | for the template parameters of TMPL1 and TMPL2. */ |
3498 | |
3499 | bool |
3500 | template_heads_equivalent_p (const_tree tmpl1, const_tree tmpl2) |
3501 | { |
3502 | tree parms1 = DECL_TEMPLATE_PARMS (tmpl1)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((tmpl1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3502, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments; |
3503 | tree parms2 = DECL_TEMPLATE_PARMS (tmpl2)((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((tmpl2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3503, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments; |
3504 | |
3505 | /* Don't change the matching rules for pre-C++20. */ |
3506 | if (cxx_dialect < cxx20) |
3507 | return comp_template_parms (parms1, parms2); |
3508 | |
3509 | /* ... have the same number of template parameters, and their |
3510 | corresponding parameters are equivalent. */ |
3511 | if (!template_parameter_lists_equivalent_p (parms1, parms2)) |
3512 | return false; |
3513 | |
3514 | /* ... if either has a requires-clause, they both do and their |
3515 | corresponding constraint-expressions are equivalent. */ |
3516 | return template_requirements_equivalent_p (parms1, parms2); |
3517 | } |
3518 | |
3519 | /* Determine whether PARM is a parameter pack. */ |
3520 | |
3521 | bool |
3522 | template_parameter_pack_p (const_tree parm) |
3523 | { |
3524 | /* Determine if we have a non-type template parameter pack. */ |
3525 | if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == PARM_DECL) |
3526 | return (DECL_TEMPLATE_PARM_P (parm)(((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3526, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (parm)->base.code) == CONST_DECL || (( enum tree_code) (parm)->base.code) == PARM_DECL || ((enum tree_code ) (parm)->base.code) == TYPE_DECL || ((enum tree_code) (parm )->base.code) == TEMPLATE_DECL)) |
3527 | && TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm))(((tree_not_check2 (((tree_check ((((contains_struct_check (( parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3527, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3527, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3527, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))); |
3528 | if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_PARM_INDEX) |
3529 | return TEMPLATE_PARM_PARAMETER_PACK (parm)(((tree_not_check2 (((tree_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3529, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3529, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)); |
3530 | |
3531 | /* If this is a list of template parameters, we could get a |
3532 | TYPE_DECL or a TEMPLATE_DECL. */ |
3533 | if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TYPE_DECL || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_DECL) |
3534 | parm = TREE_TYPE (parm)((contains_struct_check ((parm), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3534, __FUNCTION__))->typed.type); |
3535 | |
3536 | /* Otherwise it must be a type template parameter. */ |
3537 | return ((TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_TYPE_PARM |
3538 | || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_TEMPLATE_PARM) |
3539 | && TEMPLATE_TYPE_PARAMETER_PACK (parm)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3 (((parm)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3539, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3539, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3539, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3539, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))); |
3540 | } |
3541 | |
3542 | /* Determine if T is a function parameter pack. */ |
3543 | |
3544 | bool |
3545 | function_parameter_pack_p (const_tree t) |
3546 | { |
3547 | if (t && TREE_CODE (t)((enum tree_code) (t)->base.code) == PARM_DECL) |
3548 | return DECL_PACK_P (t)((tree_code_type[(int) (((enum tree_code) (t)->base.code)) ] == tcc_declaration) && (((enum tree_code) (((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3548, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION || ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3548, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION )); |
3549 | return false; |
3550 | } |
3551 | |
3552 | /* Return the function template declaration of PRIMARY_FUNC_TMPL_INST. |
3553 | PRIMARY_FUNC_TMPL_INST is a primary function template instantiation. */ |
3554 | |
3555 | tree |
3556 | get_function_template_decl (const_tree primary_func_tmpl_inst) |
3557 | { |
3558 | if (! primary_func_tmpl_inst |
3559 | || TREE_CODE (primary_func_tmpl_inst)((enum tree_code) (primary_func_tmpl_inst)->base.code) != FUNCTION_DECL |
3560 | || ! primary_template_specialization_p (primary_func_tmpl_inst)) |
3561 | return NULL__null; |
3562 | |
3563 | return DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (primary_func_tmpl_inst))((struct tree_template_decl *)(const_cast<union tree_node * > ((((tree_check ((((struct tree_template_info*)(tree_check (((((contains_struct_check ((template_info_decl_check ((primary_func_tmpl_inst ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3563, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3563, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3563, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3563, __FUNCTION__, (TEMPLATE_DECL))))))))->result; |
3564 | } |
3565 | |
3566 | /* Return true iff the function parameter PARAM_DECL was expanded |
3567 | from the function parameter pack PACK. */ |
3568 | |
3569 | bool |
3570 | function_parameter_expanded_from_pack_p (tree param_decl, tree pack) |
3571 | { |
3572 | if (DECL_ARTIFICIAL (param_decl)((contains_struct_check ((param_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3572, __FUNCTION__))->decl_common.artificial_flag) |
3573 | || !function_parameter_pack_p (pack)) |
3574 | return false; |
3575 | |
3576 | /* The parameter pack and its pack arguments have the same |
3577 | DECL_PARM_INDEX. */ |
3578 | return DECL_PARM_INDEX (pack)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((pack), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3578, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (pack)->base.code) != PARM_DECL || lt-> u.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3578, __FUNCTION__); <->u.parm; })->index) == DECL_PARM_INDEX (param_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check ((param_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3578, __FUNCTION__))->decl_common.lang_specific); if ((( enum tree_code) (param_decl)->base.code) != PARM_DECL || lt ->u.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3578, __FUNCTION__); <->u.parm; })->index); |
3579 | } |
3580 | |
3581 | /* Determine whether ARGS describes a variadic template args list, |
3582 | i.e., one that is terminated by a template argument pack. */ |
3583 | |
3584 | static bool |
3585 | template_args_variadic_p (tree args) |
3586 | { |
3587 | int nargs; |
3588 | tree last_parm; |
3589 | |
3590 | if (args == NULL_TREE(tree) __null) |
3591 | return false; |
3592 | |
3593 | args = INNERMOST_TEMPLATE_ARGS (args)(get_innermost_template_args ((args), 1)); |
3594 | nargs = TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3594, __FUNCTION__, (TREE_VEC)))->base.u.length); |
3595 | |
3596 | if (nargs == 0) |
3597 | return false; |
3598 | |
3599 | last_parm = TREE_VEC_ELT (args, nargs - 1)(*((const_cast<tree *> (tree_vec_elt_check ((args), (nargs - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3599, __FUNCTION__))))); |
3600 | |
3601 | return ARGUMENT_PACK_P (last_parm)(((enum tree_code) (last_parm)->base.code) == TYPE_ARGUMENT_PACK || ((enum tree_code) (last_parm)->base.code) == NONTYPE_ARGUMENT_PACK ); |
3602 | } |
3603 | |
3604 | /* Generate a new name for the parameter pack name NAME (an |
3605 | IDENTIFIER_NODE) that incorporates its */ |
3606 | |
3607 | static tree |
3608 | make_ith_pack_parameter_name (tree name, int i) |
3609 | { |
3610 | /* Munge the name to include the parameter index. */ |
3611 | #define NUMBUF_LEN128 128 |
3612 | char numbuf[NUMBUF_LEN128]; |
3613 | char* newname; |
3614 | int newname_len; |
3615 | |
3616 | if (name == NULL_TREE(tree) __null) |
3617 | return name; |
3618 | snprintf (numbuf, NUMBUF_LEN128, "%i", i); |
3619 | newname_len = IDENTIFIER_LENGTH (name)((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3619, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.len ) |
3620 | + strlen (numbuf) + 2; |
3621 | newname = (char*)alloca (newname_len)__builtin_alloca(newname_len); |
3622 | snprintf (newname, newname_len, |
3623 | "%s#%i", IDENTIFIER_POINTER (name)((const char *) (tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3623, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str ), i); |
3624 | return get_identifier (newname)(__builtin_constant_p (newname) ? get_identifier_with_length ( (newname), strlen (newname)) : get_identifier (newname)); |
3625 | } |
3626 | |
3627 | /* Return true if T is a primary function, class or alias template |
3628 | specialization, not including the template pattern. */ |
3629 | |
3630 | bool |
3631 | primary_template_specialization_p (const_tree t) |
3632 | { |
3633 | if (!t) |
3634 | return false; |
3635 | |
3636 | if (VAR_OR_FUNCTION_DECL_P (t)(((enum tree_code) (t)->base.code) == VAR_DECL || ((enum tree_code ) (t)->base.code) == FUNCTION_DECL)) |
3637 | return (DECL_LANG_SPECIFIC (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3637, __FUNCTION__))->decl_common.lang_specific) |
3638 | && DECL_USE_TEMPLATE (t)(((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3638, __FUNCTION__))->decl_common.lang_specific)->u.base .use_template) |
3639 | && DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3639, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3639, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) |
3640 | && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check (((((contains_struct_check ( (template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3640, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))); |
3641 | else if (CLASS_TYPE_P (t)(((((enum tree_code) (t)->base.code)) == RECORD_TYPE || (( (enum tree_code) (t)->base.code)) == UNION_TYPE) && ((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3641, __FUNCTION__))->type_common.lang_flag_5)) && !TYPE_DECL_ALIAS_P (TYPE_NAME (t))((contains_struct_check (((tree_check ((((tree_class_check (( t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3641, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3641, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3641, __FUNCTION__))->decl_common.lang_flag_6)) |
3642 | return (CLASSTYPE_TEMPLATE_INFO (t)(((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3642, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3642, __FUNCTION__))->type_non_common.lang_1)) |
3643 | && CLASSTYPE_USE_TEMPLATE (t)((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3643, __FUNCTION__))->type_with_lang_specific.lang_specific ))->use_template) |
3644 | && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info*)(tree_check (((((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__))->typed.type))) == (((struct tree_template_info *)(tree_check (((((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE )))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3644, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))); |
3645 | else if (alias_template_specialization_p (t, nt_transparent)) |
3646 | return true; |
3647 | return false; |
3648 | } |
3649 | |
3650 | /* Return true if PARM is a template template parameter. */ |
3651 | |
3652 | bool |
3653 | template_template_parameter_p (const_tree parm) |
3654 | { |
3655 | return DECL_TEMPLATE_TEMPLATE_PARM_P (parm)(((enum tree_code) (parm)->base.code) == TEMPLATE_DECL && (((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3655, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (parm)->base.code) == CONST_DECL || (( enum tree_code) (parm)->base.code) == PARM_DECL || ((enum tree_code ) (parm)->base.code) == TYPE_DECL || ((enum tree_code) (parm )->base.code) == TEMPLATE_DECL))); |
3656 | } |
3657 | |
3658 | /* Return true iff PARM is a DECL representing a type template |
3659 | parameter. */ |
3660 | |
3661 | bool |
3662 | template_type_parameter_p (const_tree parm) |
3663 | { |
3664 | return (parm |
3665 | && (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TYPE_DECL |
3666 | || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_DECL) |
3667 | && DECL_TEMPLATE_PARM_P (parm)(((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3667, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (parm)->base.code) == CONST_DECL || (( enum tree_code) (parm)->base.code) == PARM_DECL || ((enum tree_code ) (parm)->base.code) == TYPE_DECL || ((enum tree_code) (parm )->base.code) == TEMPLATE_DECL))); |
3668 | } |
3669 | |
3670 | /* Return the template parameters of T if T is a |
3671 | primary template instantiation, NULL otherwise. */ |
3672 | |
3673 | tree |
3674 | get_primary_template_innermost_parameters (const_tree t) |
3675 | { |
3676 | tree parms = NULL__null, template_info = NULL__null; |
3677 | |
3678 | if ((template_info = get_template_info (t)) |
3679 | && primary_template_specialization_p (t)) |
3680 | parms = INNERMOST_TEMPLATE_PARMS((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info *)(tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3681, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3681, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3681, __FUNCTION__, (TREE_LIST)))->list.value) |
3681 | (DECL_TEMPLATE_PARMS (TI_TEMPLATE (template_info)))((tree_check ((((struct tree_template_decl *)(const_cast<union tree_node *> ((((tree_check ((((struct tree_template_info *)(tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3681, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3681, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3681, __FUNCTION__, (TREE_LIST)))->list.value); |
3682 | |
3683 | return parms; |
3684 | } |
3685 | |
3686 | /* Return the template parameters of the LEVELth level from the full list |
3687 | of template parameters PARMS. */ |
3688 | |
3689 | tree |
3690 | get_template_parms_at_level (tree parms, int level) |
3691 | { |
3692 | tree p; |
3693 | if (!parms |
3694 | || TREE_CODE (parms)((enum tree_code) (parms)->base.code) != TREE_LIST |
3695 | || level > TMPL_PARMS_DEPTH (parms)((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3695, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3695, __FUNCTION__))))) |
3696 | return NULL_TREE(tree) __null; |
3697 | |
3698 | for (p = parms; p; p = TREE_CHAIN (p)((contains_struct_check ((p), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3698, __FUNCTION__))->common.chain)) |
3699 | if (TMPL_PARMS_DEPTH (p)((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check ((p), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3699, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3699, __FUNCTION__)))) == level) |
3700 | return p; |
3701 | |
3702 | return NULL_TREE(tree) __null; |
3703 | } |
3704 | |
3705 | /* Returns the template arguments of T if T is a template instantiation, |
3706 | NULL otherwise. */ |
3707 | |
3708 | tree |
3709 | get_template_innermost_arguments (const_tree t) |
3710 | { |
3711 | tree args = NULL__null, template_info = NULL__null; |
3712 | |
3713 | if ((template_info = get_template_info (t)) |
3714 | && TI_ARGS (template_info)((struct tree_template_info*)(tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3714, __FUNCTION__, (TEMPLATE_INFO))))->args) |
3715 | args = INNERMOST_TEMPLATE_ARGS (TI_ARGS (template_info))(get_innermost_template_args ((((struct tree_template_info*)( tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3715, __FUNCTION__, (TEMPLATE_INFO))))->args), 1)); |
3716 | |
3717 | return args; |
3718 | } |
3719 | |
3720 | /* Return the argument pack elements of T if T is a template argument pack, |
3721 | NULL otherwise. */ |
3722 | |
3723 | tree |
3724 | get_template_argument_pack_elems (const_tree t) |
3725 | { |
3726 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) != TYPE_ARGUMENT_PACK |
3727 | && TREE_CODE (t)((enum tree_code) (t)->base.code) != NONTYPE_ARGUMENT_PACK) |
3728 | return NULL__null; |
3729 | |
3730 | return ARGUMENT_PACK_ARGS (t)(((enum tree_code) (t)->base.code) == TYPE_ARGUMENT_PACK? ( (contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3730, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3730, __FUNCTION__)))))); |
3731 | } |
3732 | |
3733 | /* In an ARGUMENT_PACK_SELECT, the actual underlying argument that the |
3734 | ARGUMENT_PACK_SELECT represents. */ |
3735 | |
3736 | static tree |
3737 | argument_pack_select_arg (tree t) |
3738 | { |
3739 | tree args = ARGUMENT_PACK_ARGS (ARGUMENT_PACK_SELECT_FROM_PACK (t))(((enum tree_code) ((((struct tree_argument_pack_select *)(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3739, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack ))->base.code) == TYPE_ARGUMENT_PACK? ((contains_struct_check (((((struct tree_argument_pack_select *)(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3739, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack )), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3739, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check (((((struct tree_argument_pack_select *)(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3739, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack )), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3739, __FUNCTION__)))))); |
3740 | tree arg = TREE_VEC_ELT (args, ARGUMENT_PACK_SELECT_INDEX (t))(*((const_cast<tree *> (tree_vec_elt_check ((args), ((( (struct tree_argument_pack_select *)(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3740, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->index)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3740, __FUNCTION__))))); |
3741 | |
3742 | /* If the selected argument is an expansion E, that most likely means we were |
3743 | called from gen_elem_of_pack_expansion_instantiation during the |
3744 | substituting of an argument pack (of which the Ith element is a pack |
3745 | expansion, where I is ARGUMENT_PACK_SELECT_INDEX) into a pack expansion. |
3746 | In this case, the Ith element resulting from this substituting is going to |
3747 | be a pack expansion, which pattern is the pattern of E. Let's return the |
3748 | pattern of E, and gen_elem_of_pack_expansion_instantiation will build the |
3749 | resulting pack expansion from it. */ |
3750 | if (PACK_EXPANSION_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION || ((enum tree_code) (arg)->base.code) == EXPR_PACK_EXPANSION )) |
3751 | { |
3752 | /* Make sure we aren't throwing away arg info. */ |
3753 | gcc_assert (!PACK_EXPANSION_EXTRA_ARGS (arg))((void)(!(!*(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION ? &((tree_class_check ((arg), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3753, __FUNCTION__))->type_non_common.maxval) : &(*( (const_cast<tree*> (tree_operand_check (((arg)), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3753, __FUNCTION__))))))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3753, __FUNCTION__), 0 : 0)); |
3754 | arg = PACK_EXPANSION_PATTERN (arg)(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3754, __FUNCTION__))->typed.type) : (*((const_cast<tree *> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3754, __FUNCTION__)))))); |
3755 | } |
3756 | |
3757 | return arg; |
3758 | } |
3759 | |
3760 | |
3761 | /* True iff FN is a function representing a built-in variadic parameter |
3762 | pack. */ |
3763 | |
3764 | bool |
3765 | builtin_pack_fn_p (tree fn) |
3766 | { |
3767 | if (!fn |
3768 | || TREE_CODE (fn)((enum tree_code) (fn)->base.code) != FUNCTION_DECL |
3769 | || !DECL_IS_UNDECLARED_BUILTIN (fn)(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3769, __FUNCTION__))->decl_minimal.locus) <= ((location_t ) 1))) |
3770 | return false; |
3771 | |
3772 | if (id_equal (DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3772, __FUNCTION__))->decl_minimal.name), "__integer_pack")) |
3773 | return true; |
3774 | |
3775 | return false; |
3776 | } |
3777 | |
3778 | /* True iff CALL is a call to a function representing a built-in variadic |
3779 | parameter pack. */ |
3780 | |
3781 | static bool |
3782 | builtin_pack_call_p (tree call) |
3783 | { |
3784 | if (TREE_CODE (call)((enum tree_code) (call)->base.code) != CALL_EXPR) |
3785 | return false; |
3786 | return builtin_pack_fn_p (CALL_EXPR_FN (call)(*((const_cast<tree*> (tree_operand_check (((tree_check ((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3786, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3786, __FUNCTION__)))))); |
3787 | } |
3788 | |
3789 | /* Return a TREE_VEC for the expansion of __integer_pack(HI). */ |
3790 | |
3791 | static tree |
3792 | expand_integer_pack (tree call, tree args, tsubst_flags_t complain, |
3793 | tree in_decl) |
3794 | { |
3795 | tree ohi = CALL_EXPR_ARG (call, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check ((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3795, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3795, __FUNCTION__))))); |
3796 | tree hi = tsubst_copy_and_build (ohi, args, complain, in_decl, |
3797 | false/*fn*/, true/*int_cst*/); |
3798 | |
3799 | if (value_dependent_expression_p (hi)) |
3800 | { |
3801 | if (hi != ohi) |
3802 | { |
3803 | call = copy_node (call); |
3804 | CALL_EXPR_ARG (call, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check ((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3804, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3804, __FUNCTION__))))) = hi; |
3805 | } |
3806 | tree ex = make_pack_expansion (call, complain); |
3807 | tree vec = make_tree_vec (1); |
3808 | TREE_VEC_ELT (vec, 0)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3808, __FUNCTION__))))) = ex; |
3809 | return vec; |
3810 | } |
3811 | else |
3812 | { |
3813 | hi = cxx_constant_value (hi); |
3814 | int len = valid_constant_size_p (hi) ? tree_to_shwi (hi) : -1; |
3815 | |
3816 | /* Calculate the largest value of len that won't make the size of the vec |
3817 | overflow an int. The compiler will exceed resource limits long before |
3818 | this, but it seems a decent place to diagnose. */ |
3819 | int max = ((INT_MAX2147483647 - sizeof (tree_vec)) / sizeof (tree)) + 1; |
3820 | |
3821 | if (len < 0 || len > max) |
3822 | { |
3823 | if ((complain & tf_error) |
3824 | && hi != error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
3825 | error ("argument to %<__integer_pack%> must be between 0 and %d", |
3826 | max); |
3827 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
3828 | } |
3829 | |
3830 | tree vec = make_tree_vec (len); |
3831 | |
3832 | for (int i = 0; i < len; ++i) |
3833 | TREE_VEC_ELT (vec, i)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3833, __FUNCTION__))))) = size_int (i)size_int_kind (i, stk_sizetype); |
3834 | |
3835 | return vec; |
3836 | } |
3837 | } |
3838 | |
3839 | /* Return a TREE_VEC for the expansion of built-in template parameter pack |
3840 | CALL. */ |
3841 | |
3842 | static tree |
3843 | expand_builtin_pack_call (tree call, tree args, tsubst_flags_t complain, |
3844 | tree in_decl) |
3845 | { |
3846 | if (!builtin_pack_call_p (call)) |
3847 | return NULL_TREE(tree) __null; |
3848 | |
3849 | tree fn = CALL_EXPR_FN (call)(*((const_cast<tree*> (tree_operand_check (((tree_check ((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3849, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3849, __FUNCTION__))))); |
3850 | |
3851 | if (id_equal (DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3851, __FUNCTION__))->decl_minimal.name), "__integer_pack")) |
3852 | return expand_integer_pack (call, args, complain, in_decl); |
3853 | |
3854 | return NULL_TREE(tree) __null; |
3855 | } |
3856 | |
3857 | /* Structure used to track the progress of find_parameter_packs_r. */ |
3858 | struct find_parameter_pack_data |
3859 | { |
3860 | /* TREE_LIST that will contain all of the parameter packs found by |
3861 | the traversal. */ |
3862 | tree* parameter_packs; |
3863 | |
3864 | /* Set of AST nodes that have been visited by the traversal. */ |
3865 | hash_set<tree> *visited; |
3866 | |
3867 | /* True iff we're making a type pack expansion. */ |
3868 | bool type_pack_expansion_p; |
3869 | }; |
3870 | |
3871 | /* Identifies all of the argument packs that occur in a template |
3872 | argument and appends them to the TREE_LIST inside DATA, which is a |
3873 | find_parameter_pack_data structure. This is a subroutine of |
3874 | make_pack_expansion and uses_parameter_packs. */ |
3875 | static tree |
3876 | find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data) |
3877 | { |
3878 | tree t = *tp; |
3879 | struct find_parameter_pack_data* ppd = |
3880 | (struct find_parameter_pack_data*)data; |
3881 | bool parameter_pack_p = false; |
3882 | |
3883 | /* Don't look through typedefs; we are interested in whether a |
3884 | parameter pack is actually written in the expression/type we're |
3885 | looking at, not the target type. */ |
3886 | if (TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))] == tcc_type) && typedef_variant_p (t)) |
3887 | { |
3888 | /* But do look at arguments for an alias template. */ |
3889 | if (tree tinfo = TYPE_ALIAS_TEMPLATE_INFO (t)(((contains_struct_check ((((tree_class_check ((t), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3889, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3889, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check ((template_info_decl_check ((((tree_class_check ((t), (tcc_type ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3889, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3889, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3889, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info) : (tree) __null)) |
3890 | cp_walk_tree (&TI_ARGS (tinfo),walk_tree_1 (&((struct tree_template_info*)(tree_check (( tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3890, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
3891 | &find_parameter_packs_r,walk_tree_1 (&((struct tree_template_info*)(tree_check (( tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3890, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
3892 | ppd, ppd->visited)walk_tree_1 (&((struct tree_template_info*)(tree_check (( tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3890, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
3893 | *walk_subtrees = 0; |
3894 | return NULL_TREE(tree) __null; |
3895 | } |
3896 | |
3897 | /* Identify whether this is a parameter pack or not. */ |
3898 | switch (TREE_CODE (t)((enum tree_code) (t)->base.code)) |
3899 | { |
3900 | case TEMPLATE_PARM_INDEX: |
3901 | if (TEMPLATE_PARM_PARAMETER_PACK (t)(((tree_not_check2 (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3901, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3901, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) |
3902 | parameter_pack_p = true; |
3903 | break; |
3904 | |
3905 | case TEMPLATE_TYPE_PARM: |
3906 | t = TYPE_MAIN_VARIANT (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3906, __FUNCTION__))->type_common.main_variant); |
3907 | /* FALLTHRU */ |
3908 | case TEMPLATE_TEMPLATE_PARM: |
3909 | /* If the placeholder appears in the decl-specifier-seq of a function |
3910 | parameter pack (14.6.3), or the type-specifier-seq of a type-id that |
3911 | is a pack expansion, the invented template parameter is a template |
3912 | parameter pack. */ |
3913 | if (ppd->type_pack_expansion_p && is_auto (t)) |
3914 | TEMPLATE_TYPE_PARAMETER_PACK (t)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3 (((t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3914, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3914, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3914, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3914, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0))) = true; |
3915 | if (TEMPLATE_TYPE_PARAMETER_PACK (t)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3 (((t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3915, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM ), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3915, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3915, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3915, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0)))) |
3916 | parameter_pack_p = true; |
3917 | break; |
3918 | |
3919 | case FIELD_DECL: |
3920 | case PARM_DECL: |
3921 | if (DECL_PACK_P (t)((tree_code_type[(int) (((enum tree_code) (t)->base.code)) ] == tcc_declaration) && (((enum tree_code) (((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3921, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION || ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3921, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION ))) |
3922 | { |
3923 | /* We don't want to walk into the type of a PARM_DECL, |
3924 | because we don't want to see the type parameter pack. */ |
3925 | *walk_subtrees = 0; |
3926 | parameter_pack_p = true; |
3927 | } |
3928 | break; |
3929 | |
3930 | case VAR_DECL: |
3931 | if (DECL_PACK_P (t)((tree_code_type[(int) (((enum tree_code) (t)->base.code)) ] == tcc_declaration) && (((enum tree_code) (((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3931, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION || ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3931, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION ))) |
3932 | { |
3933 | /* We don't want to walk into the type of a variadic capture proxy, |
3934 | because we don't want to see the type parameter pack. */ |
3935 | *walk_subtrees = 0; |
3936 | parameter_pack_p = true; |
3937 | } |
3938 | else if (variable_template_specialization_p (t)) |
3939 | { |
3940 | cp_walk_tree (&DECL_TI_ARGS (t),walk_tree_1 (&((struct tree_template_info*)(tree_check (( (((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
3941 | find_parameter_packs_r,walk_tree_1 (&((struct tree_template_info*)(tree_check (( (((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
3942 | ppd, ppd->visited)walk_tree_1 (&((struct tree_template_info*)(tree_check (( (((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__))->decl_common.lang_specific) ->u. min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3940, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
3943 | *walk_subtrees = 0; |
3944 | } |
3945 | break; |
3946 | |
3947 | case CALL_EXPR: |
3948 | if (builtin_pack_call_p (t)) |
3949 | parameter_pack_p = true; |
3950 | break; |
3951 | |
3952 | case BASES: |
3953 | parameter_pack_p = true; |
3954 | break; |
3955 | default: |
3956 | /* Not a parameter pack. */ |
3957 | break; |
3958 | } |
3959 | |
3960 | if (parameter_pack_p) |
3961 | { |
3962 | /* Add this parameter pack to the list. */ |
3963 | *ppd->parameter_packs = tree_cons (NULL_TREE(tree) __null, t, *ppd->parameter_packs); |
3964 | } |
3965 | |
3966 | if (TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))] == tcc_type)) |
3967 | cp_walk_tree (&TYPE_CONTEXT (t),walk_tree_1 (&((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3967, __FUNCTION__))->type_common.context), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
3968 | &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3967, __FUNCTION__))->type_common.context), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
3969 | |
3970 | /* This switch statement will return immediately if we don't find a |
3971 | parameter pack. ??? Should some of these be in cp_walk_subtrees? */ |
3972 | switch (TREE_CODE (t)((enum tree_code) (t)->base.code)) |
3973 | { |
3974 | case BOUND_TEMPLATE_TEMPLATE_PARM: |
3975 | /* Check the template itself. */ |
3976 | cp_walk_tree (&TREE_TYPE (TYPE_TI_TEMPLATE (t)),walk_tree_1 (&((contains_struct_check (((((struct tree_template_info *)(tree_check (((((enum tree_code) (t)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (t)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t)->base.code) == RECORD_TYPE || ( (enum tree_code) (t)->base.code) == UNION_TYPE || ((enum tree_code ) (t)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3976, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3976, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3976, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
3977 | &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((contains_struct_check (((((struct tree_template_info *)(tree_check (((((enum tree_code) (t)->base.code) == ENUMERAL_TYPE || ((enum tree_code) (t)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM || (((enum tree_code) (t)->base.code) == RECORD_TYPE || ( (enum tree_code) (t)->base.code) == UNION_TYPE || ((enum tree_code ) (t)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3976, __FUNCTION__))->type_non_common.lang_1) : (tree) __null )), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3976, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)), (TS_TYPED ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3976, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
3978 | return NULL_TREE(tree) __null; |
3979 | |
3980 | case DECL_EXPR: |
3981 | { |
3982 | tree decl = DECL_EXPR_DECL (t)(*((const_cast<tree*> (tree_operand_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3982, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3982, __FUNCTION__))))); |
3983 | /* Ignore the declaration of a capture proxy for a parameter pack. */ |
3984 | if (is_capture_proxy (decl)) |
3985 | *walk_subtrees = 0; |
3986 | if (is_typedef_decl (decl)) |
3987 | /* Since we stop at typedefs above, we need to look through them at |
3988 | the point of the DECL_EXPR. */ |
3989 | cp_walk_tree (&DECL_ORIGINAL_TYPE (decl),walk_tree_1 (&((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3989, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result ), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees ) |
3990 | &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3989, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result ), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees ); |
3991 | return NULL_TREE(tree) __null; |
3992 | } |
3993 | |
3994 | case TEMPLATE_DECL: |
3995 | if (!DECL_TEMPLATE_TEMPLATE_PARM_P (t)(((enum tree_code) (t)->base.code) == TEMPLATE_DECL && (((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3995, __FUNCTION__))->decl_common.lang_flag_0) && (((enum tree_code) (t)->base.code) == CONST_DECL || ((enum tree_code) (t)->base.code) == PARM_DECL || ((enum tree_code ) (t)->base.code) == TYPE_DECL || ((enum tree_code) (t)-> base.code) == TEMPLATE_DECL)))) |
3996 | return NULL_TREE(tree) __null; |
3997 | cp_walk_tree (&TREE_TYPE (t),walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3997, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
3998 | &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 3997, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
3999 | return NULL_TREE(tree) __null; |
4000 | |
4001 | case TYPE_PACK_EXPANSION: |
4002 | case EXPR_PACK_EXPANSION: |
4003 | *walk_subtrees = 0; |
4004 | return NULL_TREE(tree) __null; |
4005 | |
4006 | case INTEGER_TYPE: |
4007 | cp_walk_tree (&TYPE_MAX_VALUE (t), &find_parameter_packs_r,walk_tree_1 (&((tree_check5 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4007, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees ) |
4008 | ppd, ppd->visited)walk_tree_1 (&((tree_check5 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4007, __FUNCTION__, (INTEGER_TYPE), (ENUMERAL_TYPE), (BOOLEAN_TYPE ), (REAL_TYPE), (FIXED_POINT_TYPE)))->type_non_common.maxval ), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees ); |
4009 | *walk_subtrees = 0; |
4010 | return NULL_TREE(tree) __null; |
4011 | |
4012 | case IDENTIFIER_NODE: |
4013 | cp_walk_tree (&TREE_TYPE (t), &find_parameter_packs_r, ppd,walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4013, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
4014 | ppd->visited)walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4013, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
4015 | *walk_subtrees = 0; |
4016 | return NULL_TREE(tree) __null; |
4017 | |
4018 | case LAMBDA_EXPR: |
4019 | { |
4020 | /* Since we defer implicit capture, look in the parms and body. */ |
4021 | tree fn = lambda_function (t); |
4022 | cp_walk_tree (&TREE_TYPE (fn), &find_parameter_packs_r, ppd,walk_tree_1 (&((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4022, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
4023 | ppd->visited)walk_tree_1 (&((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4022, __FUNCTION__))->typed.type), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
4024 | cp_walk_tree (&DECL_SAVED_TREE (fn), &find_parameter_packs_r, ppd,walk_tree_1 (&((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4024, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree ), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees ) |
4025 | ppd->visited)walk_tree_1 (&((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4024, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree ), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees ); |
4026 | return NULL_TREE(tree) __null; |
4027 | } |
4028 | |
4029 | case DECLTYPE_TYPE: |
4030 | { |
4031 | /* When traversing a DECLTYPE_TYPE_EXPR, we need to set |
4032 | type_pack_expansion_p to false so that any placeholders |
4033 | within the expression don't get marked as parameter packs. */ |
4034 | bool type_pack_expansion_p = ppd->type_pack_expansion_p; |
4035 | ppd->type_pack_expansion_p = false; |
4036 | cp_walk_tree (&DECLTYPE_TYPE_EXPR (t), &find_parameter_packs_r,walk_tree_1 (&(((tree_class_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4036, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4036, __FUNCTION__))->type_non_common.values)), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees) |
4037 | ppd, ppd->visited)walk_tree_1 (&(((tree_class_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4036, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4036, __FUNCTION__))->type_non_common.values)), &find_parameter_packs_r , ppd, ppd->visited, cp_walk_subtrees); |
4038 | ppd->type_pack_expansion_p = type_pack_expansion_p; |
4039 | *walk_subtrees = 0; |
4040 | return NULL_TREE(tree) __null; |
4041 | } |
4042 | |
4043 | case IF_STMT: |
4044 | cp_walk_tree (&IF_COND (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4044, __FUNCTION__, (IF_STMT)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4044, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd ->visited, cp_walk_subtrees) |
4045 | ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4044, __FUNCTION__, (IF_STMT)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4044, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd ->visited, cp_walk_subtrees); |
4046 | cp_walk_tree (&THEN_CLAUSE (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4046, __FUNCTION__, (IF_STMT)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4046, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd ->visited, cp_walk_subtrees) |
4047 | ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4046, __FUNCTION__, (IF_STMT)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4046, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd ->visited, cp_walk_subtrees); |
4048 | cp_walk_tree (&ELSE_CLAUSE (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4048, __FUNCTION__, (IF_STMT)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4048, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd ->visited, cp_walk_subtrees) |
4049 | ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4048, __FUNCTION__, (IF_STMT)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4048, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd ->visited, cp_walk_subtrees); |
4050 | /* Don't walk into IF_STMT_EXTRA_ARGS. */ |
4051 | *walk_subtrees = 0; |
4052 | return NULL_TREE(tree) __null; |
4053 | |
4054 | default: |
4055 | return NULL_TREE(tree) __null; |
4056 | } |
4057 | |
4058 | return NULL_TREE(tree) __null; |
4059 | } |
4060 | |
4061 | /* Determines if the expression or type T uses any parameter packs. */ |
4062 | tree |
4063 | uses_parameter_packs (tree t) |
4064 | { |
4065 | tree parameter_packs = NULL_TREE(tree) __null; |
4066 | struct find_parameter_pack_data ppd; |
4067 | ppd.parameter_packs = ¶meter_packs; |
4068 | ppd.visited = new hash_set<tree>; |
4069 | ppd.type_pack_expansion_p = false; |
4070 | cp_walk_tree (&t, &find_parameter_packs_r, &ppd, ppd.visited)walk_tree_1 (&t, &find_parameter_packs_r, &ppd, ppd .visited, cp_walk_subtrees); |
4071 | delete ppd.visited; |
4072 | return parameter_packs; |
4073 | } |
4074 | |
4075 | /* Turn ARG, which may be an expression, type, or a TREE_LIST |
4076 | representation a base-class initializer into a parameter pack |
4077 | expansion. If all goes well, the resulting node will be an |
4078 | EXPR_PACK_EXPANSION, TYPE_PACK_EXPANSION, or TREE_LIST, |
4079 | respectively. */ |
4080 | tree |
4081 | make_pack_expansion (tree arg, tsubst_flags_t complain) |
4082 | { |
4083 | tree result; |
4084 | tree parameter_packs = NULL_TREE(tree) __null; |
4085 | bool for_types = false; |
4086 | struct find_parameter_pack_data ppd; |
4087 | |
4088 | if (!arg || arg == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
4089 | return arg; |
4090 | |
4091 | if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TREE_LIST && TREE_PURPOSE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4091, __FUNCTION__, (TREE_LIST)))->list.purpose)) |
4092 | { |
4093 | /* A TREE_LIST with a non-null TREE_PURPOSE is for a base |
4094 | class initializer. In this case, the TREE_PURPOSE will be a |
4095 | _TYPE node (representing the base class expansion we're |
4096 | initializing) and the TREE_VALUE will be a TREE_LIST |
4097 | containing the initialization arguments. |
4098 | |
4099 | The resulting expansion looks somewhat different from most |
4100 | expansions. Rather than returning just one _EXPANSION, we |
4101 | return a TREE_LIST whose TREE_PURPOSE is a |
4102 | TYPE_PACK_EXPANSION containing the bases that will be |
4103 | initialized. The TREE_VALUE will be identical to the |
4104 | original TREE_VALUE, which is a list of arguments that will |
4105 | be passed to each base. We do not introduce any new pack |
4106 | expansion nodes into the TREE_VALUE (although it is possible |
4107 | that some already exist), because the TREE_PURPOSE and |
4108 | TREE_VALUE all need to be expanded together with the same |
4109 | _EXPANSION node. Note that the TYPE_PACK_EXPANSION in the |
4110 | resulting TREE_PURPOSE will mention the parameter packs in |
4111 | both the bases and the arguments to the bases. */ |
4112 | tree purpose; |
4113 | tree value; |
4114 | tree parameter_packs = NULL_TREE(tree) __null; |
4115 | |
4116 | /* Determine which parameter packs will be used by the base |
4117 | class expansion. */ |
4118 | ppd.visited = new hash_set<tree>; |
4119 | ppd.parameter_packs = ¶meter_packs; |
4120 | ppd.type_pack_expansion_p = false; |
4121 | gcc_assert (TYPE_P (TREE_PURPOSE (arg)))((void)(!((tree_code_type[(int) (((enum tree_code) (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4121, __FUNCTION__, (TREE_LIST)))->list.purpose))->base .code))] == tcc_type)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4121, __FUNCTION__), 0 : 0)); |
4122 | cp_walk_tree (&TREE_PURPOSE (arg), &find_parameter_packs_r,walk_tree_1 (&((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4122, __FUNCTION__, (TREE_LIST)))->list.purpose), &find_parameter_packs_r , &ppd, ppd.visited, cp_walk_subtrees) |
4123 | &ppd, ppd.visited)walk_tree_1 (&((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4122, __FUNCTION__, (TREE_LIST)))->list.purpose), &find_parameter_packs_r , &ppd, ppd.visited, cp_walk_subtrees); |
4124 | |
4125 | if (parameter_packs == NULL_TREE(tree) __null) |
4126 | { |
4127 | if (complain & tf_error) |
4128 | error ("base initializer expansion %qT contains no parameter packs", |
4129 | arg); |
4130 | delete ppd.visited; |
4131 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
4132 | } |
4133 | |
4134 | if (TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4134, __FUNCTION__, (TREE_LIST)))->list.value) != void_type_nodeglobal_trees[TI_VOID_TYPE]) |
4135 | { |
4136 | /* Collect the sets of parameter packs used in each of the |
4137 | initialization arguments. */ |
4138 | for (value = TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4138, __FUNCTION__, (TREE_LIST)))->list.value); value; value = TREE_CHAIN (value)((contains_struct_check ((value), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4138, __FUNCTION__))->common.chain)) |
4139 | { |
4140 | /* Determine which parameter packs will be expanded in this |
4141 | argument. */ |
4142 | cp_walk_tree (&TREE_VALUE (value), &find_parameter_packs_r,walk_tree_1 (&((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4142, __FUNCTION__, (TREE_LIST)))->list.value), &find_parameter_packs_r , &ppd, ppd.visited, cp_walk_subtrees) |
4143 | &ppd, ppd.visited)walk_tree_1 (&((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4142, __FUNCTION__, (TREE_LIST)))->list.value), &find_parameter_packs_r , &ppd, ppd.visited, cp_walk_subtrees); |
4144 | } |
4145 | } |
4146 | |
4147 | delete ppd.visited; |
4148 | |
4149 | /* Create the pack expansion type for the base type. */ |
4150 | purpose = cxx_make_type (TYPE_PACK_EXPANSION); |
4151 | SET_PACK_EXPANSION_PATTERN (purpose, TREE_PURPOSE (arg))if (((enum tree_code) (purpose)->base.code) == TYPE_PACK_EXPANSION ) ((contains_struct_check ((purpose), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4151, __FUNCTION__))->typed.type) = ((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4151, __FUNCTION__, (TREE_LIST)))->list.purpose); else ( *((const_cast<tree*> (tree_operand_check ((purpose), (0 ), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4151, __FUNCTION__))))) = ((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4151, __FUNCTION__, (TREE_LIST)))->list.purpose); |
4152 | PACK_EXPANSION_PARAMETER_PACKS (purpose)*(((enum tree_code) (purpose)->base.code) == EXPR_PACK_EXPANSION ? &(*((const_cast<tree*> (tree_operand_check ((purpose ), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4152, __FUNCTION__))))) : &((tree_class_check (((tree_check ((purpose), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4152, __FUNCTION__, (TYPE_PACK_EXPANSION)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4152, __FUNCTION__))->type_non_common.minval)) = parameter_packs; |
4153 | PACK_EXPANSION_LOCAL_P (purpose)((tree_not_check2 ((purpose), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4153, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = at_function_scope_p (); |
4154 | |
4155 | /* Just use structural equality for these TYPE_PACK_EXPANSIONS; |
4156 | they will rarely be compared to anything. */ |
4157 | SET_TYPE_STRUCTURAL_EQUALITY (purpose)(((tree_class_check ((purpose), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4157, __FUNCTION__))->type_common.canonical) = (tree) __null ); |
4158 | |
4159 | return tree_cons (purpose, TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4159, __FUNCTION__, (TREE_LIST)))->list.value), NULL_TREE(tree) __null); |
4160 | } |
4161 | |
4162 | if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code) )] == tcc_type) || TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL) |
4163 | for_types = true; |
4164 | |
4165 | /* Build the PACK_EXPANSION_* node. */ |
4166 | result = for_types |
4167 | ? cxx_make_type (TYPE_PACK_EXPANSION) |
4168 | : make_node (EXPR_PACK_EXPANSION); |
4169 | SET_PACK_EXPANSION_PATTERN (result, arg)if (((enum tree_code) (result)->base.code) == TYPE_PACK_EXPANSION ) ((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4169, __FUNCTION__))->typed.type) = arg; else (*((const_cast <tree*> (tree_operand_check ((result), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4169, __FUNCTION__))))) = arg; |
4170 | if (TREE_CODE (result)((enum tree_code) (result)->base.code) == EXPR_PACK_EXPANSION) |
4171 | { |
4172 | /* Propagate type and const-expression information. */ |
4173 | TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4173, __FUNCTION__))->typed.type) = TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4173, __FUNCTION__))->typed.type); |
4174 | TREE_CONSTANT (result)((non_type_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4174, __FUNCTION__))->base.constant_flag) = TREE_CONSTANT (arg)((non_type_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4174, __FUNCTION__))->base.constant_flag); |
4175 | /* Mark this read now, since the expansion might be length 0. */ |
4176 | mark_exp_read (arg); |
4177 | } |
4178 | else |
4179 | /* Just use structural equality for these TYPE_PACK_EXPANSIONS; |
4180 | they will rarely be compared to anything. */ |
4181 | SET_TYPE_STRUCTURAL_EQUALITY (result)(((tree_class_check ((result), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4181, __FUNCTION__))->type_common.canonical) = (tree) __null ); |
4182 | |
4183 | /* Determine which parameter packs will be expanded. */ |
4184 | ppd.parameter_packs = ¶meter_packs; |
4185 | ppd.visited = new hash_set<tree>; |
4186 | ppd.type_pack_expansion_p = TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code) )] == tcc_type); |
4187 | cp_walk_tree (&arg, &find_parameter_packs_r, &ppd, ppd.visited)walk_tree_1 (&arg, &find_parameter_packs_r, &ppd, ppd.visited, cp_walk_subtrees); |
4188 | delete ppd.visited; |
4189 | |
4190 | /* Make sure we found some parameter packs. */ |
4191 | if (parameter_packs == NULL_TREE(tree) __null) |
4192 | { |
4193 | if (complain & tf_error) |
4194 | { |
4195 | if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code) )] == tcc_type)) |
4196 | error ("expansion pattern %qT contains no parameter packs", arg); |
4197 | else |
4198 | error ("expansion pattern %qE contains no parameter packs", arg); |
4199 | } |
4200 | return error_mark_nodeglobal_trees[TI_ERROR_MARK]; |
4201 | } |
4202 | PACK_EXPANSION_PARAMETER_PACKS (result)*(((enum tree_code) (result)->base.code) == EXPR_PACK_EXPANSION ? &(*((const_cast<tree*> (tree_operand_check ((result ), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4202, __FUNCTION__))))) : &((tree_class_check (((tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4202, __FUNCTION__, (TYPE_PACK_EXPANSION)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4202, __FUNCTION__))->type_non_common.minval)) = parameter_packs; |
4203 | |
4204 | PACK_EXPANSION_LOCAL_P (result)((tree_not_check2 ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4204, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits .lang_flag_0) = at_function_scope_p (); |
4205 | |
4206 | return result; |
4207 | } |
4208 | |
4209 | /* Checks T for any "bare" parameter packs, which have not yet been |
4210 | expanded, and issues an error if any are found. This operation can |
4211 | only be done on full expressions or types (e.g., an expression |
4212 | statement, "if" condition, etc.), because we could have expressions like: |
4213 | |
4214 | foo(f(g(h(args)))...) |
4215 | |
4216 | where "args" is a parameter pack. check_for_bare_parameter_packs |
4217 | should not be called for the subexpressions args, h(args), |
4218 | g(h(args)), or f(g(h(args))), because we would produce erroneous |
4219 | error messages. |
4220 | |
4221 | Returns TRUE and emits an error if there were bare parameter packs, |
4222 | returns FALSE otherwise. */ |
4223 | bool |
4224 | check_for_bare_parameter_packs (tree t, location_t loc /* = UNKNOWN_LOCATION */) |
4225 | { |
4226 | tree parameter_packs = NULL_TREE(tree) __null; |
4227 | struct find_parameter_pack_data ppd; |
4228 | |
4229 | if (!processing_template_declscope_chain->x_processing_template_decl || !t || t == error_mark_nodeglobal_trees[TI_ERROR_MARK]) |
4230 | return false; |
4231 | |
4232 | if (TREE_CODE (t)((enum tree_code) (t)->base.code) == TYPE_DECL) |
4233 | t = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c" , 4233, __FUNCTION__))->typed.type); |
4234 | |
4235 | ppd.parameter_packs = ¶meter_packs; |
4236 | ppd.visited = new hash_set<tree>; |
4237 | ppd.type_pack_expansion_p = false; |
4238 | cp_walk_tree (&t, &find_parameter_packs_r, &ppd, ppd.visited)walk_tree_1 (&t, &find_parameter_packs_r, &ppd, ppd .visited, cp_walk_subtrees); |
4239 | delete ppd.visited; |
4240 | |