Bug Summary

File:build/gcc/cp/pt.cc
Warning:line 11353, column 12
Value stored to 'not_tmpl' during its initialization is never read

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-suse-linux -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name pt.cc -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model static -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -resource-dir /usr/lib64/clang/15.0.7 -D IN_GCC_FRONTEND -D IN_GCC -D HAVE_CONFIG_H -I . -I cp -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcpp/include -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libcody -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libdecnumber/bid -I ../libdecnumber -I /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/../libbacktrace -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13 -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/x86_64-suse-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../include/c++/13/backward -internal-isystem /usr/lib64/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-suse-linux/13/../../../../x86_64-suse-linux/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O2 -Wno-narrowing -Wwrite-strings -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fdeprecated-macro -fdebug-compilation-dir=/buildworker/marxinbox-gcc-clang-static-analyzer/objdir/gcc -ferror-limit 19 -fno-rtti -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -analyzer-output=plist-html -analyzer-config silence-checkers=core.NullDereference -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /buildworker/marxinbox-gcc-clang-static-analyzer/objdir/clang-static-analyzer/2023-03-27-141847-20772-1/report-rpK9pU.plist -x c++ /buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc
1/* Handle parameterized types (templates) for GNU -*- C++ -*-.
2 Copyright (C) 1992-2023 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
6This file is part of GCC.
7
8GCC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 3, or (at your option)
11any later version.
12
13GCC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along 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#define INCLUDE_ALGORITHM // for std::equal
31#include "system.h"
32#include "coretypes.h"
33#include "cp-tree.h"
34#include "timevar.h"
35#include "stringpool.h"
36#include "varasm.h"
37#include "attribs.h"
38#include "stor-layout.h"
39#include "intl.h"
40#include "c-family/c-objc.h"
41#include "cp-objcp-common.h"
42#include "toplev.h"
43#include "tree-iterator.h"
44#include "type-utils.h"
45#include "gimplify.h"
46#include "gcc-rich-location.h"
47#include "selftest.h"
48#include "target.h"
49
50/* The type of functions taking a tree, and some additional data, and
51 returning an int. */
52typedef int (*tree_fn_t) (tree, void*);
53
54/* The PENDING_TEMPLATES is a list of templates whose instantiations
55 have been deferred, either because their definitions were not yet
56 available, or because we were putting off doing the work. */
57struct GTY ((chain_next ("%h.next"))) pending_template
58{
59 struct pending_template *next;
60 struct tinst_level *tinst;
61};
62
63static GTY(()) struct pending_template *pending_templates;
64static GTY(()) struct pending_template *last_pending_template;
65
66int processing_template_parmlist;
67static int template_header_count;
68
69static vec<int> inline_parm_levels;
70
71static GTY(()) struct tinst_level *current_tinst_level;
72
73static 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. */
78static tree cur_stmt_expr;
79
80// -------------------------------------------------------------------------- //
81// Local Specialization Stack
82//
83// Implementation of the RAII helper for creating new local
84// specializations.
85local_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
96local_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. */
106static bool excessive_deduction_depth;
107
108struct spec_hasher : ggc_ptr_hash<spec_entry>
109{
110 static hashval_t hash (tree, tree);
111 static hashval_t hash (spec_entry *);
112 static bool equal (spec_entry *, spec_entry *);
113};
114
115/* The general template is not in these tables. */
116typedef hash_table<spec_hasher> spec_hash_table;
117static GTY (()) spec_hash_table *decl_specializations;
118static GTY (()) spec_hash_table *type_specializations;
119
120/* Contains canonical template parameter types. The vector is indexed by
121 the TEMPLATE_TYPE_IDX of the template parameter. Each element is a
122 TREE_LIST, whose TREE_VALUEs contain the canonical template
123 parameters of various types and levels. */
124static GTY(()) vec<tree, va_gc> *canonical_template_parms;
125
126#define UNIFY_ALLOW_NONE0 0
127#define UNIFY_ALLOW_MORE_CV_QUAL1 1
128#define UNIFY_ALLOW_LESS_CV_QUAL2 2
129#define UNIFY_ALLOW_DERIVED4 4
130#define UNIFY_ALLOW_INTEGER8 8
131#define UNIFY_ALLOW_OUTER_LEVEL16 16
132#define UNIFY_ALLOW_OUTER_MORE_CV_QUAL32 32
133#define UNIFY_ALLOW_OUTER_LESS_CV_QUAL64 64
134
135enum template_base_result {
136 tbr_incomplete_type,
137 tbr_ambiguous_baseclass,
138 tbr_success
139};
140
141static bool resolve_overloaded_unification (tree, tree, tree, tree,
142 unification_kind_t, int,
143 bool);
144static int try_one_overload (tree, tree, tree, tree, tree,
145 unification_kind_t, int, bool, bool);
146static int unify (tree, tree, tree, tree, int, bool);
147static void add_pending_template (tree);
148static tree reopen_tinst_level (struct tinst_level *);
149static tree tsubst_initializer_list (tree, tree);
150static tree get_partial_spec_bindings (tree, tree, tree);
151static void tsubst_enum (tree, tree, tree);
152static bool check_instantiated_args (tree, tree, tsubst_flags_t);
153static int check_non_deducible_conversion (tree, tree, unification_kind_t, int,
154 struct conversion **, bool);
155static int maybe_adjust_types_for_deduction (tree, unification_kind_t,
156 tree*, tree*, tree);
157static int type_unification_real (tree, tree, tree, const tree *,
158 unsigned int, int, unification_kind_t,
159 vec<deferred_access_check, va_gc> **,
160 bool);
161static void note_template_header (int);
162static tree convert_nontype_argument_function (tree, tree, tsubst_flags_t);
163static tree convert_nontype_argument (tree, tree, tsubst_flags_t);
164static tree convert_template_argument (tree, tree, tree,
165 tsubst_flags_t, int, tree);
166static tree for_each_template_parm (tree, tree_fn_t, void*,
167 hash_set<tree> *, bool, tree_fn_t = NULL__null);
168static tree expand_template_argument_pack (tree);
169static tree build_template_parm_index (int, int, int, tree, tree);
170static bool inline_needs_template_parms (tree, bool);
171static void push_inline_template_parms_recursive (tree, int);
172static tree reduce_template_parm_level (tree, tree, int, tree, tsubst_flags_t);
173static int mark_template_parm (tree, void *);
174static int template_parm_this_level_p (tree, void *);
175static tree tsubst_friend_function (tree, tree);
176static tree tsubst_friend_class (tree, tree);
177static int can_complete_type_without_circularity (tree);
178static tree get_bindings (tree, tree, tree, bool);
179static int template_decl_level (tree);
180static int check_cv_quals_for_unify (int, tree, tree);
181static int unify_pack_expansion (tree, tree, tree,
182 tree, unification_kind_t, bool, bool);
183static tree copy_template_args (tree);
184static tree tsubst_template_parms (tree, tree, tsubst_flags_t);
185static void tsubst_each_template_parm_constraints (tree, tree, tsubst_flags_t);
186tree most_specialized_partial_spec (tree, tsubst_flags_t);
187static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int);
188static tree tsubst_aggr_type_1 (tree, tree, tsubst_flags_t, tree, int);
189static tree tsubst_arg_types (tree, tree, tree, tsubst_flags_t, tree);
190static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree);
191static bool check_specialization_scope (void);
192static tree process_partial_specialization (tree);
193static enum template_base_result get_template_base (tree, tree, tree, tree,
194 bool , tree *);
195static tree try_class_unification (tree, tree, tree, tree, bool);
196static bool class_nttp_const_wrapper_p (tree t);
197static int coerce_template_template_parms (tree, tree, tsubst_flags_t,
198 tree, tree);
199static bool template_template_parm_bindings_ok_p (tree, tree);
200static void tsubst_default_arguments (tree, tsubst_flags_t);
201static tree for_each_template_parm_r (tree *, int *, void *);
202static tree copy_default_args_to_explicit_spec_1 (tree, tree);
203static void copy_default_args_to_explicit_spec (tree);
204static bool invalid_nontype_parm_type_p (tree, tsubst_flags_t);
205static bool dependent_template_arg_p (tree);
206static bool dependent_type_p_r (tree);
207static tree tsubst_copy (tree, tree, tsubst_flags_t, tree);
208static tree tsubst_decl (tree, tree, tsubst_flags_t);
209static tree tsubst_scope (tree, tree, tsubst_flags_t, tree);
210static void perform_instantiation_time_access_checks (tree, tree);
211static tree listify (tree);
212static tree listify_autos (tree, tree);
213static tree tsubst_template_parm (tree, tree, tsubst_flags_t);
214static tree instantiate_alias_template (tree, tree, tsubst_flags_t);
215static bool complex_alias_template_p (const_tree tmpl);
216static tree get_underlying_template (tree);
217static tree tsubst_attributes (tree, tree, tsubst_flags_t, tree);
218static tree canonicalize_expr_argument (tree, tsubst_flags_t);
219static tree make_argument_pack (tree);
220static tree enclosing_instantiation_of (tree tctx);
221static void instantiate_body (tree pattern, tree args, tree d, bool nested);
222static tree maybe_dependent_member_ref (tree, tree, tsubst_flags_t, tree);
223
224/* Make the current scope suitable for access checking when we are
225 processing T. T can be FUNCTION_DECL for instantiated function
226 template, VAR_DECL for static member variable, or TYPE_DECL for
227 for a class or alias template (needed by instantiate_decl). */
228
229void
230push_access_scope (tree t)
231{
232 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
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 233, __FUNCTION__), 0 : 0))
233 || 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
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 233, __FUNCTION__), 0 : 0))
;
234
235 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
(TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 235, __FUNCTION__); &lt->u.fn; })->context : (tree
) __null)
)
236 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
(TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 236, __FUNCTION__); &lt->u.fn; })->context : (tree
) __null)
);
237 else if (DECL_IMPLICIT_TYPEDEF_P (t)(((enum tree_code) (t)->base.code) == TYPE_DECL &&
((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 237, __FUNCTION__))->decl_common.lang_flag_2))
238 && CLASS_TYPE_P (TREE_TYPE (t))(((((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 238, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 238, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((t
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 238, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 238, __FUNCTION__))->type_common.lang_flag_5))
)
239 push_nested_class (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 239, __FUNCTION__))->typed.type)
);
240 else if (DECL_CLASS_SCOPE_P (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 240, __FUNCTION__))->decl_minimal.context) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 240, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
241 push_nested_class (DECL_CONTEXT (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 241, __FUNCTION__))->decl_minimal.context)
);
242 else if (deduction_guide_p (t) && DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 242, __FUNCTION__))->decl_common.artificial_flag)
)
243 /* An artificial deduction guide should have the same access as
244 the constructor. */
245 push_nested_class (TREE_TYPE (TREE_TYPE (t))((contains_struct_check ((((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 245, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 245, __FUNCTION__))->typed.type)
);
246 else
247 push_to_top_level ();
248
249 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FUNCTION_DECL)
250 {
251 vec_safe_push (saved_access_scope, current_function_decl);
252 current_function_decl = t;
253 }
254}
255
256/* Restore the scope set up by push_access_scope. T is the node we
257 are processing. */
258
259void
260pop_access_scope (tree t)
261{
262 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == FUNCTION_DECL)
263 current_function_decl = saved_access_scope->pop();
264
265 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
(TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 265, __FUNCTION__); &lt->u.fn; })->context : (tree
) __null)
266 || (DECL_IMPLICIT_TYPEDEF_P (t)(((enum tree_code) (t)->base.code) == TYPE_DECL &&
((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 266, __FUNCTION__))->decl_common.lang_flag_2))
267 && CLASS_TYPE_P (TREE_TYPE (t))(((((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 267, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 267, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((t
), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 267, __FUNCTION__))->typed.type)), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 267, __FUNCTION__))->type_common.lang_flag_5))
)
268 || DECL_CLASS_SCOPE_P (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 268, __FUNCTION__))->decl_minimal.context) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((t), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 268, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
269 || (deduction_guide_p (t) && DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 269, __FUNCTION__))->decl_common.artificial_flag)
))
270 pop_nested_class ();
271 else
272 pop_from_top_level ();
273}
274
275/* Do any processing required when DECL (a member template
276 declaration) is finished. Returns the TEMPLATE_DECL corresponding
277 to DECL, unless it is a specialization, in which case the DECL
278 itself is returned. */
279
280tree
281finish_member_template_decl (tree decl)
282{
283 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
284 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
285
286 gcc_assert (DECL_P (decl))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int
) (((enum tree_code) (decl)->base.code))] == tcc_declaration
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 286, __FUNCTION__), 0 : 0))
;
287
288 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == TYPE_DECL)
289 {
290 tree type;
291
292 type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 292, __FUNCTION__))->typed.type)
;
293 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
294 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
295 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) == TRAIT_TYPE || ((enum
tree_code) (type)->base.code) == DEPENDENT_OPERATOR_TYPE)
|| (((((enum tree_code) (type)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 295, __FUNCTION__))->type_common.lang_flag_5)))
296 && CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 296, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 296, __FUNCTION__))->type_non_common.lang_1))
297 && !CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 297, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
)
298 {
299 tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 299, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 299, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 299, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
300 check_member_template (tmpl);
301 return tmpl;
302 }
303 return NULL_TREE(tree) __null;
304 }
305 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL)
306 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 306, __FUNCTION__))->decl_minimal.locus)
,
307 "data member %qD cannot be a member template", decl);
308 else if (DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 308, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 308, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)
)
309 {
310 if (!DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 310, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
311 {
312 check_member_template (DECL_TI_TEMPLATE (decl)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 312, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 312, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 312, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
);
313 return DECL_TI_TEMPLATE (decl)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 313, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 313, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 313, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
314 }
315 else
316 return decl;
317 }
318 else
319 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 319, __FUNCTION__))->decl_minimal.locus)
,
320 "invalid member template declaration %qD", decl);
321
322 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
323}
324
325/* Create a template info node. */
326
327tree
328build_template_info (tree template_decl, tree template_args)
329{
330 tree result = make_node (TEMPLATE_INFO);
331 TI_TEMPLATE (result)((struct tree_template_info*)(tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 331, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
= template_decl;
332 TI_ARGS (result)((struct tree_template_info*)(tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 332, __FUNCTION__, (TEMPLATE_INFO))))->args
= template_args;
333 return result;
334}
335
336/* Return the template info node corresponding to T, whatever T is. */
337
338tree
339get_template_info (const_tree t)
340{
341 tree tinfo = NULL_TREE(tree) __null;
342
343 if (!t || t == error_mark_nodeglobal_trees[TI_ERROR_MARK])
344 return NULL__null;
345
346 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == NAMESPACE_DECL
347 || TREE_CODE (t)((enum tree_code) (t)->base.code) == PARM_DECL)
348 return NULL__null;
349
350 if (DECL_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (t)->base.code))] == tcc_declaration)
&& DECL_LANG_SPECIFIC (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 350, __FUNCTION__))->decl_common.lang_specific)
)
351 tinfo = DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 351, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 351, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)
;
352
353 if (!tinfo && DECL_IMPLICIT_TYPEDEF_P (t)(((enum tree_code) (t)->base.code) == TYPE_DECL &&
((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 353, __FUNCTION__))->decl_common.lang_flag_2))
)
354 t = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 354, __FUNCTION__))->typed.type)
;
355
356 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 356, __FUNCTION__))->type_common.lang_flag_5)) || ((enum
tree_code) (t)->base.code) == ENUMERAL_TYPE)
)
357 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 357, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)
;
358 else if (TREE_CODE (t)((enum tree_code) (t)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM)
359 tinfo = TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (t)(((tree_class_check (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 359, __FUNCTION__, (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 359, __FUNCTION__))->type_non_common.lang_1))
;
360
361 return tinfo;
362}
363
364/* Returns the template nesting level of the indicated class TYPE.
365
366 For example, in:
367 template <class T>
368 struct A
369 {
370 template <class U>
371 struct B {};
372 };
373
374 A<T>::B<U> has depth two, while A<T> has depth one.
375 Both A<T>::B<int> and A<int>::B<U> have depth one, if
376 they are instantiations, not specializations.
377
378 This function is guaranteed to return 0 if passed NULL_TREE so
379 that, for example, `template_class_depth (current_class_type)' is
380 always safe. */
381
382int
383template_class_depth (tree type)
384{
385 int depth;
386
387 for (depth = 0; type && TREE_CODE (type)((enum tree_code) (type)->base.code) != NAMESPACE_DECL; )
388 {
389 tree tinfo = get_template_info (type);
390
391 if (tinfo
392 && TREE_CODE (TI_TEMPLATE (tinfo))((enum tree_code) (((struct tree_template_info*)(tree_check (
(tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 392, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)->base.code
)
== TEMPLATE_DECL
393 && 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 393, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 393, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 393, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 393, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 393, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
394 && uses_template_parms (INNERMOST_TEMPLATE_ARGS (TI_ARGS (tinfo))(get_innermost_template_args ((((struct tree_template_info*)(
tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 394, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
))
395 ++depth;
396
397 if (DECL_P (type)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (type)->base.code))] == tcc_declaration)
)
398 {
399 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((type), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __FUNCTION__, (TEMPLATE_DECL))))))))->result : type
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __FUNCTION__, (TEMPLATE_DECL))))))))->result : type
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 399, __FUNCTION__); &lt->u.fn; })->context : (tree
) __null)
)
400 type = fctx;
401 else
402 type = CP_DECL_CONTEXT (type)(!(! (((contains_struct_check ((type), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 402, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((type), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 402, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((type)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 402, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
403 }
404 else if (LAMBDA_TYPE_P (type)(((enum tree_code) (type)->base.code) == RECORD_TYPE &&
((((tree_class_check ((((tree_class_check ((type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check ((type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name) && (tree_code_type_tmpl
<0>::tree_code_type[(int) (((enum tree_code) (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_common.name)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))
&& LAMBDA_TYPE_EXTRA_SCOPE (type)((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 404, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope))
)
405 type = LAMBDA_TYPE_EXTRA_SCOPE (type)((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 405, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 405, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope))
;
406 else
407 type = CP_TYPE_CONTEXT (type)(!(! (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 407, __FUNCTION__))->type_common.context)) || ((enum tree_code
) (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 407, __FUNCTION__))->type_common.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 407, __FUNCTION__))->type_common.context) : cp_global_trees
[CPTI_GLOBAL])
;
408 }
409
410 return depth;
411}
412
413/* Return TRUE if NODE instantiates a template that has arguments of
414 its own, be it directly a primary template or indirectly through a
415 partial specializations. */
416static bool
417instantiates_primary_template_p (tree node)
418{
419 tree tinfo = get_template_info (node);
420 if (!tinfo)
421 return false;
422
423 tree tmpl = TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 423, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
424 if (PRIMARY_TEMPLATE_P (tmpl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 424, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 424, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 424, __FUNCTION__))->typed.type))) == (tmpl))
)
425 return true;
426
427 if (!DECL_TEMPLATE_SPECIALIZATION (tmpl)((((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 427, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
428 return false;
429
430 /* So now we know we have a specialization, but it could be a full
431 or a partial specialization. To tell which, compare the depth of
432 its template arguments with those of its context. */
433
434 tree ctxt = DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 434, __FUNCTION__))->decl_minimal.context)
;
435 tree ctinfo = get_template_info (ctxt);
436 if (!ctinfo)
437 return true;
438
439 return (TMPL_ARGS_DEPTH (TI_ARGS (tinfo))((((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TEMPLATE_INFO))))->args) == (tree) __null
? 0 : (((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TEMPLATE_INFO))))->args && (
(tree_check ((((struct tree_template_info*)(tree_check ((tinfo
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TEMPLATE_INFO))))->args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TEMPLATE_INFO))))->args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 439, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
440 > TMPL_ARGS_DEPTH (TI_ARGS (ctinfo))((((struct tree_template_info*)(tree_check ((ctinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TEMPLATE_INFO))))->args) == (tree) __null
? 0 : (((struct tree_template_info*)(tree_check ((ctinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TEMPLATE_INFO))))->args && (
(tree_check ((((struct tree_template_info*)(tree_check ((ctinfo
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TEMPLATE_INFO))))->args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((ctinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((ctinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((((struct tree_template_info*)(tree_check ((ctinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TEMPLATE_INFO))))->args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 440, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
);
441}
442
443/* Subroutine of maybe_begin_member_template_processing.
444 Returns true if processing DECL needs us to push template parms. */
445
446static bool
447inline_needs_template_parms (tree decl, bool nsdmi)
448{
449 if (!decl || (!nsdmi && ! DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 449, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 449, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)
))
450 return false;
451
452 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)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 452, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 452, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 452, __FUNCTION__))))
453 > (current_template_depth(scope_chain->template_parms ? ((long) ((unsigned long) (*
tree_int_cst_elt_check ((((tree_check ((scope_chain->template_parms
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 453, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 453, __FUNCTION__)))) : 0)
+ DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 453, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
));
454}
455
456/* Subroutine of maybe_begin_member_template_processing.
457 Push the template parms in PARMS, starting from LEVELS steps into the
458 chain, and ending at the beginning, since template parms are listed
459 innermost first. */
460
461static void
462push_inline_template_parms_recursive (tree parmlist, int levels)
463{
464 tree parms = TREE_VALUE (parmlist)((tree_check ((parmlist), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 464, __FUNCTION__, (TREE_LIST)))->list.value)
;
465 int i;
466
467 if (levels > 1)
468 push_inline_template_parms_recursive (TREE_CHAIN (parmlist)((contains_struct_check ((parmlist), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 468, __FUNCTION__))->common.chain)
, levels - 1);
469
470 ++processing_template_declscope_chain->x_processing_template_decl;
471 current_template_parmsscope_chain->template_parms
472 = tree_cons (size_int (current_template_depth + 1)size_int_kind ((scope_chain->template_parms ? ((long) ((unsigned
long) (*tree_int_cst_elt_check ((((tree_check ((scope_chain->
template_parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 472, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 472, __FUNCTION__)))) : 0) + 1, stk_sizetype)
,
473 parms, current_template_parmsscope_chain->template_parms);
474 TEMPLATE_PARMS_CONSTRAINTS (current_template_parms)((contains_struct_check (((tree_check ((scope_chain->template_parms
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 474, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 474, __FUNCTION__))->typed.type)
475 = TEMPLATE_PARMS_CONSTRAINTS (parmlist)((contains_struct_check (((tree_check ((parmlist), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 475, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 475, __FUNCTION__))->typed.type)
;
476 TEMPLATE_PARMS_FOR_INLINE (current_template_parms)((tree_not_check2 ((scope_chain->template_parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 476, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
= 1;
477
478 begin_scope (TREE_VEC_LENGTH (parms)((tree_check ((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 478, __FUNCTION__, (TREE_VEC)))->base.u.length)
? sk_template_parms : sk_template_spec,
479 NULL__null);
480 for (i = 0; i < TREE_VEC_LENGTH (parms)((tree_check ((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 480, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
481 {
482 tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
((parms), (i), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 482, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 482, __FUNCTION__, (TREE_LIST)))->list.value)
;
483
484 if (error_operand_p (parm))
485 continue;
486
487 gcc_assert (DECL_P (parm))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int
) (((enum tree_code) (parm)->base.code))] == tcc_declaration
)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 487, __FUNCTION__), 0 : 0))
;
488
489 switch (TREE_CODE (parm)((enum tree_code) (parm)->base.code))
490 {
491 case TYPE_DECL:
492 case TEMPLATE_DECL:
493 pushdecl (parm);
494 break;
495
496 case PARM_DECL:
497 /* Push the CONST_DECL. */
498 pushdecl (TEMPLATE_PARM_DECL (DECL_INITIAL (parm))(((template_parm_index*)(tree_check ((((contains_struct_check
((parm), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 498, __FUNCTION__))->decl_common.initial)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 498, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->decl)
);
499 break;
500
501 default:
502 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 502, __FUNCTION__))
;
503 }
504 }
505}
506
507/* Restore the template parameter context for a member template, a
508 friend template defined in a class definition, or a non-template
509 member of template class. */
510
511void
512maybe_begin_member_template_processing (tree decl)
513{
514 tree parms;
515 int levels = 0;
516 bool nsdmi = TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL;
517
518 if (nsdmi)
519 {
520 tree ctx = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 520, __FUNCTION__))->decl_minimal.context)
;
521 decl = (CLASSTYPE_TEMPLATE_INFO (ctx)(((tree_class_check (((tree_check3 ((ctx), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 521, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 521, __FUNCTION__))->type_non_common.lang_1))
522 /* Disregard full specializations (c++/60999). */
523 && uses_template_parms (ctx)
524 ? CLASSTYPE_TI_TEMPLATE (ctx)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((ctx), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 524, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 524, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 524, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
: NULL_TREE(tree) __null);
525 }
526
527 if (inline_needs_template_parms (decl, nsdmi))
528 {
529 parms = DECL_TEMPLATE_PARMS (most_general_template (decl))((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((most_general_template (decl)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 529, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
;
530 levels = TMPL_PARMS_DEPTH (parms)((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 530, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 530, __FUNCTION__))))
- current_template_depth(scope_chain->template_parms ? ((long) ((unsigned long) (*
tree_int_cst_elt_check ((((tree_check ((scope_chain->template_parms
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 530, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 530, __FUNCTION__)))) : 0)
;
531
532 if (DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 532, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
533 {
534 --levels;
535 parms = TREE_CHAIN (parms)((contains_struct_check ((parms), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 535, __FUNCTION__))->common.chain)
;
536 }
537
538 push_inline_template_parms_recursive (parms, levels);
539 }
540
541 /* Remember how many levels of template parameters we pushed so that
542 we can pop them later. */
543 inline_parm_levels.safe_push (levels);
544}
545
546/* Undo the effects of maybe_begin_member_template_processing. */
547
548void
549maybe_end_member_template_processing (void)
550{
551 int i;
552 int last;
553
554 if (inline_parm_levels.length () == 0)
555 return;
556
557 last = inline_parm_levels.pop ();
558 for (i = 0; i < last; ++i)
559 {
560 --processing_template_declscope_chain->x_processing_template_decl;
561 current_template_parmsscope_chain->template_parms = TREE_CHAIN (current_template_parms)((contains_struct_check ((scope_chain->template_parms), (TS_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 561, __FUNCTION__))->common.chain)
;
562 poplevel (0, 0, 0);
563 }
564}
565
566/* Return a new template argument vector which contains all of ARGS,
567 but has as its innermost set of arguments the EXTRA_ARGS. */
568
569tree
570add_to_template_args (tree args, tree extra_args)
571{
572 tree new_args;
573 int extra_depth;
574 int i;
575 int j;
576
577 if (args == NULL_TREE(tree) __null || extra_args == error_mark_nodeglobal_trees[TI_ERROR_MARK])
578 return extra_args;
579
580 extra_depth = TMPL_ARGS_DEPTH (extra_args)((extra_args) == (tree) __null ? 0 : (extra_args && (
(tree_check ((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 580, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 580, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 580, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 580, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
581 new_args = make_tree_vec (TMPL_ARGS_DEPTH (args)((args) == (tree) __null ? 0 : (args && ((tree_check (
(args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 581, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 581, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 581, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 581, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
+ extra_depth);
582
583 for (i = 1; i <= TMPL_ARGS_DEPTH (args)((args) == (tree) __null ? 0 : (args && ((tree_check (
(args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 583, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 583, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 583, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 583, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
; ++i)
584 SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (args, i))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 584, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 584, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 584, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 584, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 584, __FUNCTION__))))) : (((void)(!((i) == 1) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 584, __FUNCTION__), 0 : 0)), (args)))))
;
585
586 for (j = 1; j <= extra_depth; ++j, ++i)
587 SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (extra_args, j))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 587, __FUNCTION__))))) = (((extra_args && ((tree_check
((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 587, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 587, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 587, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), ((j) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 587, __FUNCTION__))))) : (((void)(!((j) == 1) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 587, __FUNCTION__), 0 : 0)), (extra_args)))))
;
588
589 return new_args;
590}
591
592/* Like add_to_template_args, but only the outermost ARGS are added to
593 the EXTRA_ARGS. In particular, all but TMPL_ARGS_DEPTH
594 (EXTRA_ARGS) levels are added. This function is used to combine
595 the template arguments from a partial instantiation with the
596 template arguments used to attain the full instantiation from the
597 partial instantiation.
598
599 If ARGS is a TEMPLATE_DECL, use its parameters as args. */
600
601tree
602add_outermost_template_args (tree args, tree extra_args)
603{
604 tree new_args;
605
606 if (!args)
607 return extra_args;
608 if (TREE_CODE (args)((enum tree_code) (args)->base.code) == TEMPLATE_DECL)
609 {
610 tree ti = get_template_info (DECL_TEMPLATE_RESULT (args)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 610, __FUNCTION__, (TEMPLATE_DECL))))))))->result
);
611 args = TI_ARGS (ti)((struct tree_template_info*)(tree_check ((ti), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 611, __FUNCTION__, (TEMPLATE_INFO))))->args
;
612 }
613
614 /* If there are more levels of EXTRA_ARGS than there are ARGS,
615 something very fishy is going on. */
616 gcc_assert (TMPL_ARGS_DEPTH (args) >= TMPL_ARGS_DEPTH (extra_args))((void)(!(((args) == (tree) __null ? 0 : (args && ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) >=
((extra_args) == (tree) __null ? 0 : (extra_args && (
(tree_check ((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 616, __FUNCTION__), 0 : 0))
;
617
618 /* If *all* the new arguments will be the EXTRA_ARGS, just return
619 them. */
620 if (TMPL_ARGS_DEPTH (args)((args) == (tree) __null ? 0 : (args && ((tree_check (
(args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
== TMPL_ARGS_DEPTH (extra_args)((extra_args) == (tree) __null ? 0 : (extra_args && (
(tree_check ((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 620, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
)
621 return extra_args;
622
623 /* For the moment, we make ARGS look like it contains fewer levels. */
624 TREE_VEC_LENGTH (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 624, __FUNCTION__, (TREE_VEC)))->base.u.length)
-= TMPL_ARGS_DEPTH (extra_args)((extra_args) == (tree) __null ? 0 : (extra_args && (
(tree_check ((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 624, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 624, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 624, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 624, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
625
626 new_args = add_to_template_args (args, extra_args);
627
628 /* Now, we restore ARGS to its full dimensions. */
629 TREE_VEC_LENGTH (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 629, __FUNCTION__, (TREE_VEC)))->base.u.length)
+= TMPL_ARGS_DEPTH (extra_args)((extra_args) == (tree) __null ? 0 : (extra_args && (
(tree_check ((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 629, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 629, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 629, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 629, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
630
631 return new_args;
632}
633
634/* Return the N levels of innermost template arguments from the ARGS. */
635
636tree
637get_innermost_template_args (tree args, int n)
638{
639 tree new_args;
640 int extra_levels;
641 int i;
642
643 gcc_assert (n >= 0)((void)(!(n >= 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 643, __FUNCTION__), 0 : 0))
;
644
645 /* If N is 1, just return the innermost set of template arguments. */
646 if (n == 1)
647 return TMPL_ARGS_LEVEL (args, TMPL_ARGS_DEPTH (args))((args && ((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((((args) == (tree
) __null ? 0 : (args && ((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) - 1
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__))))) : (((void)(!((((args) == (tree) __null
? 0 : (args && ((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) ==
1) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 647, __FUNCTION__), 0 : 0)), (args)))
;
648
649 /* If we're not removing anything, just return the arguments we were
650 given. */
651 extra_levels = TMPL_ARGS_DEPTH (args)((args) == (tree) __null ? 0 : (args && ((tree_check (
(args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 651, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 651, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 651, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 651, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
- n;
652 gcc_assert (extra_levels >= 0)((void)(!(extra_levels >= 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 652, __FUNCTION__), 0 : 0))
;
653 if (extra_levels == 0)
654 return args;
655
656 /* Make a new set of arguments, not containing the outer arguments. */
657 new_args = make_tree_vec (n);
658 for (i = 1; i <= n; ++i)
659 SET_TMPL_ARGS_LEVEL (new_args, i,((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i + extra_levels
) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))) : (((void)(!((i + extra_levels) == 1
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__), 0 : 0)), (args)))))
660 TMPL_ARGS_LEVEL (args, i + extra_levels))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i + extra_levels
) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__))))) : (((void)(!((i + extra_levels) == 1
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 660, __FUNCTION__), 0 : 0)), (args)))))
;
661
662 return new_args;
663}
664
665/* The inverse of get_innermost_template_args: Return all but the innermost
666 EXTRA_LEVELS levels of template arguments from the ARGS. */
667
668static tree
669strip_innermost_template_args (tree args, int extra_levels)
670{
671 tree new_args;
672 int n = TMPL_ARGS_DEPTH (args)((args) == (tree) __null ? 0 : (args && ((tree_check (
(args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 672, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 672, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 672, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 672, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
- extra_levels;
673 int i;
674
675 gcc_assert (n >= 0)((void)(!(n >= 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 675, __FUNCTION__), 0 : 0))
;
676
677 /* If N is 1, just return the outermost set of template arguments. */
678 if (n == 1)
679 return TMPL_ARGS_LEVEL (args, 1)((args && ((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 679, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 679, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 679, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((1) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 679, __FUNCTION__))))) : (((void)(!((1) == 1) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 679, __FUNCTION__), 0 : 0)), (args)))
;
680
681 /* If we're not removing anything, just return the arguments we were
682 given. */
683 gcc_assert (extra_levels >= 0)((void)(!(extra_levels >= 0) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 683, __FUNCTION__), 0 : 0))
;
684 if (extra_levels == 0)
685 return args;
686
687 /* Make a new set of arguments, not containing the inner arguments. */
688 new_args = make_tree_vec (n);
689 for (i = 1; i <= n; ++i)
690 SET_TMPL_ARGS_LEVEL (new_args, i,((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))) : (((void)(!((i) == 1) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__), 0 : 0)), (args)))))
691 TMPL_ARGS_LEVEL (args, i))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i) - 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__))))) : (((void)(!((i) == 1) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 691, __FUNCTION__), 0 : 0)), (args)))))
;
692
693 return new_args;
694}
695
696/* We've got a template header coming up; push to a new level for storing
697 the parms. */
698
699void
700begin_template_parm_list (void)
701{
702 /* We use a non-tag-transparent scope here, which causes pushtag to
703 put tags in this scope, rather than in the enclosing class or
704 namespace scope. This is the right thing, since we want
705 TEMPLATE_DECLS, and not TYPE_DECLS for template classes. For a
706 global template class, push_template_decl handles putting the
707 TEMPLATE_DECL into top-level scope. For a nested template class,
708 e.g.:
709
710 template <class T> struct S1 {
711 template <class T> struct S2 {};
712 };
713
714 pushtag contains special code to insert the TEMPLATE_DECL for S2
715 at the right scope. */
716 begin_scope (sk_template_parms, NULL__null);
717 ++processing_template_declscope_chain->x_processing_template_decl;
718 ++processing_template_parmlist;
719 note_template_header (0);
720
721 /* Add a dummy parameter level while we process the parameter list. */
722 current_template_parmsscope_chain->template_parms
723 = tree_cons (size_int (current_template_depth + 1)size_int_kind ((scope_chain->template_parms ? ((long) ((unsigned
long) (*tree_int_cst_elt_check ((((tree_check ((scope_chain->
template_parms), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 723, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 723, __FUNCTION__)))) : 0) + 1, stk_sizetype)
,
724 make_tree_vec (0),
725 current_template_parmsscope_chain->template_parms);
726}
727
728/* This routine is called when a specialization is declared. If it is
729 invalid to declare a specialization here, an error is reported and
730 false is returned, otherwise this routine will return true. */
731
732static bool
733check_specialization_scope (void)
734{
735 tree scope = current_scope ();
736
737 /* [temp.expl.spec]
738
739 An explicit specialization shall be declared in the namespace of
740 which the template is a member, or, for member templates, in the
741 namespace of which the enclosing class or enclosing class
742 template is a member. An explicit specialization of a member
743 function, member class or static data member of a class template
744 shall be declared in the namespace of which the class template
745 is a member. */
746 if (scope && TREE_CODE (scope)((enum tree_code) (scope)->base.code) != NAMESPACE_DECL)
747 {
748 error ("explicit specialization in non-namespace scope %qD", scope);
749 return false;
750 }
751
752 /* [temp.expl.spec]
753
754 In an explicit specialization declaration for a member of a class
755 template or a member template that appears in namespace scope,
756 the member template and some of its enclosing class templates may
757 remain unspecialized, except that the declaration shall not
758 explicitly specialize a class member template if its enclosing
759 class templates are not explicitly specialized as well. */
760 if (current_template_parmsscope_chain->template_parms)
761 {
762 error ("enclosing class templates are not explicitly specialized");
763 return false;
764 }
765
766 return true;
767}
768
769/* We've just seen template <>. */
770
771bool
772begin_specialization (void)
773{
774 begin_scope (sk_template_spec, NULL__null);
775 note_template_header (1);
776 return check_specialization_scope ();
777}
778
779/* Called at then end of processing a declaration preceded by
780 template<>. */
781
782void
783end_specialization (void)
784{
785 finish_scope ();
786 reset_specialization ();
787}
788
789/* Any template <>'s that we have seen thus far are not referring to a
790 function specialization. */
791
792void
793reset_specialization (void)
794{
795 processing_specializationscope_chain->x_processing_specialization = 0;
796 template_header_count = 0;
797}
798
799/* We've just seen a template header. If SPECIALIZATION is nonzero,
800 it was of the form template <>. */
801
802static void
803note_template_header (int specialization)
804{
805 processing_specializationscope_chain->x_processing_specialization = specialization;
806 template_header_count++;
807}
808
809/* We're beginning an explicit instantiation. */
810
811void
812begin_explicit_instantiation (void)
813{
814 gcc_assert (!processing_explicit_instantiation)((void)(!(!scope_chain->x_processing_explicit_instantiation
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 814, __FUNCTION__), 0 : 0))
;
815 processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation = true;
816}
817
818
819void
820end_explicit_instantiation (void)
821{
822 gcc_assert (processing_explicit_instantiation)((void)(!(scope_chain->x_processing_explicit_instantiation
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 822, __FUNCTION__), 0 : 0))
;
823 processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation = false;
824}
825
826/* An explicit specialization or partial specialization of TMPL is being
827 declared. Check that the namespace in which the specialization is
828 occurring is permissible. Returns false iff it is invalid to
829 specialize TMPL in the current namespace. */
830
831static bool
832check_specialization_namespace (tree tmpl)
833{
834 tree tpl_ns = decl_namespace_context (tmpl);
835
836 /* [tmpl.expl.spec]
837
838 An explicit specialization shall be declared in a namespace enclosing the
839 specialized template. An explicit specialization whose declarator-id is
840 not qualified shall be declared in the nearest enclosing namespace of the
841 template, or, if the namespace is inline (7.3.1), any namespace from its
842 enclosing namespace set. */
843 if (current_scope() != DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 843, __FUNCTION__))->decl_minimal.context)
844 && !at_namespace_scope_p ())
845 {
846 error ("specialization of %qD must appear at namespace scope", tmpl);
847 return false;
848 }
849
850 if (is_nested_namespace (current_namespacescope_chain->old_namespace, tpl_ns, cxx_dialect < cxx11))
851 /* Same or enclosing namespace. */
852 return true;
853 else
854 {
855 auto_diagnostic_group d;
856 if (permerror (input_location,
857 "specialization of %qD in different namespace", tmpl))
858 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 858, __FUNCTION__))->decl_minimal.locus)
,
859 " from definition of %q#D", tmpl);
860 return false;
861 }
862}
863
864/* SPEC is an explicit instantiation. Check that it is valid to
865 perform this explicit instantiation in the current namespace. */
866
867static void
868check_explicit_instantiation_namespace (tree spec)
869{
870 tree ns;
871
872 /* DR 275: An explicit instantiation shall appear in an enclosing
873 namespace of its template. */
874 ns = decl_namespace_context (spec);
875 if (!is_nested_namespace (current_namespacescope_chain->old_namespace, ns))
876 permerror (input_location, "explicit instantiation of %qD in namespace %qD "
877 "(which does not enclose namespace %qD)",
878 spec, current_namespacescope_chain->old_namespace, ns);
879}
880
881/* Returns true if TYPE is a new partial specialization that needs to be
882 set up. This may also modify TYPE to point to the correct (new or
883 existing) constrained partial specialization. */
884
885static bool
886maybe_new_partial_specialization (tree& type)
887{
888 /* An implicit instantiation of an incomplete type implies
889 the definition of a new class template.
890
891 template<typename T>
892 struct S;
893
894 template<typename T>
895 struct S<T*>;
896
897 Here, S<T*> is an implicit instantiation of S whose type
898 is incomplete. */
899 if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 899, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 1)
&& !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 899, __FUNCTION__))->type_common.size) != (tree) __null)
)
900 return true;
901
902 /* It can also be the case that TYPE is a completed specialization.
903 Continuing the previous example, suppose we also declare:
904
905 template<typename T>
906 requires Integral<T>
907 struct S<T*>;
908
909 Here, S<T*> refers to the specialization S<T*> defined
910 above. However, we need to differentiate definitions because
911 we intend to define a new partial specialization. In this case,
912 we rely on the fact that the constraints are different for
913 this declaration than that above.
914
915 Note that we also get here for injected class names and
916 late-parsed template definitions. We must ensure that we
917 do not create new type declarations for those cases. */
918 if (flag_conceptsglobal_options.x_flag_concepts && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 918, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
)
919 {
920 tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 920, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 920, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 920, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
921 tree args = CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 921, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 921, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 921, __FUNCTION__, (TEMPLATE_INFO))))->args
;
922
923 /* If there are no template parameters, this cannot be a new
924 partial template specialization? */
925 if (!current_template_parmsscope_chain->template_parms)
926 return false;
927
928 /* The injected-class-name is not a new partial specialization. */
929 if (DECL_SELF_REFERENCE_P (TYPE_NAME (type))(((enum tree_code) (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 929, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check ((((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 929, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 929, __FUNCTION__))->decl_common.lang_flag_4))
)
930 return false;
931
932 /* If the constraints are not the same as those of the primary
933 then, we can probably create a new specialization. */
934 tree type_constr = current_template_constraints ();
935
936 if (type == TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 936, __FUNCTION__))->typed.type)
)
937 {
938 tree main_constr = get_constraints (tmpl);
939 if (equivalent_constraints (type_constr, main_constr))
940 return false;
941 }
942
943 /* Also, if there's a pre-existing specialization with matching
944 constraints, then this also isn't new. */
945 tree specs = DECL_TEMPLATE_SPECIALIZATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 945, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 945, __FUNCTION__))->decl_common.size)
;
946 while (specs)
947 {
948 tree spec_tmpl = TREE_VALUE (specs)((tree_check ((specs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 948, __FUNCTION__, (TREE_LIST)))->list.value)
;
949 tree spec_args = TREE_PURPOSE (specs)((tree_check ((specs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 949, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
950 tree spec_constr = get_constraints (spec_tmpl);
951 if (comp_template_args (args, spec_args)
952 && equivalent_constraints (type_constr, spec_constr))
953 {
954 type = TREE_TYPE (spec_tmpl)((contains_struct_check ((spec_tmpl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 954, __FUNCTION__))->typed.type)
;
955 return false;
956 }
957 specs = TREE_CHAIN (specs)((contains_struct_check ((specs), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 957, __FUNCTION__))->common.chain)
;
958 }
959
960 /* Create a new type node (and corresponding type decl)
961 for the newly declared specialization. */
962 tree t = make_class_type (TREE_CODE (type)((enum tree_code) (type)->base.code));
963 CLASSTYPE_DECLARED_CLASS (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 963, __FUNCTION__))->type_with_lang_specific.lang_specific
))->declared_class)
= CLASSTYPE_DECLARED_CLASS (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 963, __FUNCTION__))->type_with_lang_specific.lang_specific
))->declared_class)
;
964 SET_TYPE_TEMPLATE_INFO (t, build_template_info (tmpl, args))(((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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->type_common.lang_flag_5)) &&
!((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (t)->base.code))] == tcc_type) && ((tree_class_check
((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->type_common.name) && ((enum
tree_code) (((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check (((tree_check (
(((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->type_common.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->decl_common.lang_flag_6))) ? (((tree_class_check
((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->type_non_common.lang_1) = (build_template_info
(tmpl, args))) : ((((contains_struct_check ((template_info_decl_check
((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->type_common.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 964, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info) = (build_template_info (tmpl, args))))
;
965
966 /* We only need a separate type node for storing the definition of this
967 partial specialization; uses of S<T*> are unconstrained, so all are
968 equivalent. So keep TYPE_CANONICAL the same. */
969 TYPE_CANONICAL (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 969, __FUNCTION__))->type_common.canonical)
= TYPE_CANONICAL (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 969, __FUNCTION__))->type_common.canonical)
;
970
971 /* Build the corresponding type decl. */
972 tree d = create_implicit_typedef (DECL_NAME (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 972, __FUNCTION__))->decl_minimal.name)
, t);
973 DECL_CONTEXT (d)((contains_struct_check ((d), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 973, __FUNCTION__))->decl_minimal.context)
= TYPE_CONTEXT (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 973, __FUNCTION__))->type_common.context)
;
974 DECL_SOURCE_LOCATION (d)((contains_struct_check ((d), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 974, __FUNCTION__))->decl_minimal.locus)
= input_location;
975 TREE_PRIVATE (d)((d)->base.private_flag) = (current_access_specifierscope_chain->access_specifier == access_private_nodeglobal_trees[TI_PRIVATE]);
976 TREE_PROTECTED (d)((d)->base.protected_flag) = (current_access_specifierscope_chain->access_specifier == access_protected_nodeglobal_trees[TI_PROTECTED]);
977
978 set_instantiating_module (d);
979 DECL_MODULE_EXPORT_P (d)((tree_not_check2 ((d), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 979, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
= DECL_MODULE_EXPORT_P (tmpl)((tree_not_check2 ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 979, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
;
980
981 type = t;
982 return true;
983 }
984
985 return false;
986}
987
988/* The TYPE is being declared. If it is a template type, that means it
989 is a partial specialization. Do appropriate error-checking. */
990
991tree
992maybe_process_partial_specialization (tree type)
993{
994 tree context;
995
996 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
997 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
998
999 /* A lambda that appears in specialization context is not itself a
1000 specialization. */
1001 if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1001, __FUNCTION__))->type_common.lang_flag_5))
&& CLASSTYPE_LAMBDA_EXPR (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1001, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)
)
1002 return type;
1003
1004 /* An injected-class-name is not a specialization. */
1005 if (DECL_SELF_REFERENCE_P (TYPE_NAME (type))(((enum tree_code) (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1005, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check ((((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1005, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1005, __FUNCTION__))->decl_common.lang_flag_4))
)
1006 return type;
1007
1008 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM)
1009 {
1010 error ("name of class shadows template template parameter %qD",
1011 TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1011, __FUNCTION__))->type_common.name)
);
1012 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1013 }
1014
1015 context = TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1015, __FUNCTION__))->type_common.context)
;
1016
1017 if (TYPE_ALIAS_P (type)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (type)->base.code))] == tcc_type) && (
(tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1017, __FUNCTION__))->type_common.name) && ((enum
tree_code) (((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1017, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check (((tree_check (
(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1017, __FUNCTION__))->type_common.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1017, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1017, __FUNCTION__))->decl_common.lang_flag_6))
)
1018 {
1019 tree tinfo = TYPE_ALIAS_TEMPLATE_INFO (type)(((contains_struct_check ((((tree_class_check ((type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1019, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1019, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((template_info_decl_check ((((tree_class_check ((type), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1019, __FUNCTION__))->type_common.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1019, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1019, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) : (tree) __null)
;
1020
1021 if (tinfo && DECL_ALIAS_TEMPLATE_P (TI_TEMPLATE (tinfo))((((enum tree_code) (((struct tree_template_info*)(tree_check
((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1021, __FUNCTION__))->decl_common.artificial_flag))
)
1022 error ("specialization of alias template %qD",
1023 TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1023, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
);
1024 else
1025 error ("explicit specialization of non-template %qT", type);
1026 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1027 }
1028 else if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1028, __FUNCTION__))->type_common.lang_flag_5))
&& CLASSTYPE_USE_TEMPLATE (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1028, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
)
1029 {
1030 /* This is for ordinary explicit specialization and partial
1031 specialization of a template class such as:
1032
1033 template <> class C<int>;
1034
1035 or:
1036
1037 template <class T> class C<T*>;
1038
1039 Make sure that `C<int>' and `C<T*>' are implicit instantiations. */
1040
1041 if (maybe_new_partial_specialization (type))
1042 {
1043 if (!check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1043, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1043, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1043, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
)
1044 && !at_namespace_scope_p ())
1045 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1046 SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1046, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) = 2)
;
1047 DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type))((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1047, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1047, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1047, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1047, __FUNCTION__))->decl_minimal.locus)
= input_location;
1048 if (processing_template_declscope_chain->x_processing_template_decl)
1049 {
1050 tree decl = push_template_decl (TYPE_MAIN_DECL (type)((((contains_struct_check (((tree_class_check ((((tree_class_check
((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1050, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1050, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1050, __FUNCTION__))->common.chain)))
);
1051 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1052 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1053 return TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1053, __FUNCTION__))->typed.type)
;
1054 }
1055 }
1056 else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1056, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) & 1)
)
1057 error ("specialization of %qT after instantiation", type);
1058 else if (errorcount(global_dc)->diagnostic_count[(int) (DK_ERROR)] && !processing_specializationscope_chain->x_processing_specialization
1059 && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1059, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
1060 && !uses_template_parms (CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1060, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1060, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1060, __FUNCTION__, (TEMPLATE_INFO))))->args
))
1061 /* Trying to define a specialization either without a template<> header
1062 or in an inappropriate place. We've already given an error, so just
1063 bail now so we don't actually define the specialization. */
1064 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1065 }
1066 else if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1066, __FUNCTION__))->type_common.lang_flag_5))
1067 && !CLASSTYPE_USE_TEMPLATE (type)((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1067, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
1068 && CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1068, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1068, __FUNCTION__))->type_non_common.lang_1))
1069 && 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1069, __FUNCTION__))->type_common.lang_flag_5))
1070 && CLASSTYPE_TEMPLATE_INFO (context)(((tree_class_check (((tree_check3 ((context), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1070, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1070, __FUNCTION__))->type_non_common.lang_1))
)
1071 {
1072 /* This is for an explicit specialization of member class
1073 template according to [temp.expl.spec/18]:
1074
1075 template <> template <class U> class C<int>::D;
1076
1077 The context `C<int>' must be an implicit instantiation.
1078 Otherwise this is just a member class template declared
1079 earlier like:
1080
1081 template <> class C<int> { template <class U> class D; };
1082 template <> template <class U> class C<int>::D;
1083
1084 In the first case, `C<int>::D' is a specialization of `C<T>::D'
1085 while in the second case, `C<int>::D' is a primary template
1086 and `C<T>::D' may not exist. */
1087
1088 if (CLASSTYPE_IMPLICIT_INSTANTIATION (context)(((((tree_class_check ((context), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1088, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 1)
1089 && !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1089, __FUNCTION__))->type_common.size) != (tree) __null
)
)
1090 {
1091 tree t;
1092 tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1092, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1092, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1092, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
1093
1094 if (current_namespacescope_chain->old_namespace
1095 != decl_namespace_context (tmpl))
1096 {
1097 if (permerror (input_location,
1098 "specialization of %qD in different namespace",
1099 type))
1100 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1100, __FUNCTION__))->decl_minimal.locus)
,
1101 "from definition of %q#D", tmpl);
1102 }
1103
1104 /* Check for invalid specialization after instantiation:
1105
1106 template <> template <> class C<int>::D<int>;
1107 template <> template <class U> class C<int>::D; */
1108
1109 for (t = DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1109, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1109, __FUNCTION__))->decl_common.size_unit)
;
1110 t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1110, __FUNCTION__))->common.chain)
)
1111 {
1112 tree inst = TREE_VALUE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1112, __FUNCTION__, (TREE_LIST)))->list.value)
;
1113 if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)(((((tree_class_check ((inst), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1113, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
1114 || !COMPLETE_OR_OPEN_TYPE_P (inst)((((tree_class_check ((inst), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1114, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1114, __FUNCTION__))->type_common.lang_flag_5)) &&
((((tree_class_check ((inst), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1114, __FUNCTION__))->type_with_lang_specific.lang_specific
))->being_defined)))
)
1115 {
1116 /* We already have a full specialization of this partial
1117 instantiation, or a full specialization has been
1118 looked up but not instantiated. Reassign it to the
1119 new member specialization template. */
1120 spec_entry elt;
1121 spec_entry *entry;
1122
1123 elt.tmpl = most_general_template (tmpl);
1124 elt.args = CLASSTYPE_TI_ARGS (inst)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((inst), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1124, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1124, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1124, __FUNCTION__, (TEMPLATE_INFO))))->args
;
1125 elt.spec = inst;
1126
1127 type_specializations->remove_elt (&elt);
1128
1129 elt.tmpl = tmpl;
1130 CLASSTYPE_TI_ARGS (inst)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((inst), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1130, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1130, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1130, __FUNCTION__, (TEMPLATE_INFO))))->args
1131 = elt.args = INNERMOST_TEMPLATE_ARGS (elt.args)(get_innermost_template_args ((elt.args), 1));
1132
1133 spec_entry **slot
1134 = type_specializations->find_slot (&elt, INSERT);
1135 entry = ggc_alloc<spec_entry> ();
1136 *entry = elt;
1137 *slot = entry;
1138 }
1139 else
1140 /* But if we've had an implicit instantiation, that's a
1141 problem ([temp.expl.spec]/6). */
1142 error ("specialization %qT after instantiation %qT",
1143 type, inst);
1144 }
1145
1146 /* Mark TYPE as a specialization. And as a result, we only
1147 have one level of template argument for the innermost
1148 class template. */
1149 SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1149, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) = 2)
;
1150 DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type))((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1150, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1150, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1150, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1150, __FUNCTION__))->decl_minimal.locus)
= input_location;
1151 CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1151, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1151, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1151, __FUNCTION__, (TEMPLATE_INFO))))->args
1152 = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type))(get_innermost_template_args ((((struct tree_template_info*)(
tree_check (((((tree_class_check (((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1152, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1152, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1152, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
;
1153 }
1154 }
1155 else if (processing_specializationscope_chain->x_processing_specialization)
1156 {
1157 /* Someday C++0x may allow for enum template specialization. */
1158 if (cxx_dialect > cxx98 && TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE
1159 && 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1159, __FUNCTION__))->type_common.lang_flag_5))
&& CLASSTYPE_USE_TEMPLATE (context)((((tree_class_check ((context), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1159, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
)
1160 pedwarn (input_location, OPT_Wpedantic, "template specialization "
1161 "of %qD not allowed by ISO C++", type);
1162 else
1163 {
1164 error ("explicit specialization of non-template %qT", type);
1165 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1166 }
1167 }
1168
1169 return type;
1170}
1171
1172/* Make sure ARGS doesn't use any inappropriate typedefs; we should have
1173 gone through coerce_template_parms by now. */
1174
1175static void
1176verify_unstripped_args_1 (tree inner)
1177{
1178 for (int i = 0; i < TREE_VEC_LENGTH (inner)((tree_check ((inner), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1178, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
1179 {
1180 tree arg = TREE_VEC_ELT (inner, i)(*((const_cast<tree *> (tree_vec_elt_check ((inner), (i
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1180, __FUNCTION__)))))
;
1181 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL)
1182 /* OK */;
1183 else if (TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
)
1184 gcc_assert (strip_typedefs (arg, NULL) == arg)((void)(!(strip_typedefs (arg, __null) == arg) ? fancy_abort (
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1184, __FUNCTION__), 0 : 0))
;
1185 else if (ARGUMENT_PACK_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
|| ((enum tree_code) (arg)->base.code) == NONTYPE_ARGUMENT_PACK
)
)
1186 verify_unstripped_args_1 (ARGUMENT_PACK_ARGS (arg)(((enum tree_code) ((tree_check2 ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1186, __FUNCTION__, (TYPE_ARGUMENT_PACK), (NONTYPE_ARGUMENT_PACK
))))->base.code) == TYPE_ARGUMENT_PACK ? ((contains_struct_check
((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1186, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1186, __FUNCTION__))))))
);
1187 else if (strip_typedefs (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1187, __FUNCTION__))->typed.type)
, NULL__null) != TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1187, __FUNCTION__))->typed.type)
)
1188 /* Allow typedefs on the type of a non-type argument, since a
1189 parameter can have them. */;
1190 else
1191 gcc_assert (strip_typedefs_expr (arg, NULL) == arg)((void)(!(strip_typedefs_expr (arg, __null) == arg) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1191, __FUNCTION__), 0 : 0))
;
1192 }
1193}
1194
1195static void
1196verify_unstripped_args (tree args)
1197{
1198 ++processing_template_declscope_chain->x_processing_template_decl;
1199 if (!any_dependent_template_arguments_p (args))
1200 verify_unstripped_args_1 (INNERMOST_TEMPLATE_ARGS (args)(get_innermost_template_args ((args), 1)));
1201 --processing_template_declscope_chain->x_processing_template_decl;
1202}
1203
1204/* Retrieve the specialization (in the sense of [temp.spec] - a
1205 specialization is either an instantiation or an explicit
1206 specialization) of TMPL for the given template ARGS. If there is
1207 no such specialization, return NULL_TREE. The ARGS are a vector of
1208 arguments, or a vector of vectors of arguments, in the case of
1209 templates with more than one level of parameters.
1210
1211 If TMPL is a type template and CLASS_SPECIALIZATIONS_P is true,
1212 then we search for a partial specialization matching ARGS. This
1213 parameter is ignored if TMPL is not a class template.
1214
1215 We can also look up a FIELD_DECL, if it is a lambda capture pack; the
1216 result is a NONTYPE_ARGUMENT_PACK. */
1217
1218static tree
1219retrieve_specialization (tree tmpl, tree args, hashval_t hash)
1220{
1221 if (tmpl == NULL_TREE(tree) __null)
1222 return NULL_TREE(tree) __null;
1223
1224 if (args == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1225 return NULL_TREE(tree) __null;
1226
1227 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
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1228, __FUNCTION__), 0 : 0))
1228 || TREE_CODE (tmpl) == FIELD_DECL)((void)(!(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
|| ((enum tree_code) (tmpl)->base.code) == FIELD_DECL) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1228, __FUNCTION__), 0 : 0))
;
1229
1230 /* There should be as many levels of arguments as there are
1231 levels of parameters. */
1232 gcc_assert (TMPL_ARGS_DEPTH (args)((void)(!(((args) == (tree) __null ? 0 : (args && ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__), 0 : 0))
1233 == (TREE_CODE (tmpl) == TEMPLATE_DECL((void)(!(((args) == (tree) __null ? 0 : (args && ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__), 0 : 0))
1234 ? TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))((void)(!(((args) == (tree) __null ? 0 : (args && ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__), 0 : 0))
1235 : template_class_depth (DECL_CONTEXT (tmpl))))((void)(!(((args) == (tree) __null ? 0 : (args && ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1232, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1234, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1235, __FUNCTION__), 0 : 0))
;
1236
1237 if (flag_checkingglobal_options.x_flag_checking)
1238 verify_unstripped_args (args);
1239
1240 /* Lambda functions in templates aren't instantiated normally, but through
1241 tsubst_lambda_expr. */
1242 if (lambda_fn_in_template_p (tmpl))
1243 return NULL_TREE(tree) __null;
1244
1245 spec_entry elt;
1246 elt.tmpl = tmpl;
1247 elt.args = args;
1248 elt.spec = NULL_TREE(tree) __null;
1249
1250 spec_hash_table *specializations;
1251 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1251, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1251, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL) && (((enum tree_code) (((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1251, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL && ((contains_struct_check ((
((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1251, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1251, __FUNCTION__))->decl_common.lang_flag_2)))
)
1252 specializations = type_specializations;
1253 else
1254 specializations = decl_specializations;
1255
1256 if (hash == 0)
1257 hash = spec_hasher::hash (&elt);
1258 if (spec_entry *found = specializations->find_with_hash (&elt, hash))
1259 return found->spec;
1260
1261 return NULL_TREE(tree) __null;
1262}
1263
1264/* Like retrieve_specialization, but for local declarations. */
1265
1266tree
1267retrieve_local_specialization (tree tmpl)
1268{
1269 if (local_specializationsscope_chain->x_local_specializations == NULL__null)
1270 return NULL_TREE(tree) __null;
1271
1272 tree *slot = local_specializationsscope_chain->x_local_specializations->get (tmpl);
1273 return slot ? *slot : NULL_TREE(tree) __null;
1274}
1275
1276/* Returns nonzero iff DECL is a specialization of TMPL. */
1277
1278int
1279is_specialization_of (tree decl, tree tmpl)
1280{
1281 tree t;
1282
1283 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
1284 {
1285 for (t = decl;
1286 t != NULL_TREE(tree) __null;
1287 t = DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1287, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1287, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1287, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1287, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1287, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
: NULL_TREE(tree) __null)
1288 if (t == tmpl)
1289 return 1;
1290 }
1291 else
1292 {
1293 gcc_assert (TREE_CODE (decl) == TYPE_DECL)((void)(!(((enum tree_code) (decl)->base.code) == TYPE_DECL
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1293, __FUNCTION__), 0 : 0))
;
1294
1295 for (t = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1295, __FUNCTION__))->typed.type)
;
1296 t != NULL_TREE(tree) __null;
1297 t = CLASSTYPE_USE_TEMPLATE (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1297, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
1298 ? TREE_TYPE (CLASSTYPE_TI_TEMPLATE (t))((contains_struct_check ((((struct tree_template_info*)(tree_check
(((((tree_class_check (((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1298, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1298, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1298, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1298, __FUNCTION__))->typed.type)
: NULL_TREE(tree) __null)
1299 if (same_type_ignoring_top_level_qualifiers_p (t, TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1299, __FUNCTION__))->typed.type)
))
1300 return 1;
1301 }
1302
1303 return 0;
1304}
1305
1306/* Returns nonzero iff DECL is a specialization of friend declaration
1307 FRIEND_DECL according to [temp.friend]. */
1308
1309bool
1310is_specialization_of_friend (tree decl, tree friend_decl)
1311{
1312 bool need_template = true;
1313 int template_depth;
1314
1315 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
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1316, __FUNCTION__), 0 : 0))
1316 || TREE_CODE (decl) == TYPE_DECL)((void)(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL
|| ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1316, __FUNCTION__), 0 : 0))
;
1317
1318 /* For [temp.friend/6] when FRIEND_DECL is an ordinary member function
1319 of a template class, we want to check if DECL is a specialization
1320 if this. */
1321 if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) == FUNCTION_DECL
1322 && DECL_TEMPLATE_INFO (friend_decl)(((contains_struct_check ((template_info_decl_check ((friend_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1322, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1322, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
1323 && !DECL_USE_TEMPLATE (friend_decl)(((contains_struct_check ((friend_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1323, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
)
1324 {
1325 /* We want a TEMPLATE_DECL for `is_specialization_of'. */
1326 friend_decl = DECL_TI_TEMPLATE (friend_decl)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((friend_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1326, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1326, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1326, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
1327 need_template = false;
1328 }
1329 else if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) == TEMPLATE_DECL
1330 && !PRIMARY_TEMPLATE_P (friend_decl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((friend_decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1330, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1330, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1330, __FUNCTION__))->typed.type))) == (friend_decl))
)
1331 need_template = false;
1332
1333 /* There is nothing to do if this is not a template friend. */
1334 if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) != TEMPLATE_DECL)
1335 return false;
1336
1337 if (is_specialization_of (decl, friend_decl))
1338 return true;
1339
1340 /* [temp.friend/6]
1341 A member of a class template may be declared to be a friend of a
1342 non-template class. In this case, the corresponding member of
1343 every specialization of the class template is a friend of the
1344 class granting friendship.
1345
1346 For example, given a template friend declaration
1347
1348 template <class T> friend void A<T>::f();
1349
1350 the member function below is considered a friend
1351
1352 template <> struct A<int> {
1353 void f();
1354 };
1355
1356 For this type of template friend, TEMPLATE_DEPTH below will be
1357 nonzero. To determine if DECL is a friend of FRIEND, we first
1358 check if the enclosing class is a specialization of another. */
1359
1360 template_depth = template_class_depth (CP_DECL_CONTEXT (friend_decl)(!(! (((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1360, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1360, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((friend_decl
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1360, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
);
1361 if (template_depth
1362 && DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1362, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1362, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
1363 && is_specialization_of (TYPE_NAME (DECL_CONTEXT (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1363, __FUNCTION__))->decl_minimal.context)), (tcc_type)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1363, __FUNCTION__))->type_common.name)
,
1364 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
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1364, __FUNCTION__))->decl_minimal.context)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1364, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1364, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1364, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
))
1365 {
1366 /* Next, we check the members themselves. In order to handle
1367 a few tricky cases, such as when FRIEND_DECL's are
1368
1369 template <class T> friend void A<T>::g(T t);
1370 template <class T> template <T t> friend void A<T>::h();
1371
1372 and DECL's are
1373
1374 void A<int>::g(int);
1375 template <int> void A<int>::h();
1376
1377 we need to figure out ARGS, the template arguments from
1378 the context of DECL. This is required for template substitution
1379 of `T' in the function parameter of `g' and template parameter
1380 of `h' in the above examples. Here ARGS corresponds to `int'. */
1381
1382 tree context = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1382, __FUNCTION__))->decl_minimal.context)
;
1383 tree args = NULL_TREE(tree) __null;
1384 int current_depth = 0;
1385
1386 while (current_depth < template_depth)
1387 {
1388 if (CLASSTYPE_TEMPLATE_INFO (context)(((tree_class_check (((tree_check3 ((context), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1388, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1388, __FUNCTION__))->type_non_common.lang_1))
)
1389 {
1390 if (current_depth == 0)
1391 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1391, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1391, __FUNCTION__, (TEMPLATE_INFO))))->args)
;
1392 else
1393 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1393, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1393, __FUNCTION__, (TEMPLATE_INFO))))->args)
, args);
1394 current_depth++;
1395 }
1396 context = TYPE_CONTEXT (context)((tree_class_check ((context), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1396, __FUNCTION__))->type_common.context)
;
1397 }
1398
1399 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
1400 {
1401 bool is_template;
1402 tree friend_type;
1403 tree decl_type;
1404 tree friend_args_type;
1405 tree decl_args_type;
1406
1407 /* Make sure that both DECL and FRIEND_DECL are templates or
1408 non-templates. */
1409 is_template = DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1409, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1409, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
1410 && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((contains_struct_check (
(template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1410, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
;
1411 if (need_template ^ is_template)
1412 return false;
1413 else if (is_template)
1414 {
1415 /* If both are templates, check template parameter list. */
1416 tree friend_parms
1417 = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_decl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((friend_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1417, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1418 args, tf_none);
1419 if (!comp_template_parms
1420 (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
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1420, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1420, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1420, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1420, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1421 friend_parms))
1422 return false;
1423
1424 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
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1424, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1424, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1424, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1424, __FUNCTION__))->typed.type)
;
1425 }
1426 else
1427 decl_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1427, __FUNCTION__))->typed.type)
;
1428
1429 friend_type = tsubst_function_type (TREE_TYPE (friend_decl)((contains_struct_check ((friend_decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1429, __FUNCTION__))->typed.type)
, args,
1430 tf_none, NULL_TREE(tree) __null);
1431 if (friend_type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1432 return false;
1433
1434 /* Check if return types match. */
1435 if (!same_type_p (TREE_TYPE (decl_type), TREE_TYPE (friend_type))comptypes ((((contains_struct_check ((decl_type), (TS_TYPED),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1435, __FUNCTION__))->typed.type)), (((contains_struct_check
((friend_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1435, __FUNCTION__))->typed.type)), 0)
)
1436 return false;
1437
1438 /* Check if function parameter types match, ignoring the
1439 `this' parameter. */
1440 friend_args_type = TYPE_ARG_TYPES (friend_type)((tree_check2 ((friend_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1440, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1441 decl_args_type = TYPE_ARG_TYPES (decl_type)((tree_check2 ((decl_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1441, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1442 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (friend_decl)(((enum tree_code) (((contains_struct_check ((friend_decl), (
TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1442, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
1443 friend_args_type = TREE_CHAIN (friend_args_type)((contains_struct_check ((friend_args_type), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1443, __FUNCTION__))->common.chain)
;
1444 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1444, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
1445 decl_args_type = TREE_CHAIN (decl_args_type)((contains_struct_check ((decl_args_type), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1445, __FUNCTION__))->common.chain)
;
1446
1447 return compparms (decl_args_type, friend_args_type);
1448 }
1449 else
1450 {
1451 /* DECL is a TYPE_DECL */
1452 bool is_template;
1453 tree decl_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1453, __FUNCTION__))->typed.type)
;
1454
1455 /* Make sure that both DECL and FRIEND_DECL are templates or
1456 non-templates. */
1457 is_template
1458 = CLASSTYPE_TEMPLATE_INFO (decl_type)(((tree_class_check (((tree_check3 ((decl_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1458, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1458, __FUNCTION__))->type_non_common.lang_1))
1459 && 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((decl_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1459, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
;
1460
1461 if (need_template ^ is_template)
1462 return false;
1463 else if (is_template)
1464 {
1465 tree friend_parms;
1466 /* If both are templates, check the name of the two
1467 TEMPLATE_DECL's first because is_friend didn't. */
1468 if (DECL_NAME (CLASSTYPE_TI_TEMPLATE (decl_type))((contains_struct_check ((((struct tree_template_info*)(tree_check
(((((tree_class_check (((tree_check3 ((decl_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1468, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1468, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1468, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1468, __FUNCTION__))->decl_minimal.name)
1469 != DECL_NAME (friend_decl)((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1469, __FUNCTION__))->decl_minimal.name)
)
1470 return false;
1471
1472 /* Now check template parameter list. */
1473 friend_parms
1474 = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_decl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((friend_decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1474, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1475 args, tf_none);
1476 return comp_template_parms
1477 (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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1477, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1477, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1477, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1477, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1478 friend_parms);
1479 }
1480 else
1481 return (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1481, __FUNCTION__))->decl_minimal.name)
1482 == DECL_NAME (friend_decl)((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1482, __FUNCTION__))->decl_minimal.name)
);
1483 }
1484 }
1485 return false;
1486}
1487
1488/* Register the specialization SPEC as a specialization of TMPL with
1489 the indicated ARGS. IS_FRIEND indicates whether the specialization
1490 is actually just a friend declaration. ATTRLIST is the list of
1491 attributes that the specialization is declared with or NULL when
1492 it isn't. Returns SPEC, or an equivalent prior declaration, if
1493 available.
1494
1495 We also store instantiations of field packs in the hash table, even
1496 though they are not themselves templates, to make lookup easier. */
1497
1498static tree
1499register_specialization (tree spec, tree tmpl, tree args, bool is_friend,
1500 hashval_t hash)
1501{
1502 tree fn;
1503
1504 gcc_assert ((TREE_CODE (tmpl) == TEMPLATE_DECL && DECL_P (spec))((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
&& (tree_code_type_tmpl <0>::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 ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1506, __FUNCTION__), 0 : 0))
1505 || (TREE_CODE (tmpl) == FIELD_DECL((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
&& (tree_code_type_tmpl <0>::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 ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1506, __FUNCTION__), 0 : 0))
1506 && TREE_CODE (spec) == NONTYPE_ARGUMENT_PACK))((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
&& (tree_code_type_tmpl <0>::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 ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1506, __FUNCTION__), 0 : 0))
;
1507
1508 if (TREE_CODE (spec)((enum tree_code) (spec)->base.code) == FUNCTION_DECL
1509 && uses_template_parms (DECL_TI_ARGS (spec)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((spec), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1509, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1509, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1509, __FUNCTION__, (TEMPLATE_INFO))))->args
))
1510 /* This is the FUNCTION_DECL for a partial instantiation. Don't
1511 register it; we want the corresponding TEMPLATE_DECL instead.
1512 We use `uses_template_parms (DECL_TI_ARGS (spec))' rather than
1513 the more obvious `uses_template_parms (spec)' to avoid problems
1514 with default function arguments. In particular, given
1515 something like this:
1516
1517 template <class T> void f(T t1, T t = T())
1518
1519 the default argument expression is not substituted for in an
1520 instantiation unless and until it is actually needed. */
1521 return spec;
1522
1523 spec_entry elt;
1524 elt.tmpl = tmpl;
1525 elt.args = args;
1526 elt.spec = spec;
1527
1528 if (hash == 0)
1529 hash = spec_hasher::hash (&elt);
1530
1531 spec_entry **slot = decl_specializations->find_slot_with_hash (&elt, hash, INSERT);
1532 if (*slot)
1533 fn = (*slot)->spec;
1534 else
1535 fn = NULL_TREE(tree) __null;
1536
1537 /* We can sometimes try to re-register a specialization that we've
1538 already got. In particular, regenerate_decl_from_template calls
1539 duplicate_decls which will update the specialization list. But,
1540 we'll still get called again here anyhow. It's more convenient
1541 to simply allow this than to try to prevent it. */
1542 if (fn == spec)
1543 return spec;
1544 else if (fn && DECL_TEMPLATE_SPECIALIZATION (spec)((((contains_struct_check ((spec), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1544, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
1545 {
1546 if (DECL_TEMPLATE_INSTANTIATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1546, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) & 1)
)
1547 {
1548 if (DECL_ODR_USED (fn)(((contains_struct_check (((tree_check2 ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1548, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1548, __FUNCTION__))->decl_common.lang_specific) ->u.
base.odr_used)
1549 || DECL_EXPLICIT_INSTANTIATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1549, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 3)
)
1550 {
1551 error ("specialization of %qD after instantiation",
1552 fn);
1553 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1554 }
1555 else
1556 {
1557 tree clone;
1558 /* This situation should occur only if the first
1559 specialization is an implicit instantiation, the
1560 second is an explicit specialization, and the
1561 implicit instantiation has not yet been used. That
1562 situation can occur if we have implicitly
1563 instantiated a member function and then specialized
1564 it later.
1565
1566 We can also wind up here if a friend declaration that
1567 looked like an instantiation turns out to be a
1568 specialization:
1569
1570 template <class T> void foo(T);
1571 class S { friend void foo<>(int) };
1572 template <> void foo(int);
1573
1574 We transform the existing DECL in place so that any
1575 pointers to it become pointers to the updated
1576 declaration.
1577
1578 If there was a definition for the template, but not
1579 for the specialization, we want this to look as if
1580 there were no definition, and vice versa. */
1581 DECL_INITIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1581, __FUNCTION__))->decl_common.initial)
= NULL_TREE(tree) __null;
1582 duplicate_decls (spec, fn, /*hiding=*/is_friend);
1583
1584 /* The call to duplicate_decls will have applied
1585 [temp.expl.spec]:
1586
1587 An explicit specialization of a function template
1588 is inline only if it is explicitly declared to be,
1589 and independently of whether its function template
1590 is.
1591
1592 to the primary function; now copy the inline bits to
1593 the various clones. */
1594 FOR_EACH_CLONE (clone, fn)if (!(((enum tree_code) (fn)->base.code) == FUNCTION_DECL &&
((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((fn), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ; else for (clone = (((contains_struct_check
(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->common.chain)); clone && (
((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((clone
), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check ((clone)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((clone),
(TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER]))); clone = (((contains_struct_check (
((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1594, __FUNCTION__))->common.chain)))
1595 {
1596 DECL_DECLARED_INLINE_P (clone)((tree_check ((clone), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1596, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
1597 = DECL_DECLARED_INLINE_P (fn)((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1597, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
;
1598 DECL_SOURCE_LOCATION (clone)((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1598, __FUNCTION__))->decl_minimal.locus)
1599 = DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1599, __FUNCTION__))->decl_minimal.locus)
;
1600 DECL_DELETED_FN (clone)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (clone)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((clone), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1600, __FUNCTION__, (TEMPLATE_DECL))))))))->result : clone
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1600, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (clone)->base.code) == FUNCTION_DECL || (
((enum tree_code) (clone)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((clone), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1600, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((clone
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1600, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1600, __FUNCTION__); &lt->u.fn; })->min.base.threadprivate_or_deleted_p
)
1601 = DECL_DELETED_FN (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1601, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1601, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1601, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1601, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1601, __FUNCTION__); &lt->u.fn; })->min.base.threadprivate_or_deleted_p
)
;
1602 }
1603 check_specialization_namespace (tmpl);
1604
1605 return fn;
1606 }
1607 }
1608 else if (DECL_TEMPLATE_SPECIALIZATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1608, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
1609 {
1610 tree dd = duplicate_decls (spec, fn, /*hiding=*/is_friend);
1611 if (dd == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1612 /* We've already complained in duplicate_decls. */
1613 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1614
1615 if (dd == NULL_TREE(tree) __null && DECL_INITIAL (spec)((contains_struct_check ((spec), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1615, __FUNCTION__))->decl_common.initial)
)
1616 /* Dup decl failed, but this is a new definition. Set the
1617 line number so any errors match this new
1618 definition. */
1619 DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1619, __FUNCTION__))->decl_minimal.locus)
= DECL_SOURCE_LOCATION (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1619, __FUNCTION__))->decl_minimal.locus)
;
1620
1621 return fn;
1622 }
1623 }
1624 else if (fn)
1625 return duplicate_decls (spec, fn, /*hiding=*/is_friend);
1626
1627 /* A specialization must be declared in the same namespace as the
1628 template it is specializing. */
1629 if (DECL_P (spec)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (spec)->base.code))] == tcc_declaration)
&& DECL_TEMPLATE_SPECIALIZATION (spec)((((contains_struct_check ((spec), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1629, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
1630 && !check_specialization_namespace (tmpl))
1631 DECL_CONTEXT (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1631, __FUNCTION__))->decl_minimal.context)
= DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1631, __FUNCTION__))->decl_minimal.context)
;
1632
1633 spec_entry *entry = ggc_alloc<spec_entry> ();
1634 gcc_assert (tmpl && args && spec)((void)(!(tmpl && args && spec) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1634, __FUNCTION__), 0 : 0))
;
1635 *entry = elt;
1636 *slot = entry;
1637 if ((TREE_CODE (spec)((enum tree_code) (spec)->base.code) == FUNCTION_DECL && DECL_NAMESPACE_SCOPE_P (spec)(!(((contains_struct_check ((spec), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1637, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1637, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1637, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((spec)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1637, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
1638 && PRIMARY_TEMPLATE_P (tmpl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1638, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1638, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1638, __FUNCTION__))->typed.type))) == (tmpl))
1639 && DECL_SAVED_TREE (DECL_TEMPLATE_RESULT (tmpl))((tree_check ((((struct tree_template_decl *)(const_cast<union
tree_node *> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1639, __FUNCTION__, (TEMPLATE_DECL))))))))->result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1639, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
)
== NULL_TREE(tree) __null)
1640 || variable_template_p (tmpl))
1641 /* If TMPL is a forward declaration of a template function, keep a list
1642 of all specializations in case we need to reassign them to a friend
1643 template later in tsubst_friend_function.
1644
1645 Also keep a list of all variable template instantiations so that
1646 process_partial_specialization can check whether a later partial
1647 specialization would have used it. */
1648 DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1648, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1648, __FUNCTION__))->decl_common.size_unit)
1649 = tree_cons (args, spec, DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1649, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1649, __FUNCTION__))->decl_common.size_unit)
);
1650
1651 return spec;
1652}
1653
1654/* Restricts tree and type comparisons. */
1655int comparing_specializations;
1656int comparing_dependent_aliases;
1657
1658/* Returns true iff two spec_entry nodes are equivalent. */
1659
1660bool
1661spec_hasher::equal (spec_entry *e1, spec_entry *e2)
1662{
1663 int equal;
1664
1665 ++comparing_specializations;
1666 ++comparing_dependent_aliases;
1667 ++processing_template_declscope_chain->x_processing_template_decl;
1668 equal = (e1->tmpl == e2->tmpl
1669 && comp_template_args (e1->args, e2->args));
1670 if (equal && flag_conceptsglobal_options.x_flag_concepts
1671 /* tmpl could be a FIELD_DECL for a capture pack. */
1672 && TREE_CODE (e1->tmpl)((enum tree_code) (e1->tmpl)->base.code) == TEMPLATE_DECL
1673 && VAR_P (DECL_TEMPLATE_RESULT (e1->tmpl))(((enum tree_code) (((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((e1->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1673, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == VAR_DECL)
1674 && uses_template_parms (e1->args))
1675 {
1676 /* Partial specializations of a variable template can be distinguished by
1677 constraints. */
1678 tree c1 = e1->spec ? get_constraints (e1->spec) : NULL_TREE(tree) __null;
1679 tree c2 = e2->spec ? get_constraints (e2->spec) : NULL_TREE(tree) __null;
1680 equal = equivalent_constraints (c1, c2);
1681 }
1682 --processing_template_declscope_chain->x_processing_template_decl;
1683 --comparing_dependent_aliases;
1684 --comparing_specializations;
1685
1686 return equal;
1687}
1688
1689/* Returns a hash for a template TMPL and template arguments ARGS. */
1690
1691static hashval_t
1692hash_tmpl_and_args (tree tmpl, tree args)
1693{
1694 hashval_t val = iterative_hash_object (DECL_UID (tmpl), 0)iterative_hash (&((contains_struct_check ((tmpl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1694, __FUNCTION__))->decl_minimal.uid), sizeof (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1694, __FUNCTION__))->decl_minimal.uid)), 0)
;
1695 return iterative_hash_template_arg (args, val);
1696}
1697
1698hashval_t
1699spec_hasher::hash (tree tmpl, tree args)
1700{
1701 ++comparing_specializations;
1702 hashval_t val = hash_tmpl_and_args (tmpl, args);
1703 --comparing_specializations;
1704 return val;
1705}
1706
1707/* Returns a hash for a spec_entry node based on the TMPL and ARGS members,
1708 ignoring SPEC. */
1709
1710hashval_t
1711spec_hasher::hash (spec_entry *e)
1712{
1713 return spec_hasher::hash (e->tmpl, e->args);
1714}
1715
1716/* Recursively calculate a hash value for a template argument ARG, for use
1717 in the hash tables of template specializations. We must be
1718 careful to (at least) skip the same entities template_args_equal
1719 does. */
1720
1721hashval_t
1722iterative_hash_template_arg (tree arg, hashval_t val)
1723{
1724 if (arg == NULL_TREE(tree) __null)
1725 return iterative_hash_object (arg, val)iterative_hash (&arg, sizeof (arg), val);
1726
1727 if (!TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
)
1728 /* Strip nop-like things, but not the same as STRIP_NOPS. */
1729 while (CONVERT_EXPR_P (arg)((((enum tree_code) (arg)->base.code)) == NOP_EXPR || (((enum
tree_code) (arg)->base.code)) == CONVERT_EXPR)
1730 || TREE_CODE (arg)((enum tree_code) (arg)->base.code) == NON_LVALUE_EXPR
1731 || class_nttp_const_wrapper_p (arg))
1732 arg = TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1732, __FUNCTION__)))))
;
1733
1734 enum tree_code code = TREE_CODE (arg)((enum tree_code) (arg)->base.code);
1735
1736 val = iterative_hash_object (code, val)iterative_hash (&code, sizeof (code), val);
1737
1738 switch (code)
1739 {
1740 case ARGUMENT_PACK_SELECT:
1741 /* Getting here with an ARGUMENT_PACK_SELECT means we're probably
1742 preserving it in a hash table, which is bad because it will change
1743 meaning when gen_elem_of_pack_expansion_instantiation changes the
1744 ARGUMENT_PACK_SELECT_INDEX. */
1745 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1745, __FUNCTION__))
;
1746
1747 case ERROR_MARK:
1748 return val;
1749
1750 case IDENTIFIER_NODE:
1751 return iterative_hash_object (IDENTIFIER_HASH_VALUE (arg), val)iterative_hash (&((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1751, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
), sizeof (((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1751, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)), val)
;
1752
1753 case TREE_VEC:
1754 for (tree elt : tree_vec_range (arg))
1755 val = iterative_hash_template_arg (elt, val);
1756 return val;
1757
1758 case TYPE_PACK_EXPANSION:
1759 case EXPR_PACK_EXPANSION:
1760 val = iterative_hash_template_arg (PACK_EXPANSION_PATTERN (arg)(((enum tree_code) ((tree_check2 ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1760, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check
((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1760, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1760, __FUNCTION__))))))
, val);
1761 return iterative_hash_template_arg (PACK_EXPANSION_EXTRA_ARGS (arg)*(((enum tree_code) ((tree_check2 ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1761, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == TYPE_PACK_EXPANSION ? &((tree_class_check
((arg), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1761, __FUNCTION__))->type_non_common.maxval) : &(*(
(const_cast<tree*> (tree_operand_check (((arg)), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1761, __FUNCTION__))))))
, val);
1762
1763 case TYPE_ARGUMENT_PACK:
1764 case NONTYPE_ARGUMENT_PACK:
1765 return iterative_hash_template_arg (ARGUMENT_PACK_ARGS (arg)(((enum tree_code) ((tree_check2 ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1765, __FUNCTION__, (TYPE_ARGUMENT_PACK), (NONTYPE_ARGUMENT_PACK
))))->base.code) == TYPE_ARGUMENT_PACK ? ((contains_struct_check
((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1765, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1765, __FUNCTION__))))))
, val);
1766
1767 case TREE_LIST:
1768 for (; arg; arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1768, __FUNCTION__))->common.chain)
)
1769 val = iterative_hash_template_arg (TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1769, __FUNCTION__, (TREE_LIST)))->list.value)
, val);
1770 return val;
1771
1772 case OVERLOAD:
1773 for (lkp_iterator iter (arg); iter; ++iter)
1774 val = iterative_hash_template_arg (*iter, val);
1775 return val;
1776
1777 case CONSTRUCTOR:
1778 {
1779 iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1779, __FUNCTION__))->typed.type)
, val);
1780 for (auto &e: CONSTRUCTOR_ELTS (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1780, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
)
1781 {
1782 val = iterative_hash_template_arg (e.index, val);
1783 val = iterative_hash_template_arg (e.value, val);
1784 }
1785 return val;
1786 }
1787
1788 case PARM_DECL:
1789 if (!DECL_ARTIFICIAL (arg)((contains_struct_check ((arg), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1789, __FUNCTION__))->decl_common.artificial_flag)
)
1790 {
1791 val = iterative_hash_object (DECL_PARM_INDEX (arg), val)iterative_hash (&(__extension__ ({ struct lang_decl *lt =
((contains_struct_check ((arg), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1791, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1791, __FUNCTION__); &lt->u.parm; })->index), sizeof
((__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((arg), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1791, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1791, __FUNCTION__); &lt->u.parm; })->index)), val
)
;
1792 val = iterative_hash_object (DECL_PARM_LEVEL (arg), val)iterative_hash (&(__extension__ ({ struct lang_decl *lt =
((contains_struct_check ((arg), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1792, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1792, __FUNCTION__); &lt->u.parm; })->level), sizeof
((__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((arg), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1792, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1792, __FUNCTION__); &lt->u.parm; })->level)), val
)
;
1793 }
1794 return iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1794, __FUNCTION__))->typed.type)
, val);
1795
1796 case TARGET_EXPR:
1797 return iterative_hash_template_arg (TARGET_EXPR_INITIAL (arg)(*(tree_operand_check_code ((arg), (TARGET_EXPR), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1797, __FUNCTION__)))
, val);
1798
1799 case PTRMEM_CST:
1800 val = iterative_hash_template_arg (PTRMEM_CST_CLASS (arg)((((enum tree_code) (((contains_struct_check (((tree_check ((
arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__))->typed.type))->base.code) == OFFSET_TYPE
) ? ((tree_check ((((contains_struct_check (((tree_check ((arg
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type
(((contains_struct_check ((((tree_check3 ((((contains_struct_check
(((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__))->typed.type), cp_type_quals (((contains_struct_check
(((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__))->typed.type))))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1800, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
, val);
1801 return iterative_hash_template_arg (PTRMEM_CST_MEMBER (arg)(((ptrmem_cst_t)(tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1801, __FUNCTION__, (PTRMEM_CST))))->member)
, val);
1802
1803 case TEMPLATE_PARM_INDEX:
1804 val = iterative_hash_template_arg
1805 (TREE_TYPE (TEMPLATE_PARM_DECL (arg))((contains_struct_check (((((template_parm_index*)(tree_check
((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1805, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->decl)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1805, __FUNCTION__))->typed.type)
, val);
1806 val = iterative_hash_object (TEMPLATE_PARM_LEVEL (arg), val)iterative_hash (&(((template_parm_index*)(tree_check ((arg
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1806, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level), sizeof
((((template_parm_index*)(tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1806, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)), val
)
;
1807 return iterative_hash_object (TEMPLATE_PARM_IDX (arg), val)iterative_hash (&(((template_parm_index*)(tree_check ((arg
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1807, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index), sizeof
((((template_parm_index*)(tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1807, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)), val
)
;
1808
1809 case TRAIT_EXPR:
1810 val = iterative_hash_object (TRAIT_EXPR_KIND (arg), val)iterative_hash (&(((struct tree_trait_expr *)(tree_check (
(arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1810, __FUNCTION__, (TRAIT_EXPR))))->kind), sizeof ((((struct
tree_trait_expr *)(tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1810, __FUNCTION__, (TRAIT_EXPR))))->kind)), val)
;
1811 val = iterative_hash_template_arg (TRAIT_EXPR_TYPE1 (arg)(((struct tree_trait_expr *)(tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1811, __FUNCTION__, (TRAIT_EXPR))))->type1)
, val);
1812 return iterative_hash_template_arg (TRAIT_EXPR_TYPE2 (arg)(((struct tree_trait_expr *)(tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1812, __FUNCTION__, (TRAIT_EXPR))))->type2)
, val);
1813
1814 case BASELINK:
1815 val = iterative_hash_template_arg (BINFO_TYPE (BASELINK_BINFO (arg))((contains_struct_check (((tree_check (((((struct tree_baselink
*) (tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1815, __FUNCTION__, (BASELINK))))->binfo)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1815, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1815, __FUNCTION__))->typed.type)
,
1816 val);
1817 return iterative_hash_template_arg (DECL_NAME (get_first_fn (arg))((contains_struct_check ((get_first_fn (arg)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1817, __FUNCTION__))->decl_minimal.name)
,
1818 val);
1819
1820 case MODOP_EXPR:
1821 val = iterative_hash_template_arg (TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1821, __FUNCTION__)))))
, val);
1822 code = TREE_CODE (TREE_OPERAND (arg, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((arg), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1822, __FUNCTION__))))))->base.code)
;
1823 val = iterative_hash_object (code, val)iterative_hash (&code, sizeof (code), val);
1824 return iterative_hash_template_arg (TREE_OPERAND (arg, 2)(*((const_cast<tree*> (tree_operand_check ((arg), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1824, __FUNCTION__)))))
, val);
1825
1826 case LAMBDA_EXPR:
1827 /* [temp.over.link] Two lambda-expressions are never considered
1828 equivalent.
1829
1830 So just hash the closure type. */
1831 return iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1831, __FUNCTION__))->typed.type)
, val);
1832
1833 case CAST_EXPR:
1834 case IMPLICIT_CONV_EXPR:
1835 case STATIC_CAST_EXPR:
1836 case REINTERPRET_CAST_EXPR:
1837 case CONST_CAST_EXPR:
1838 case DYNAMIC_CAST_EXPR:
1839 case NEW_EXPR:
1840 val = iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1840, __FUNCTION__))->typed.type)
, val);
1841 /* Now hash operands as usual. */
1842 break;
1843
1844 case CALL_EXPR:
1845 {
1846 tree fn = CALL_EXPR_FN (arg)(*((const_cast<tree*> (tree_operand_check (((tree_check
((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1846, __FUNCTION__, (CALL_EXPR)))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1846, __FUNCTION__)))))
;
1847 if (tree name = call_expr_dependent_name (arg))
1848 {
1849 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_ID_EXPR)
1850 val = iterative_hash_template_arg (TREE_OPERAND (fn, 1)(*((const_cast<tree*> (tree_operand_check ((fn), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1850, __FUNCTION__)))))
, val);
1851 fn = name;
1852 }
1853 val = iterative_hash_template_arg (fn, val);
1854 call_expr_arg_iterator ai;
1855 for (tree x = first_call_expr_arg (arg, &ai); x;
1856 x = next_call_expr_arg (&ai))
1857 val = iterative_hash_template_arg (x, val);
1858 return val;
1859 }
1860
1861 default:
1862 break;
1863 }
1864
1865 char tclass = TREE_CODE_CLASS (code)tree_code_type_tmpl <0>::tree_code_type[(int) (code)];
1866 switch (tclass)
1867 {
1868 case tcc_type:
1869 if (tree ats = alias_template_specialization_p (arg, nt_transparent))
1870 {
1871 // We want an alias specialization that survived strip_typedefs
1872 // to hash differently from its TYPE_CANONICAL, to avoid hash
1873 // collisions that compare as different in template_args_equal.
1874 // These could be dependent specializations that strip_typedefs
1875 // left alone, or untouched specializations because
1876 // coerce_template_parms returns the unconverted template
1877 // arguments if it sees incomplete argument packs.
1878 tree ti = TYPE_ALIAS_TEMPLATE_INFO (ats)(((contains_struct_check ((((tree_class_check ((ats), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1878, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1878, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((template_info_decl_check ((((tree_class_check ((ats), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1878, __FUNCTION__))->type_common.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1878, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1878, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) : (tree) __null)
;
1879 return hash_tmpl_and_args (TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1879, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
, TI_ARGS (ti)((struct tree_template_info*)(tree_check ((ti), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1879, __FUNCTION__, (TEMPLATE_INFO))))->args
);
1880 }
1881
1882 switch (TREE_CODE (arg)((enum tree_code) (arg)->base.code))
1883 {
1884 case TEMPLATE_TEMPLATE_PARM:
1885 {
1886 tree tpi = TEMPLATE_TYPE_PARM_INDEX (arg)(((tree_class_check (((tree_check3 (((arg)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1886, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1886, __FUNCTION__))->type_non_common.values))
;
1887
1888 /* Do not recurse with TPI directly, as that is unbounded
1889 recursion. */
1890 val = iterative_hash_object (TEMPLATE_PARM_LEVEL (tpi), val)iterative_hash (&(((template_parm_index*)(tree_check ((tpi
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1890, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level), sizeof
((((template_parm_index*)(tree_check ((tpi), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1890, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)), val
)
;
1891 val = iterative_hash_object (TEMPLATE_PARM_IDX (tpi), val)iterative_hash (&(((template_parm_index*)(tree_check ((tpi
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1891, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index), sizeof
((((template_parm_index*)(tree_check ((tpi), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1891, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)), val
)
;
1892 }
1893 break;
1894
1895 case DECLTYPE_TYPE:
1896 val = iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg)(((tree_class_check (((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1896, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1896, __FUNCTION__))->type_non_common.values))
, val);
1897 break;
1898
1899 case TYPENAME_TYPE:
1900 if (comparing_specializations)
1901 {
1902 /* Hash the components that are relevant to TYPENAME_TYPE
1903 equivalence as determined by structural_comptypes. We
1904 can only coherently do this when comparing_specializations
1905 is set, because otherwise structural_comptypes tries
1906 resolving TYPENAME_TYPE via the current instantiation. */
1907 tree context = TYPE_MAIN_VARIANT (TYPE_CONTEXT (arg))((tree_class_check ((((tree_class_check ((arg), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1907, __FUNCTION__))->type_common.context)), (tcc_type),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1907, __FUNCTION__))->type_common.main_variant)
;
1908 tree fullname = TYPENAME_TYPE_FULLNAME (arg)(((tree_class_check (((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1908, __FUNCTION__, (TYPENAME_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1908, __FUNCTION__))->type_non_common.values))
;
1909 val = iterative_hash_template_arg (context, val);
1910 val = iterative_hash_template_arg (fullname, val);
1911 }
1912 break;
1913
1914 default:
1915 if (tree canonical = TYPE_CANONICAL (arg)((tree_class_check ((arg), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1915, __FUNCTION__))->type_common.canonical)
)
1916 val = iterative_hash_object (TYPE_HASH (canonical), val)iterative_hash (&(((tree_class_check ((canonical), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1916, __FUNCTION__))->type_common.uid)), sizeof ((((tree_class_check
((canonical), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1916, __FUNCTION__))->type_common.uid))), val)
;
1917 break;
1918 }
1919
1920 return val;
1921
1922 case tcc_declaration:
1923 case tcc_constant:
1924 return iterative_hash_expr (arg, val);
1925
1926 default:
1927 gcc_assert (IS_EXPR_CODE_CLASS (tclass))((void)(!(((tclass) >= tcc_reference && (tclass) <=
tcc_expression)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1927, __FUNCTION__), 0 : 0))
;
1928 for (int i = 0, n = cp_tree_operand_length (arg); i < n; ++i)
1929 val = iterative_hash_template_arg (TREE_OPERAND (arg, i)(*((const_cast<tree*> (tree_operand_check ((arg), (i), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1929, __FUNCTION__)))))
, val);
1930 return val;
1931 }
1932}
1933
1934/* Unregister the specialization SPEC as a specialization of TMPL.
1935 Replace it with NEW_SPEC, if NEW_SPEC is non-NULL. Returns true
1936 if the SPEC was listed as a specialization of TMPL.
1937
1938 Note that SPEC has been ggc_freed, so we can't look inside it. */
1939
1940bool
1941reregister_specialization (tree spec, tree tinfo, tree new_spec)
1942{
1943 spec_entry *entry;
1944 spec_entry elt;
1945
1946 elt.tmpl = most_general_template (TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1946, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
);
1947 elt.args = TI_ARGS (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1947, __FUNCTION__, (TEMPLATE_INFO))))->args
;
1948 elt.spec = NULL_TREE(tree) __null;
1949
1950 entry = decl_specializations->find (&elt);
1951 if (entry != NULL__null)
1952 {
1953 gcc_assert (entry->spec == spec || entry->spec == new_spec)((void)(!(entry->spec == spec || entry->spec == new_spec
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1953, __FUNCTION__), 0 : 0))
;
1954 gcc_assert (new_spec != NULL_TREE)((void)(!(new_spec != (tree) __null) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1954, __FUNCTION__), 0 : 0))
;
1955 entry->spec = new_spec;
1956 return 1;
1957 }
1958
1959 return 0;
1960}
1961
1962/* Like register_specialization, but for local declarations. We are
1963 registering SPEC, an instantiation of TMPL. */
1964
1965void
1966register_local_specialization (tree spec, tree tmpl)
1967{
1968 gcc_assert (tmpl != spec)((void)(!(tmpl != spec) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1968, __FUNCTION__), 0 : 0))
;
1969 local_specializationsscope_chain->x_local_specializations->put (tmpl, spec);
1970}
1971
1972/* Registers T as a specialization of itself. This is used to preserve
1973 the references to already-parsed parameters when instantiating
1974 postconditions. */
1975
1976void
1977register_local_identity (tree t)
1978{
1979 local_specializationsscope_chain->x_local_specializations->put (t, t);
1980}
1981
1982/* TYPE is a class type. Returns true if TYPE is an explicitly
1983 specialized class. */
1984
1985bool
1986explicit_class_specialization_p (tree type)
1987{
1988 if (!CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1988, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
)
1989 return false;
1990 return !uses_template_parms (CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1990, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1990, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 1990, __FUNCTION__, (TEMPLATE_INFO))))->args
);
1991}
1992
1993/* Print the list of functions at FNS, going through all the overloads
1994 for each element of the list. Alternatively, FNS cannot be a
1995 TREE_LIST, in which case it will be printed together with all the
1996 overloads.
1997
1998 MORE and *STR should respectively be FALSE and NULL when the function
1999 is called from the outside. They are used internally on recursive
2000 calls. print_candidates manages the two parameters and leaves NULL
2001 in *STR when it ends. */
2002
2003static void
2004print_candidates_1 (tree fns, char **str, bool more = false)
2005{
2006 if (TREE_CODE (fns)((enum tree_code) (fns)->base.code) == TREE_LIST)
2007 for (; fns; fns = TREE_CHAIN (fns)((contains_struct_check ((fns), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2007, __FUNCTION__))->common.chain)
)
2008 print_candidates_1 (TREE_VALUE (fns)((tree_check ((fns), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2008, __FUNCTION__, (TREE_LIST)))->list.value)
, str, more || TREE_CHAIN (fns)((contains_struct_check ((fns), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2008, __FUNCTION__))->common.chain)
);
2009 else
2010 for (lkp_iterator iter (fns); iter;)
2011 {
2012 tree cand = *iter;
2013 ++iter;
2014
2015 const char *pfx = *str;
2016 if (!pfx)
2017 {
2018 if (more || iter)
2019 pfx = _("candidates are:")gettext ("candidates are:");
2020 else
2021 pfx = _("candidate is:")gettext ("candidate is:");
2022 *str = get_spaces (pfx);
2023 }
2024 inform (DECL_SOURCE_LOCATION (cand)((contains_struct_check ((cand), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2024, __FUNCTION__))->decl_minimal.locus)
, "%s %#qD", pfx, cand);
2025 }
2026}
2027
2028/* Print the list of candidate FNS in an error message. FNS can also
2029 be a TREE_LIST of non-functions in the case of an ambiguous lookup. */
2030
2031void
2032print_candidates (tree fns)
2033{
2034 char *str = NULL__null;
2035 print_candidates_1 (fns, &str);
2036 free (str);
2037}
2038
2039/* Get a (possibly) constrained template declaration for the
2040 purpose of ordering candidates. */
2041static tree
2042get_template_for_ordering (tree list)
2043{
2044 gcc_assert (TREE_CODE (list) == TREE_LIST)((void)(!(((enum tree_code) (list)->base.code) == TREE_LIST
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2044, __FUNCTION__), 0 : 0))
;
2045 tree f = TREE_VALUE (list)((tree_check ((list), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2045, __FUNCTION__, (TREE_LIST)))->list.value)
;
2046 if (tree ti = DECL_TEMPLATE_INFO (f)(((contains_struct_check ((template_info_decl_check ((f), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2046, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2046, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
)
2047 return TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2047, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
2048 return f;
2049}
2050
2051/* Among candidates having the same signature, return the
2052 most constrained or NULL_TREE if there is no best candidate.
2053 If the signatures of candidates vary (e.g., template
2054 specialization vs. member function), then there can be no
2055 most constrained.
2056
2057 Note that we don't compare constraints on the functions
2058 themselves, but rather those of their templates. */
2059static tree
2060most_constrained_function (tree candidates)
2061{
2062 // Try to find the best candidate in a first pass.
2063 tree champ = candidates;
2064 for (tree c = TREE_CHAIN (champ)((contains_struct_check ((champ), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2064, __FUNCTION__))->common.chain)
; c; c = TREE_CHAIN (c)((contains_struct_check ((c), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2064, __FUNCTION__))->common.chain)
)
2065 {
2066 int winner = more_constrained (get_template_for_ordering (champ),
2067 get_template_for_ordering (c));
2068 if (winner == -1)
2069 champ = c; // The candidate is more constrained
2070 else if (winner == 0)
2071 return NULL_TREE(tree) __null; // Neither is more constrained
2072 }
2073
2074 // Verify that the champ is better than previous candidates.
2075 for (tree c = candidates; c != champ; c = TREE_CHAIN (c)((contains_struct_check ((c), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2075, __FUNCTION__))->common.chain)
) {
2076 if (!more_constrained (get_template_for_ordering (champ),
2077 get_template_for_ordering (c)))
2078 return NULL_TREE(tree) __null;
2079 }
2080
2081 return champ;
2082}
2083
2084
2085/* Returns the template (one of the functions given by TEMPLATE_ID)
2086 which can be specialized to match the indicated DECL with the
2087 explicit template args given in TEMPLATE_ID. The DECL may be
2088 NULL_TREE if none is available. In that case, the functions in
2089 TEMPLATE_ID are non-members.
2090
2091 If NEED_MEMBER_TEMPLATE is nonzero the function is known to be a
2092 specialization of a member template.
2093
2094 The TEMPLATE_COUNT is the number of references to qualifying
2095 template classes that appeared in the name of the function. See
2096 check_explicit_specialization for a more accurate description.
2097
2098 TSK indicates what kind of template declaration (if any) is being
2099 declared. TSK_TEMPLATE indicates that the declaration given by
2100 DECL, though a FUNCTION_DECL, has template parameters, and is
2101 therefore a template function.
2102
2103 The template args (those explicitly specified and those deduced)
2104 are output in a newly created vector *TARGS_OUT.
2105
2106 If it is impossible to determine the result, an error message is
2107 issued. The error_mark_node is returned to indicate failure. */
2108
2109static tree
2110determine_specialization (tree template_id,
2111 tree decl,
2112 tree* targs_out,
2113 int need_member_template,
2114 int template_count,
2115 tmpl_spec_kind tsk)
2116{
2117 tree fns;
2118 tree targs;
2119 tree explicit_targs;
2120 tree candidates = NULL_TREE(tree) __null;
2121
2122 /* A TREE_LIST of templates of which DECL may be a specialization.
2123 The TREE_VALUE of each node is a TEMPLATE_DECL. The
2124 corresponding TREE_PURPOSE is the set of template arguments that,
2125 when used to instantiate the template, would produce a function
2126 with the signature of DECL. */
2127 tree templates = NULL_TREE(tree) __null;
2128 int header_count;
2129 cp_binding_level *b;
2130
2131 *targs_out = NULL_TREE(tree) __null;
2132
2133 if (template_id == error_mark_nodeglobal_trees[TI_ERROR_MARK] || decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2134 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2135
2136 /* We shouldn't be specializing a member template of an
2137 unspecialized class template; we already gave an error in
2138 check_specialization_scope, now avoid crashing. */
2139 if (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
2140 && template_count && DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2140, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2140, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
2141 && template_class_depth (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2141, __FUNCTION__))->decl_minimal.context)
) > 0)
2142 {
2143 gcc_assert (errorcount)((void)(!((global_dc)->diagnostic_count[(int) (DK_ERROR)])
? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2143, __FUNCTION__), 0 : 0))
;
2144 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2145 }
2146
2147 fns = TREE_OPERAND (template_id, 0)(*((const_cast<tree*> (tree_operand_check ((template_id
), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2147, __FUNCTION__)))))
;
2148 explicit_targs = TREE_OPERAND (template_id, 1)(*((const_cast<tree*> (tree_operand_check ((template_id
), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2148, __FUNCTION__)))))
;
2149
2150 if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2151 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2152
2153 /* Check for baselinks. */
2154 if (BASELINK_P (fns)(((enum tree_code) (fns)->base.code) == BASELINK))
2155 fns = BASELINK_FUNCTIONS (fns)(((struct tree_baselink*) (tree_check ((fns), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2155, __FUNCTION__, (BASELINK))))->functions)
;
2156
2157 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL && !is_overloaded_fn (fns))
2158 {
2159 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2159, __FUNCTION__))->decl_minimal.locus)
,
2160 "%qD is not a function template", fns);
2161 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2162 }
2163 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && !variable_template_p (fns))
2164 {
2165 error ("%qD is not a variable template", fns);
2166 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2167 }
2168
2169 /* Count the number of template headers specified for this
2170 specialization. */
2171 header_count = 0;
2172 for (b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
2173 b->kind == sk_template_parms;
2174 b = b->level_chain)
2175 ++header_count;
2176
2177 tree orig_fns = fns;
2178 bool header_mismatch = false;
2179
2180 if (variable_template_p (fns))
2181 {
2182 tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (fns))((tree_check ((((struct tree_template_decl *)(const_cast<union
tree_node *> ((((tree_check ((fns), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2182, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2182, __FUNCTION__, (TREE_LIST)))->list.value)
;
2183 targs = coerce_template_parms (parms, explicit_targs, fns,
2184 tf_warning_or_error);
2185 if (targs != error_mark_nodeglobal_trees[TI_ERROR_MARK]
2186 && constraints_satisfied_p (fns, targs))
2187 templates = tree_cons (targs, fns, templates);
2188 }
2189 else for (lkp_iterator iter (fns); iter; ++iter)
2190 {
2191 tree fn = *iter;
2192
2193 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL)
2194 {
2195 tree decl_arg_types;
2196 tree fn_arg_types;
2197
2198 /* In case of explicit specialization, we need to check if
2199 the number of template headers appearing in the specialization
2200 is correct. This is usually done in check_explicit_specialization,
2201 but the check done there cannot be exhaustive when specializing
2202 member functions. Consider the following code:
2203
2204 template <> void A<int>::f(int);
2205 template <> template <> void A<int>::f(int);
2206
2207 Assuming that A<int> is not itself an explicit specialization
2208 already, the first line specializes "f" which is a non-template
2209 member function, whilst the second line specializes "f" which
2210 is a template member function. So both lines are syntactically
2211 correct, and check_explicit_specialization does not reject
2212 them.
2213
2214 Here, we can do better, as we are matching the specialization
2215 against the declarations. We count the number of template
2216 headers, and we check if they match TEMPLATE_COUNT + 1
2217 (TEMPLATE_COUNT is the number of qualifying template classes,
2218 plus there must be another header for the member template
2219 itself).
2220
2221 Notice that if header_count is zero, this is not a
2222 specialization but rather a template instantiation, so there
2223 is no check we can perform here. */
2224 if (header_count && header_count != template_count + 1)
2225 {
2226 header_mismatch = true;
2227 continue;
2228 }
2229
2230 /* Check that the number of template arguments at the
2231 innermost level for DECL is the same as for FN. */
2232 if (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_template_parms
2233 && !current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->explicit_spec_p
2234 && (TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (fn))((tree_check ((((tree_check ((((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2234, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2234, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2234, __FUNCTION__, (TREE_VEC)))->base.u.length)
2235 != TREE_VEC_LENGTH (INNERMOST_TEMPLATE_PARMS((tree_check ((((tree_check ((scope_chain->template_parms)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2236, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2236, __FUNCTION__, (TREE_VEC)))->base.u.length)
2236 (current_template_parms))((tree_check ((((tree_check ((scope_chain->template_parms)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2236, __FUNCTION__, (TREE_LIST)))->list.value)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2236, __FUNCTION__, (TREE_VEC)))->base.u.length)
))
2237 continue;
2238
2239 /* DECL might be a specialization of FN. */
2240 decl_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2240, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2240, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2241 fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2241, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2241, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2242
2243 /* For a non-static member function, we need to make sure
2244 that the const qualification is the same. Since
2245 get_bindings does not try to merge the "this" parameter,
2246 we must do the comparison explicitly. */
2247 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2247, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2248 {
2249 if (!same_type_p (TREE_VALUE (fn_arg_types),comptypes ((((tree_check ((fn_arg_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2249, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check
((decl_arg_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2250, __FUNCTION__, (TREE_LIST)))->list.value)), 0)
2250 TREE_VALUE (decl_arg_types))comptypes ((((tree_check ((fn_arg_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2249, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check
((decl_arg_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2250, __FUNCTION__, (TREE_LIST)))->list.value)), 0)
)
2251 continue;
2252
2253 /* And the ref-qualification. */
2254 if (type_memfn_rqual (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2254, __FUNCTION__))->typed.type)
)
2255 != type_memfn_rqual (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2255, __FUNCTION__))->typed.type)
))
2256 continue;
2257 }
2258
2259 /* Skip the "this" parameter and, for constructors of
2260 classes with virtual bases, the VTT parameter. A
2261 full specialization of a constructor will have a VTT
2262 parameter, but a template never will. */
2263 decl_arg_types
2264 = skip_artificial_parms_for (decl, decl_arg_types);
2265 fn_arg_types
2266 = skip_artificial_parms_for (fn, fn_arg_types);
2267
2268 /* Function templates cannot be specializations; there are
2269 no partial specializations of functions. Therefore, if
2270 the type of DECL does not match FN, there is no
2271 match.
2272
2273 Note that it should never be the case that we have both
2274 candidates added here, and for regular member functions
2275 below. */
2276 if (tsk == tsk_template)
2277 {
2278 if (!comp_template_parms (DECL_TEMPLATE_PARMS (fn)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2278, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
2279 current_template_parmsscope_chain->template_parms))
2280 continue;
2281 if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2281, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2281, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2282, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2282, __FUNCTION__))->typed.type)), 0)
2282 TREE_TYPE (TREE_TYPE (fn)))comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2281, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2281, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2282, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2282, __FUNCTION__))->typed.type)), 0)
)
2283 continue;
2284 if (!compparms (fn_arg_types, decl_arg_types))
2285 continue;
2286
2287 tree freq = get_constraints (fn);
2288 tree dreq = get_constraints (decl);
2289 if (!freq != !dreq)
2290 continue;
2291 if (freq)
2292 {
2293 /* C++20 CA104: Substitute directly into the
2294 constraint-expression. */
2295 tree fargs = DECL_TI_ARGS (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2295, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2295, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2295, __FUNCTION__, (TEMPLATE_INFO))))->args
;
2296 tsubst_flags_t complain = tf_none;
2297 freq = tsubst_constraint_info (freq, fargs, complain, fn);
2298 if (!cp_tree_equal (freq, dreq))
2299 continue;
2300 }
2301
2302 candidates = tree_cons (NULL_TREE(tree) __null, fn, candidates);
2303 continue;
2304 }
2305
2306 /* See whether this function might be a specialization of this
2307 template. Suppress access control because we might be trying
2308 to make this specialization a friend, and we have already done
2309 access control for the declaration of the specialization. */
2310 push_deferring_access_checks (dk_no_check);
2311 targs = get_bindings (fn, decl, explicit_targs, /*check_ret=*/true);
2312 pop_deferring_access_checks ();
2313
2314 if (!targs)
2315 /* We cannot deduce template arguments that when used to
2316 specialize TMPL will produce DECL. */
2317 continue;
2318
2319 if (uses_template_parms (targs))
2320 /* We deduced something involving 'auto', which isn't a valid
2321 template argument. */
2322 continue;
2323
2324 /* Save this template, and the arguments deduced. */
2325 templates = tree_cons (targs, fn, templates);
2326 }
2327 else if (need_member_template)
2328 /* FN is an ordinary member function, and we need a
2329 specialization of a member template. */
2330 ;
2331 else if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) != FUNCTION_DECL)
2332 /* We can get IDENTIFIER_NODEs here in certain erroneous
2333 cases. */
2334 ;
2335 else if (!DECL_FUNCTION_MEMBER_P (fn)((((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2335, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2335, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2335, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2335, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2335, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2335, __FUNCTION__); &lt->u.fn; })->static_function
))
)
2336 /* This is just an ordinary non-member function. Nothing can
2337 be a specialization of that. */
2338 ;
2339 else if (DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2339, __FUNCTION__))->decl_common.artificial_flag)
)
2340 /* Cannot specialize functions that are created implicitly. */
2341 ;
2342 else
2343 {
2344 tree decl_arg_types;
2345
2346 /* This is an ordinary member function. However, since
2347 we're here, we can assume its enclosing class is a
2348 template class. For example,
2349
2350 template <typename T> struct S { void f(); };
2351 template <> void S<int>::f() {}
2352
2353 Here, S<int>::f is a non-template, but S<int> is a
2354 template class. If FN has the same type as DECL, we
2355 might be in business. */
2356
2357 if (!DECL_TEMPLATE_INFO (fn)(((contains_struct_check ((template_info_decl_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2357, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2357, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
)
2358 /* Its enclosing class is an explicit specialization
2359 of a template class. This is not a candidate. */
2360 continue;
2361
2362 if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2362, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2362, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2363, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2363, __FUNCTION__))->typed.type)), 0)
2363 TREE_TYPE (TREE_TYPE (fn)))comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2362, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2362, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2363, __FUNCTION__))->typed.type)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2363, __FUNCTION__))->typed.type)), 0)
)
2364 /* The return types differ. */
2365 continue;
2366
2367 /* Adjust the type of DECL in case FN is a static member. */
2368 decl_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2368, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2368, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2369 if (DECL_STATIC_FUNCTION_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2369, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2369, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2369, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2369, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2369, __FUNCTION__); &lt->u.fn; })->static_function
)
2370 && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2370, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2371 decl_arg_types = TREE_CHAIN (decl_arg_types)((contains_struct_check ((decl_arg_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2371, __FUNCTION__))->common.chain)
;
2372
2373 if (!compparms (TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2373, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2373, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
,
2374 decl_arg_types))
2375 continue;
2376
2377 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2377, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
2378 && (type_memfn_rqual (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2378, __FUNCTION__))->typed.type)
)
2379 != type_memfn_rqual (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2379, __FUNCTION__))->typed.type)
)))
2380 continue;
2381
2382 // If the deduced arguments do not satisfy the constraints,
2383 // this is not a candidate.
2384 if (flag_conceptsglobal_options.x_flag_concepts && !constraints_satisfied_p (fn))
2385 continue;
2386
2387 // Add the candidate.
2388 candidates = tree_cons (NULL_TREE(tree) __null, fn, candidates);
2389 }
2390 }
2391
2392 if (templates && TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2392, __FUNCTION__))->common.chain)
)
2393 {
2394 /* We have:
2395
2396 [temp.expl.spec]
2397
2398 It is possible for a specialization with a given function
2399 signature to be instantiated from more than one function
2400 template. In such cases, explicit specification of the
2401 template arguments must be used to uniquely identify the
2402 function template specialization being specialized.
2403
2404 Note that here, there's no suggestion that we're supposed to
2405 determine which of the candidate templates is most
2406 specialized. However, we, also have:
2407
2408 [temp.func.order]
2409
2410 Partial ordering of overloaded function template
2411 declarations is used in the following contexts to select
2412 the function template to which a function template
2413 specialization refers:
2414
2415 -- when an explicit specialization refers to a function
2416 template.
2417
2418 So, we do use the partial ordering rules, at least for now.
2419 This extension can only serve to make invalid programs valid,
2420 so it's safe. And, there is strong anecdotal evidence that
2421 the committee intended the partial ordering rules to apply;
2422 the EDG front end has that behavior, and John Spicer claims
2423 that the committee simply forgot to delete the wording in
2424 [temp.expl.spec]. */
2425 tree tmpl = most_specialized_instantiation (templates);
2426 if (tmpl != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2427 {
2428 templates = tmpl;
2429 TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2429, __FUNCTION__))->common.chain)
= NULL_TREE(tree) __null;
2430 }
2431 }
2432
2433 // Concepts allows multiple declarations of member functions
2434 // with the same signature. Like above, we need to rely on
2435 // on the partial ordering of those candidates to determine which
2436 // is the best.
2437 if (flag_conceptsglobal_options.x_flag_concepts && candidates && TREE_CHAIN (candidates)((contains_struct_check ((candidates), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2437, __FUNCTION__))->common.chain)
)
2438 {
2439 if (tree cand = most_constrained_function (candidates))
2440 {
2441 candidates = cand;
2442 TREE_CHAIN (cand)((contains_struct_check ((cand), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2442, __FUNCTION__))->common.chain)
= NULL_TREE(tree) __null;
2443 }
2444 }
2445
2446 if (templates == NULL_TREE(tree) __null && candidates == NULL_TREE(tree) __null)
2447 {
2448 error ("template-id %qD for %q+D does not match any template "
2449 "declaration", template_id, decl);
2450 if (header_mismatch)
2451 inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2451, __FUNCTION__))->decl_minimal.locus)
,
2452 "saw %d %<template<>%>, need %d for "
2453 "specializing a member function template",
2454 header_count, template_count + 1);
2455 print_candidates (orig_fns);
2456 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2457 }
2458 else if ((templates && TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2458, __FUNCTION__))->common.chain)
)
2459 || (candidates && TREE_CHAIN (candidates)((contains_struct_check ((candidates), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2459, __FUNCTION__))->common.chain)
)
2460 || (templates && candidates))
2461 {
2462 error ("ambiguous template specialization %qD for %q+D",
2463 template_id, decl);
2464 candidates = chainon (candidates, templates);
2465 print_candidates (candidates);
2466 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2467 }
2468
2469 /* We have one, and exactly one, match. */
2470 if (candidates)
2471 {
2472 tree fn = TREE_VALUE (candidates)((tree_check ((candidates), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2472, __FUNCTION__, (TREE_LIST)))->list.value)
;
2473 *targs_out = copy_node (DECL_TI_ARGS (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2473, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2473, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2473, __FUNCTION__, (TEMPLATE_INFO))))->args
);
2474
2475 /* Propagate the candidate's constraints to the declaration. */
2476 if (tsk != tsk_template)
2477 set_constraints (decl, get_constraints (fn));
2478
2479 /* DECL is a re-declaration or partial instantiation of a template
2480 function. */
2481 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL)
2482 return fn;
2483 /* It was a specialization of an ordinary member function in a
2484 template class. */
2485 return DECL_TI_TEMPLATE (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2485, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2485, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2485, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
2486 }
2487
2488 /* It was a specialization of a template. */
2489 tree tmpl = TREE_VALUE (templates)((tree_check ((templates), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2489, __FUNCTION__, (TREE_LIST)))->list.value)
;
2490 *targs_out = add_outermost_template_args (tmpl, TREE_PURPOSE (templates)((tree_check ((templates), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2490, __FUNCTION__, (TREE_LIST)))->list.purpose)
);
2491
2492 /* Propagate the template's constraints to the declaration. */
2493 if (tsk != tsk_template)
2494 set_constraints (decl, get_constraints (tmpl));
2495
2496 return tmpl;
2497}
2498
2499/* Returns a chain of parameter types, exactly like the SPEC_TYPES,
2500 but with the default argument values filled in from those in the
2501 TMPL_TYPES. */
2502
2503static tree
2504copy_default_args_to_explicit_spec_1 (tree spec_types,
2505 tree tmpl_types)
2506{
2507 tree new_spec_types;
2508
2509 if (!spec_types)
2510 return NULL_TREE(tree) __null;
2511
2512 if (spec_types == void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
2513 return void_list_nodeglobal_trees[TI_VOID_LIST_NODE];
2514
2515 /* Substitute into the rest of the list. */
2516 new_spec_types =
2517 copy_default_args_to_explicit_spec_1 (TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2517, __FUNCTION__))->common.chain)
,
2518 TREE_CHAIN (tmpl_types)((contains_struct_check ((tmpl_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2518, __FUNCTION__))->common.chain)
);
2519
2520 /* Add the default argument for this parameter. */
2521 return hash_tree_cons (TREE_PURPOSE (tmpl_types)((tree_check ((tmpl_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2521, __FUNCTION__, (TREE_LIST)))->list.purpose)
,
2522 TREE_VALUE (spec_types)((tree_check ((spec_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2522, __FUNCTION__, (TREE_LIST)))->list.value)
,
2523 new_spec_types);
2524}
2525
2526/* DECL is an explicit specialization. Replicate default arguments
2527 from the template it specializes. (That way, code like:
2528
2529 template <class T> void f(T = 3);
2530 template <> void f(double);
2531 void g () { f (); }
2532
2533 works, as required.) An alternative approach would be to look up
2534 the correct default arguments at the call-site, but this approach
2535 is consistent with how implicit instantiations are handled. */
2536
2537static void
2538copy_default_args_to_explicit_spec (tree decl)
2539{
2540 tree tmpl;
2541 tree spec_types;
2542 tree tmpl_types;
2543 tree new_spec_types;
2544 tree old_type;
2545 tree new_type;
2546 tree t;
2547 tree object_type = NULL_TREE(tree) __null;
2548 tree in_charge = NULL_TREE(tree) __null;
2549 tree vtt = NULL_TREE(tree) __null;
2550
2551 /* See if there's anything we need to do. */
2552 tmpl = DECL_TI_TEMPLATE (decl)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2552, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2552, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2552, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
2553 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
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2553, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2553, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2553, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2554 for (t = tmpl_types; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2554, __FUNCTION__))->common.chain)
)
2555 if (TREE_PURPOSE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2555, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
2556 break;
2557 if (!t)
2558 return;
2559
2560 old_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2560, __FUNCTION__))->typed.type)
;
2561 spec_types = TYPE_ARG_TYPES (old_type)((tree_check2 ((old_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2561, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2562
2563 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2563, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2564 {
2565 /* Remove the this pointer, but remember the object's type for
2566 CV quals. */
2567 object_type = TREE_TYPE (TREE_VALUE (spec_types))((contains_struct_check ((((tree_check ((spec_types), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2567, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2567, __FUNCTION__))->typed.type)
;
2568 spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2568, __FUNCTION__))->common.chain)
;
2569 tmpl_types = TREE_CHAIN (tmpl_types)((contains_struct_check ((tmpl_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2569, __FUNCTION__))->common.chain)
;
2570
2571 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2571, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2571, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2571, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2571, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2571, __FUNCTION__); &lt->u.fn; })->has_in_charge_parm_p
)
)
2572 {
2573 /* DECL may contain more parameters than TMPL due to the extra
2574 in-charge parameter in constructors and destructors. */
2575 in_charge = spec_types;
2576 spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2576, __FUNCTION__))->common.chain)
;
2577 }
2578 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2578, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2578, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2578, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2578, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2578, __FUNCTION__); &lt->u.fn; })->has_vtt_parm_p
)
)
2579 {
2580 vtt = spec_types;
2581 spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2581, __FUNCTION__))->common.chain)
;
2582 }
2583 }
2584
2585 /* Compute the merged default arguments. */
2586 new_spec_types =
2587 copy_default_args_to_explicit_spec_1 (spec_types, tmpl_types);
2588
2589 /* Compute the new FUNCTION_TYPE. */
2590 if (object_type)
2591 {
2592 if (vtt)
2593 new_spec_types = hash_tree_cons (TREE_PURPOSE (vtt)((tree_check ((vtt), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2593, __FUNCTION__, (TREE_LIST)))->list.purpose)
,
2594 TREE_VALUE (vtt)((tree_check ((vtt), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2594, __FUNCTION__, (TREE_LIST)))->list.value)
,
2595 new_spec_types);
2596
2597 if (in_charge)
2598 /* Put the in-charge parameter back. */
2599 new_spec_types = hash_tree_cons (TREE_PURPOSE (in_charge)((tree_check ((in_charge), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2599, __FUNCTION__, (TREE_LIST)))->list.purpose)
,
2600 TREE_VALUE (in_charge)((tree_check ((in_charge), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2600, __FUNCTION__, (TREE_LIST)))->list.value)
,
2601 new_spec_types);
2602
2603 new_type = build_method_type_directly (object_type,
2604 TREE_TYPE (old_type)((contains_struct_check ((old_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2604, __FUNCTION__))->typed.type)
,
2605 new_spec_types);
2606 }
2607 else
2608 new_type = build_function_type (TREE_TYPE (old_type)((contains_struct_check ((old_type), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2608, __FUNCTION__))->typed.type)
,
2609 new_spec_types);
2610 new_type = cp_build_type_attribute_variant (new_type,
2611 TYPE_ATTRIBUTES (old_type)((tree_class_check ((old_type), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2611, __FUNCTION__))->type_common.attributes)
);
2612 new_type = cxx_copy_lang_qualifiers (new_type, old_type);
2613
2614 TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2614, __FUNCTION__))->typed.type)
= new_type;
2615}
2616
2617/* Return the number of template headers we expect to see for a definition
2618 or specialization of CTYPE or one of its non-template members. */
2619
2620int
2621num_template_headers_for_class (tree ctype)
2622{
2623 int num_templates = 0;
2624
2625 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2625, __FUNCTION__))->type_common.lang_flag_5))
)
2626 {
2627 /* You're supposed to have one `template <...>' for every
2628 template class, but you don't need one for a full
2629 specialization. For example:
2630
2631 template <class T> struct S{};
2632 template <> struct S<int> { void f(); };
2633 void S<int>::f () {}
2634
2635 is correct; there shouldn't be a `template <>' for the
2636 definition of `S<int>::f'. */
2637 if (!CLASSTYPE_TEMPLATE_INFO (ctype)(((tree_class_check (((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2637, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2637, __FUNCTION__))->type_non_common.lang_1))
)
2638 /* If CTYPE does not have template information of any
2639 kind, then it is not a template, nor is it nested
2640 within a template. */
2641 break;
2642 if (explicit_class_specialization_p (ctype))
2643 break;
2644 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((ctype), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2644, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
2645 ++num_templates;
2646
2647 ctype = TYPE_CONTEXT (ctype)((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2647, __FUNCTION__))->type_common.context)
;
2648 }
2649
2650 return num_templates;
2651}
2652
2653/* Do a simple sanity check on the template headers that precede the
2654 variable declaration DECL. */
2655
2656void
2657check_template_variable (tree decl)
2658{
2659 tree ctx = CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2659, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2659, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2659, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
2660 int wanted = num_template_headers_for_class (ctx);
2661 if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2661, __FUNCTION__))->decl_common.lang_specific)
&& DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2661, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2661, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
2662 && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((contains_struct_check (
(template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2662, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
2663 {
2664 if (cxx_dialect < cxx14)
2665 pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2665, __FUNCTION__))->decl_minimal.locus)
, OPT_Wc__14_extensions,
2666 "variable templates only available with "
2667 "%<-std=c++14%> or %<-std=gnu++14%>");
2668
2669 // Namespace-scope variable templates should have a template header.
2670 ++wanted;
2671 }
2672 if (template_header_count > wanted)
2673 {
2674 auto_diagnostic_group d;
2675 bool warned = pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2675, __FUNCTION__))->decl_minimal.locus)
, 0,
2676 "too many template headers for %qD "
2677 "(should be %d)",
2678 decl, wanted);
2679 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2679, __FUNCTION__))->type_common.lang_flag_5))
2680 && CLASSTYPE_TEMPLATE_SPECIALIZATION (ctx)(((((tree_class_check ((ctx), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2680, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
)
2681 inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2681, __FUNCTION__))->decl_minimal.locus)
,
2682 "members of an explicitly specialized class are defined "
2683 "without a template header");
2684 }
2685}
2686
2687/* An explicit specialization whose declarator-id or class-head-name is not
2688 qualified shall be declared in the nearest enclosing namespace of the
2689 template, or, if the namespace is inline (7.3.1), any namespace from its
2690 enclosing namespace set.
2691
2692 If the name declared in the explicit instantiation is an unqualified name,
2693 the explicit instantiation shall appear in the namespace where its template
2694 is declared or, if that namespace is inline (7.3.1), any namespace from its
2695 enclosing namespace set. */
2696
2697void
2698check_unqualified_spec_or_inst (tree t, location_t loc)
2699{
2700 tree tmpl = most_general_template (t);
2701 if (DECL_NAMESPACE_SCOPE_P (tmpl)(!(((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2701, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2701, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2701, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((tmpl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2701, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
2702 && !is_nested_namespace (current_namespacescope_chain->old_namespace,
2703 CP_DECL_CONTEXT (tmpl)(!(! (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2703, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2703, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((tmpl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2703, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
, true))
2704 {
2705 if (processing_specializationscope_chain->x_processing_specialization)
2706 permerror (loc, "explicit specialization of %qD outside its "
2707 "namespace must use a nested-name-specifier", tmpl);
2708 else if (processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation
2709 && cxx_dialect >= cxx11)
2710 /* This was allowed in C++98, so only pedwarn. */
2711 pedwarn (loc, OPT_Wpedantic, "explicit instantiation of %qD "
2712 "outside its namespace must use a nested-name-"
2713 "specifier", tmpl);
2714 }
2715}
2716
2717/* Warn for a template specialization SPEC that is missing some of a set
2718 of function or type attributes that the template TEMPL is declared with.
2719 ATTRLIST is a list of additional attributes that SPEC should be taken
2720 to ultimately be declared with. */
2721
2722static void
2723warn_spec_missing_attributes (tree tmpl, tree spec, tree attrlist)
2724{
2725 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2725, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2725, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
)
2726 tmpl = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2726, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
2727
2728 /* Avoid warning if the difference between the primary and
2729 the specialization is not in one of the attributes below. */
2730 const char* const blacklist[] = {
2731 "alloc_align", "alloc_size", "assume_aligned", "format",
2732 "format_arg", "malloc", "nonnull", NULL__null
2733 };
2734
2735 /* Put together a list of the black listed attributes that the primary
2736 template is declared with that the specialization is not, in case
2737 it's not apparent from the most recent declaration of the primary. */
2738 pretty_printer str;
2739 unsigned nattrs = decls_mismatched_attributes (tmpl, spec, attrlist,
2740 blacklist, &str);
2741
2742 if (!nattrs)
2743 return;
2744
2745 auto_diagnostic_group d;
2746 if (warning_at (DECL_SOURCE_LOCATION (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2746, __FUNCTION__))->decl_minimal.locus)
, OPT_Wmissing_attributes,
2747 "explicit specialization %q#D may be missing attributes",
2748 spec))
2749 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2749, __FUNCTION__))->decl_minimal.locus)
,
2750 nattrs > 1
2751 ? G_("missing primary template attributes %s")"missing primary template attributes %s"
2752 : G_("missing primary template attribute %s")"missing primary template attribute %s",
2753 pp_formatted_text (&str));
2754}
2755
2756/* Check to see if the function just declared, as indicated in
2757 DECLARATOR, and in DECL, is a specialization of a function
2758 template. We may also discover that the declaration is an explicit
2759 instantiation at this point.
2760
2761 Returns DECL, or an equivalent declaration that should be used
2762 instead if all goes well. Issues an error message if something is
2763 amiss. Returns error_mark_node if the error is not easily
2764 recoverable.
2765
2766 FLAGS is a bitmask consisting of the following flags:
2767
2768 2: The function has a definition.
2769 4: The function is a friend.
2770
2771 The TEMPLATE_COUNT is the number of references to qualifying
2772 template classes that appeared in the name of the function. For
2773 example, in
2774
2775 template <class T> struct S { void f(); };
2776 void S<int>::f();
2777
2778 the TEMPLATE_COUNT would be 1. However, explicitly specialized
2779 classes are not counted in the TEMPLATE_COUNT, so that in
2780
2781 template <class T> struct S {};
2782 template <> struct S<int> { void f(); }
2783 template <> void S<int>::f();
2784
2785 the TEMPLATE_COUNT would be 0. (Note that this declaration is
2786 invalid; there should be no template <>.)
2787
2788 If the function is a specialization, it is marked as such via
2789 DECL_TEMPLATE_SPECIALIZATION. Furthermore, its DECL_TEMPLATE_INFO
2790 is set up correctly, and it is added to the list of specializations
2791 for that template. */
2792
2793tree
2794check_explicit_specialization (tree declarator,
2795 tree decl,
2796 int template_count,
2797 int flags,
2798 tree attrlist)
2799{
2800 int have_def = flags & 2;
2801 int is_friend = flags & 4;
2802 bool is_concept = flags & 8;
2803 int specialization = 0;
2804 int explicit_instantiation = 0;
2805 int member_specialization = 0;
2806 tree ctype = DECL_CLASS_CONTEXT (decl)((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2806, __FUNCTION__))->decl_minimal.context) && (
tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2806, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type)) ? ((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2806, __FUNCTION__))->decl_minimal.context) : (tree) __null
)
;
2807 tree dname = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2807, __FUNCTION__))->decl_minimal.name)
;
2808 tmpl_spec_kind tsk;
2809
2810 if (is_friend)
2811 {
2812 if (!processing_specializationscope_chain->x_processing_specialization)
2813 tsk = tsk_none;
2814 else
2815 tsk = tsk_excessive_parms;
2816 }
2817 else
2818 tsk = current_tmpl_spec_kind (template_count);
2819
2820 switch (tsk)
2821 {
2822 case tsk_none:
2823 if (processing_specializationscope_chain->x_processing_specialization && !VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
2824 {
2825 specialization = 1;
2826 SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2826, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
2827 }
2828 else if (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR
2829 || (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2829, __FUNCTION__))->decl_common.lang_specific)
2830 && DECL_IMPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2830, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 1)
))
2831 {
2832 if (is_friend)
2833 /* This could be something like:
2834
2835 template <class T> void f(T);
2836 class S { friend void f<>(int); } */
2837 specialization = 1;
2838 else
2839 {
2840 /* This case handles bogus declarations like template <>
2841 template <class T> void f<int>(); */
2842
2843 error_at (cp_expr_loc_or_input_loc (declarator),
2844 "template-id %qE in declaration of primary template",
2845 declarator);
2846 return decl;
2847 }
2848 }
2849 break;
2850
2851 case tsk_invalid_member_spec:
2852 /* The error has already been reported in
2853 check_specialization_scope. */
2854 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2855
2856 case tsk_invalid_expl_inst:
2857 error ("template parameter list used in explicit instantiation");
2858
2859 /* Fall through. */
2860
2861 case tsk_expl_inst:
2862 if (have_def)
2863 error ("definition provided for explicit instantiation");
2864
2865 explicit_instantiation = 1;
2866 break;
2867
2868 case tsk_excessive_parms:
2869 case tsk_insufficient_parms:
2870 if (tsk == tsk_excessive_parms)
2871 error ("too many template parameter lists in declaration of %qD",
2872 decl);
2873 else if (template_header_count)
2874 error("too few template parameter lists in declaration of %qD", decl);
2875 else
2876 error("explicit specialization of %qD must be introduced by "
2877 "%<template <>%>", decl);
2878
2879 /* Fall through. */
2880 case tsk_expl_spec:
2881 if (is_concept)
2882 error ("explicit specialization declared %<concept%>");
2883
2884 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) != TEMPLATE_ID_EXPR)
2885 /* In cases like template<> constexpr bool v = true;
2886 We'll give an error in check_template_variable. */
2887 break;
2888
2889 SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2889, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
2890 if (ctype)
2891 member_specialization = 1;
2892 else
2893 specialization = 1;
2894 break;
2895
2896 case tsk_template:
2897 if (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR)
2898 {
2899 /* This case handles bogus declarations like template <>
2900 template <class T> void f<int>(); */
2901
2902 if (!uses_template_parms (TREE_OPERAND (declarator, 1)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2902, __FUNCTION__)))))
))
2903 error_at (cp_expr_loc_or_input_loc (declarator),
2904 "template-id %qE in declaration of primary template",
2905 declarator);
2906 else if (variable_template_p (TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2906, __FUNCTION__)))))
))
2907 {
2908 /* Partial specialization of variable template. */
2909 SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2909, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
2910 specialization = 1;
2911 goto ok;
2912 }
2913 else if (cxx_dialect < cxx14)
2914 error_at (cp_expr_loc_or_input_loc (declarator),
2915 "non-type partial specialization %qE "
2916 "is not allowed", declarator);
2917 else
2918 error_at (cp_expr_loc_or_input_loc (declarator),
2919 "non-class, non-variable partial specialization %qE "
2920 "is not allowed", declarator);
2921 return decl;
2922 ok:;
2923 }
2924
2925 if (ctype && CLASSTYPE_TEMPLATE_INSTANTIATION (ctype)(((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2925, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) & 1)
)
2926 /* This is a specialization of a member template, without
2927 specialization the containing class. Something like:
2928
2929 template <class T> struct S {
2930 template <class U> void f (U);
2931 };
2932 template <> template <class U> void S<int>::f(U) {}
2933
2934 That's a specialization -- but of the entire template. */
2935 specialization = 1;
2936 break;
2937
2938 default:
2939 gcc_unreachable ()(fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2939, __FUNCTION__))
;
2940 }
2941
2942 if ((specialization || member_specialization)
2943 /* This doesn't apply to variable templates. */
2944 && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2944, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2944, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2945 {
2946 tree t = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2946, __FUNCTION__))->typed.type)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2946, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2947 for (; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2947, __FUNCTION__))->common.chain)
)
2948 if (TREE_PURPOSE (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2948, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
2949 {
2950 permerror (input_location,
2951 "default argument specified in explicit specialization");
2952 break;
2953 }
2954 }
2955
2956 if (specialization || member_specialization || explicit_instantiation)
2957 {
2958 tree tmpl = NULL_TREE(tree) __null;
2959 tree targs = NULL_TREE(tree) __null;
2960 bool was_template_id = (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR);
2961 bool found_hidden = false;
2962
2963 /* Make sure that the declarator is a TEMPLATE_ID_EXPR. */
2964 if (!was_template_id)
2965 {
2966 tree fns;
2967
2968 gcc_assert (identifier_p (declarator))((void)(!(identifier_p (declarator)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2968, __FUNCTION__), 0 : 0))
;
2969 if (ctype)
2970 fns = dname;
2971 else
2972 {
2973 /* If there is no class context, the explicit instantiation
2974 must be at namespace scope. */
2975 gcc_assert (DECL_NAMESPACE_SCOPE_P (decl))((void)(!((!(((contains_struct_check ((decl), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2975, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2975, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2975, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2975, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)) ? fancy_abort
("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2975, __FUNCTION__), 0 : 0))
;
2976
2977 /* Find the namespace binding, using the declaration
2978 context. */
2979 fns = lookup_qualified_name (CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2979, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2979, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2979, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
, dname,
2980 LOOK_want::NORMAL, true);
2981 if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2982 {
2983 /* If lookup fails, look for a friend declaration so we can
2984 give a better diagnostic. */
2985 fns = (lookup_qualified_name
2986 (CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2986, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2986, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 2986, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
, dname,
2987 LOOK_want::NORMAL | LOOK_want::HIDDEN_FRIEND,
2988 /*complain*/true));
2989 found_hidden = true;
2990 }
2991
2992 if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !is_overloaded_fn (fns))
2993 {
2994 error ("%qD is not a template function", dname);
2995 fns = error_mark_nodeglobal_trees[TI_ERROR_MARK];
2996 }
2997 }
2998
2999 declarator = lookup_template_function (fns, NULL_TREE(tree) __null);
3000 }
3001
3002 if (declarator == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3003 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3004
3005 if (ctype != NULL_TREE(tree) __null && TYPE_BEING_DEFINED (ctype)((((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3005, __FUNCTION__))->type_with_lang_specific.lang_specific
))->being_defined)
)
3006 {
3007 if (!explicit_instantiation)
3008 /* A specialization in class scope. This is invalid,
3009 but the error will already have been flagged by
3010 check_specialization_scope. */
3011 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3012 else
3013 {
3014 /* It's not valid to write an explicit instantiation in
3015 class scope, e.g.:
3016
3017 class C { template void f(); }
3018
3019 This case is caught by the parser. However, on
3020 something like:
3021
3022 template class C { void f(); };
3023
3024 (which is invalid) we can get here. The error will be
3025 issued later. */
3026 ;
3027 }
3028
3029 return decl;
3030 }
3031 else if (ctype != NULL_TREE(tree) __null
3032 && (identifier_p (TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3032, __FUNCTION__)))))
)))
3033 {
3034 // We'll match variable templates in start_decl.
3035 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
3036 return decl;
3037
3038 /* Find the list of functions in ctype that have the same
3039 name as the declared function. */
3040 tree name = TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3040, __FUNCTION__)))))
;
3041
3042 if (constructor_name_p (name, ctype))
3043 {
3044 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3044, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3044, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
3045 ? !TYPE_HAS_USER_CONSTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3045, __FUNCTION__))->type_common.lang_flag_1))
3046 : !CLASSTYPE_DESTRUCTOR (ctype)(get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER
]))
)
3047 {
3048 /* From [temp.expl.spec]:
3049
3050 If such an explicit specialization for the member
3051 of a class template names an implicitly-declared
3052 special member function (clause _special_), the
3053 program is ill-formed.
3054
3055 Similar language is found in [temp.explicit]. */
3056 error ("specialization of implicitly-declared special member function");
3057 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3058 }
3059
3060 name = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3060, __FUNCTION__))->decl_minimal.name)
;
3061 }
3062
3063 /* For a type-conversion operator, We might be looking for
3064 `operator int' which will be a specialization of
3065 `operator T'. Grab all the conversion operators, and
3066 then select from them. */
3067 tree fns = get_class_binding (ctype, IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3067, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3067, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3067, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3067, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3067, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3067, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
3068 ? conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER] : name);
3069
3070 if (fns == NULL_TREE(tree) __null)
3071 {
3072 error ("no member function %qD declared in %qT", name, ctype);
3073 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3074 }
3075 else
3076 TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3076, __FUNCTION__)))))
= fns;
3077 }
3078
3079 /* Figure out what exactly is being specialized at this point.
3080 Note that for an explicit instantiation, even one for a
3081 member function, we cannot tell a priori whether the
3082 instantiation is for a member template, or just a member
3083 function of a template class. Even if a member template is
3084 being instantiated, the member template arguments may be
3085 elided if they can be deduced from the rest of the
3086 declaration. */
3087 tmpl = determine_specialization (declarator, decl,
3088 &targs,
3089 member_specialization,
3090 template_count,
3091 tsk);
3092
3093 if (!tmpl || tmpl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3094 /* We couldn't figure out what this declaration was
3095 specializing. */
3096 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3097 else
3098 {
3099 if (found_hidden && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
3100 {
3101 auto_diagnostic_group d;
3102 if (pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3102, __FUNCTION__))->decl_minimal.locus)
, 0,
3103 "friend declaration %qD is not visible to "
3104 "explicit specialization", tmpl))
3105 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3105, __FUNCTION__))->decl_minimal.locus)
,
3106 "friend declaration here");
3107 }
3108
3109 if (!ctype && !is_friend
3110 && CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3110, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3110, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3110, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
== current_namespacescope_chain->old_namespace)
3111 check_unqualified_spec_or_inst (tmpl, DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3111, __FUNCTION__))->decl_minimal.locus)
);
3112
3113 tree gen_tmpl = most_general_template (tmpl);
3114
3115 if (explicit_instantiation)
3116 {
3117 /* We don't set DECL_EXPLICIT_INSTANTIATION here; that
3118 is done by do_decl_instantiation later. */
3119
3120 int arg_depth = TMPL_ARGS_DEPTH (targs)((targs) == (tree) __null ? 0 : (targs && ((tree_check
((targs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3120, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((targs), (
0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3120, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((targs), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3120, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((targs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3120, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
3121 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3121, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3121, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3121, __FUNCTION__))))
;
3122
3123 if (arg_depth > parm_depth)
3124 {
3125 /* If TMPL is not the most general template (for
3126 example, if TMPL is a friend template that is
3127 injected into namespace scope), then there will
3128 be too many levels of TARGS. Remove some of them
3129 here. */
3130 int i;
3131 tree new_targs;
3132
3133 new_targs = make_tree_vec (parm_depth);
3134 for (i = arg_depth - parm_depth; i < arg_depth; ++i)
3135 TREE_VEC_ELT (new_targs, i - (arg_depth - parm_depth))(*((const_cast<tree *> (tree_vec_elt_check ((new_targs)
, (i - (arg_depth - parm_depth)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3135, __FUNCTION__)))))
3136 = TREE_VEC_ELT (targs, i)(*((const_cast<tree *> (tree_vec_elt_check ((targs), (i
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3136, __FUNCTION__)))))
;
3137 targs = new_targs;
3138 }
3139
3140 return instantiate_template (tmpl, targs, tf_error);
3141 }
3142
3143 /* If we thought that the DECL was a member function, but it
3144 turns out to be specializing a static member function,
3145 make DECL a static member function as well. */
3146 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3146, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3146, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
3147 && 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3147, __FUNCTION__, (TEMPLATE_DECL))))))))->result : tmpl
)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3147, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3147, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3147, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3147, __FUNCTION__); &lt->u.fn; })->static_function
)
3148 && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3148, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
3149 revert_static_member_fn (decl);
3150
3151 /* If this is a specialization of a member template of a
3152 template class, we want to return the TEMPLATE_DECL, not
3153 the specialization of it. */
3154 if (tsk == tsk_template && !was_template_id)
3155 {
3156 tree result = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3156, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
3157 SET_DECL_TEMPLATE_SPECIALIZATION (tmpl)((((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3157, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
3158 DECL_INITIAL (result)((contains_struct_check ((result), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3158, __FUNCTION__))->decl_common.initial)
= NULL_TREE(tree) __null;
3159 if (have_def)
3160 {
3161 tree parm;
3162 DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3162, __FUNCTION__))->decl_minimal.locus)
= DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3162, __FUNCTION__))->decl_minimal.locus)
;
3163 DECL_SOURCE_LOCATION (result)((contains_struct_check ((result), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3163, __FUNCTION__))->decl_minimal.locus)
3164 = DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3164, __FUNCTION__))->decl_minimal.locus)
;
3165 /* We want to use the argument list specified in the
3166 definition, not in the original declaration. */
3167 DECL_ARGUMENTS (result)((tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3167, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
= DECL_ARGUMENTS (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3167, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
;
3168 for (parm = DECL_ARGUMENTS (result)((tree_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3168, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
; parm;
3169 parm = DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3169, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3169, __FUNCTION__))->common.chain))
)
3170 DECL_CONTEXT (parm)((contains_struct_check ((parm), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3170, __FUNCTION__))->decl_minimal.context)
= result;
3171 }
3172 decl = register_specialization (tmpl, gen_tmpl, targs,
3173 is_friend, 0);
3174 remove_contract_attributes (result);
3175 return decl;
3176 }
3177
3178 /* Set up the DECL_TEMPLATE_INFO for DECL. */
3179 DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3179, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3179, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
= build_template_info (tmpl, targs);
3180
3181 if (was_template_id)
3182 TINFO_USED_TEMPLATE_ID (DECL_TEMPLATE_INFO (decl))(((tree_not_check2 (((tree_check (((((contains_struct_check (
(template_info_decl_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3182, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3182, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3182, __FUNCTION__, (TEMPLATE_INFO)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3182, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1))
= true;
3183
3184 /* Inherit default function arguments from the template
3185 DECL is specializing. */
3186 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3186, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3186, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
)
3187 copy_default_args_to_explicit_spec (decl);
3188
3189 /* This specialization has the same protection as the
3190 template it specializes. */
3191 TREE_PRIVATE (decl)((decl)->base.private_flag) = TREE_PRIVATE (gen_tmpl)((gen_tmpl)->base.private_flag);
3192 TREE_PROTECTED (decl)((decl)->base.protected_flag) = TREE_PROTECTED (gen_tmpl)((gen_tmpl)->base.protected_flag);
3193
3194 /* 7.1.1-1 [dcl.stc]
3195
3196 A storage-class-specifier shall not be specified in an
3197 explicit specialization...
3198
3199 The parser rejects these, so unless action is taken here,
3200 explicit function specializations will always appear with
3201 global linkage.
3202
3203 The action recommended by the C++ CWG in response to C++
3204 defect report 605 is to make the storage class and linkage
3205 of the explicit specialization match the templated function:
3206
3207 http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#605
3208 */
3209 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3209, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((gen_tmpl
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3209, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
)
3210 {
3211 tree tmpl_func = DECL_TEMPLATE_RESULT (gen_tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((gen_tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3211, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
3212 gcc_assert (TREE_CODE (tmpl_func) == FUNCTION_DECL)((void)(!(((enum tree_code) (tmpl_func)->base.code) == FUNCTION_DECL
) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3212, __FUNCTION__), 0 : 0))
;
3213
3214 /* A concept cannot be specialized. */
3215 if (DECL_DECLARED_CONCEPT_P (tmpl_func)(((contains_struct_check ((tmpl_func), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3215, __FUNCTION__))->decl_common.lang_specific)->u.base
.concept_p)
)
3216 {
3217 error ("explicit specialization of function concept %qD",
3218 gen_tmpl);
3219 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3220 }
3221
3222 /* This specialization has the same linkage and visibility as
3223 the function template it specializes. */
3224 TREE_PUBLIC (decl)((decl)->base.public_flag) = TREE_PUBLIC (tmpl_func)((tmpl_func)->base.public_flag);
3225 if (! TREE_PUBLIC (decl)((decl)->base.public_flag))
3226 {
3227 DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3227, __FUNCTION__))->decl_common.lang_flag_5)
= 1;
3228 DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3228, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
= 1;
3229 }
3230 DECL_THIS_STATIC (decl)((contains_struct_check (((tree_check3 ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3230, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL
)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3230, __FUNCTION__))->decl_common.lang_flag_6)
= DECL_THIS_STATIC (tmpl_func)((contains_struct_check (((tree_check3 ((tmpl_func), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3230, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL
)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3230, __FUNCTION__))->decl_common.lang_flag_6)
;
3231 if (DECL_VISIBILITY_SPECIFIED (tmpl_func)((contains_struct_check ((tmpl_func), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3231, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
3232 {
3233 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3233, __FUNCTION__))->decl_with_vis.visibility_specified
)
= 1;
3234 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3234, __FUNCTION__))->decl_with_vis.visibility)
= DECL_VISIBILITY (tmpl_func)((contains_struct_check ((tmpl_func), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3234, __FUNCTION__))->decl_with_vis.visibility)
;
3235 }
3236 }
3237
3238 /* If DECL is a friend declaration, declared using an
3239 unqualified name, the namespace associated with DECL may
3240 have been set incorrectly. For example, in:
3241
3242 template <typename T> void f(T);
3243 namespace N {
3244 struct S { friend void f<int>(int); }
3245 }
3246
3247 we will have set the DECL_CONTEXT for the friend
3248 declaration to N, rather than to the global namespace. */
3249 if (DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3249, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3249, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3249, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3249, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
3250 DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3250, __FUNCTION__))->decl_minimal.context)
= DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3250, __FUNCTION__))->decl_minimal.context)
;
3251
3252 if (is_friend && !have_def)
3253 /* This is not really a declaration of a specialization.
3254 It's just the name of an instantiation. But, it's not
3255 a request for an instantiation, either. */
3256 SET_DECL_IMPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3256, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 1)
;
3257 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
3258 /* A specialization is not necessarily COMDAT. */
3259 DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3259, __FUNCTION__))->decl_with_vis.comdat_flag)
= (TREE_PUBLIC (decl)((decl)->base.public_flag)
3260 && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3260, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
);
3261 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
3262 DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3262, __FUNCTION__))->decl_with_vis.comdat_flag)
= false;
3263
3264 /* If this is a full specialization, register it so that we can find
3265 it again. Partial specializations will be registered in
3266 process_partial_specialization. */
3267 if (!processing_template_declscope_chain->x_processing_template_decl)
3268 {
3269 warn_spec_missing_attributes (gen_tmpl, decl, attrlist);
3270
3271 decl = register_specialization (decl, gen_tmpl, targs,
3272 is_friend, 0);
3273 }
3274
3275 /* If this is a specialization, splice any contracts that may have
3276 been inherited from the template, removing them. */
3277 if (decl != error_mark_nodeglobal_trees[TI_ERROR_MARK] && DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3277, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
3278 remove_contract_attributes (decl);
3279
3280 /* A 'structor should already have clones. */
3281 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__), 0 : 0))
3282 || 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__), 0 : 0))
3283 || !(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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__), 0 : 0))
3284 || 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__), 0 : 0))
3285 || 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3283, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3284, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (IDENTIFIER_NODE)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3285, __FUNCTION__), 0 : 0))
;
3286 }
3287 }
3288
3289 return decl;
3290}
3291
3292/* Returns 1 iff PARMS1 and PARMS2 are identical sets of template
3293 parameters. These are represented in the same format used for
3294 DECL_TEMPLATE_PARMS. */
3295
3296int
3297comp_template_parms (const_tree parms1, const_tree parms2)
3298{
3299 const_tree p1;
3300 const_tree p2;
3301
3302 if (parms1 == parms2)
3303 return 1;
3304
3305 for (p1 = parms1, p2 = parms2;
3306 p1 != NULL_TREE(tree) __null && p2 != NULL_TREE(tree) __null;
3307 p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3307, __FUNCTION__))->common.chain)
, p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3307, __FUNCTION__))->common.chain)
)
3308 {
3309 tree t1 = TREE_VALUE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3309, __FUNCTION__, (TREE_LIST)))->list.value)
;
3310 tree t2 = TREE_VALUE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3310, __FUNCTION__, (TREE_LIST)))->list.value)
;
3311 int i;
3312
3313 gcc_assert (TREE_CODE (t1) == TREE_VEC)((void)(!(((enum tree_code) (t1)->base.code) == TREE_VEC) ?
fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3313, __FUNCTION__), 0 : 0))
;
3314 gcc_assert (TREE_CODE (t2) == TREE_VEC)((void)(!(((enum tree_code) (t2)->base.code) == TREE_VEC) ?
fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3314, __FUNCTION__), 0 : 0))
;
3315
3316 if (TREE_VEC_LENGTH (t1)((tree_check ((t1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3316, __FUNCTION__, (TREE_VEC)))->base.u.length)
!= TREE_VEC_LENGTH (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3316, __FUNCTION__, (TREE_VEC)))->base.u.length)
)
3317 return 0;
3318
3319 for (i = 0; i < TREE_VEC_LENGTH (t2)((tree_check ((t2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3319, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
3320 {
3321 tree parm1 = TREE_VALUE (TREE_VEC_ELT (t1, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
((t1), (i), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3321, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3321, __FUNCTION__, (TREE_LIST)))->list.value)
;
3322 tree parm2 = TREE_VALUE (TREE_VEC_ELT (t2, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
((t2), (i), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3322, __FUNCTION__)))))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3322, __FUNCTION__, (TREE_LIST)))->list.value)
;
3323
3324 /* If either of the template parameters are invalid, assume
3325 they match for the sake of error recovery. */
3326 if (error_operand_p (parm1) || error_operand_p (parm2))
3327 return 1;
3328
3329 if (TREE_CODE (parm1)((enum tree_code) (parm1)->base.code) != TREE_CODE (parm2)((enum tree_code) (parm2)->base.code))
3330 return 0;
3331
3332 if (TREE_CODE (parm1)((enum tree_code) (parm1)->base.code) == TEMPLATE_TYPE_PARM
3333 && (TEMPLATE_TYPE_PARAMETER_PACK (parm1)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((parm1)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3333, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3333, __FUNCTION__))->type_non_common.values))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3333, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3333, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
3334 == TEMPLATE_TYPE_PARAMETER_PACK (parm2)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((parm2)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3334, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3334, __FUNCTION__))->type_non_common.values))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3334, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3334, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
))
3335 continue;
3336 else if (!same_type_p (TREE_TYPE (parm1), TREE_TYPE (parm2))comptypes ((((contains_struct_check ((parm1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3336, __FUNCTION__))->typed.type)), (((contains_struct_check
((parm2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3336, __FUNCTION__))->typed.type)), 0)
)
3337 return 0;
3338 }
3339 }
3340
3341 if ((p1 != NULL_TREE(tree) __null) != (p2 != NULL_TREE(tree) __null))
3342 /* One set of parameters has more parameters lists than the
3343 other. */
3344 return 0;
3345
3346 return 1;
3347}
3348
3349/* Returns true if two template parameters are declared with
3350 equivalent constraints. */
3351
3352static bool
3353template_parameter_constraints_equivalent_p (const_tree parm1, const_tree parm2)
3354{
3355 tree req1 = TREE_TYPE (parm1)((contains_struct_check ((parm1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3355, __FUNCTION__))->typed.type)
;
3356 tree req2 = TREE_TYPE (parm2)((contains_struct_check ((parm2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3356, __FUNCTION__))->typed.type)
;
3357 if (!req1 != !req2)
3358 return false;
3359 if (req1)
3360 return cp_tree_equal (req1, req2);
3361 return true;
3362}
3363
3364/* Returns true when two template parameters are equivalent. */
3365
3366static bool
3367template_parameters_equivalent_p (const_tree parm1, const_tree parm2)
3368{
3369 tree decl1 = TREE_VALUE (parm1)((tree_check ((parm1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3369, __FUNCTION__, (TREE_LIST)))->list.value)
;
3370 tree decl2 = TREE_VALUE (parm2)((tree_check ((parm2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3370, __FUNCTION__, (TREE_LIST)))->list.value)
;
3371
3372 /* If either of the template parameters are invalid, assume
3373 they match for the sake of error recovery. */
3374 if (error_operand_p (decl1) || error_operand_p (decl2))
3375 return true;
3376
3377 /* ... they declare parameters of the same kind. */
3378 if (TREE_CODE (decl1)((enum tree_code) (decl1)->base.code) != TREE_CODE (decl2)((enum tree_code) (decl2)->base.code))
3379 return false;
3380
3381 /* ... one parameter was introduced by a parameter declaration, then
3382 both are. This case arises as a result of eagerly rewriting declarations
3383 during parsing. */
3384 if (DECL_VIRTUAL_P (decl1)((contains_struct_check ((decl1), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3384, __FUNCTION__))->decl_common.virtual_flag)
!= DECL_VIRTUAL_P (decl2)((contains_struct_check ((decl2), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3384, __FUNCTION__))->decl_common.virtual_flag)
)
3385 return false;
3386
3387 /* ... if either declares a pack, they both do. */
3388 if (template_parameter_pack_p (decl1) != template_parameter_pack_p (decl2))
3389 return false;
3390
3391 if (TREE_CODE (decl1)((enum tree_code) (decl1)->base.code) == PARM_DECL)
3392 {
3393 /* ... if they declare non-type parameters, the types are equivalent. */
3394 if (!same_type_p (TREE_TYPE (decl1), TREE_TYPE (decl2))comptypes ((((contains_struct_check ((decl1), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3394, __FUNCTION__))->typed.type)), (((contains_struct_check
((decl2), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3394, __FUNCTION__))->typed.type)), 0)
)
3395 return false;
3396 }
3397 else if (TREE_CODE (decl2)((enum tree_code) (decl2)->base.code) == TEMPLATE_DECL)
3398 {
3399 /* ... if they declare template template parameters, their template
3400 parameter lists are equivalent. */
3401 if (!template_heads_equivalent_p (decl1, decl2))
3402 return false;
3403 }
3404
3405 /* ... if they are declared with a qualified-concept name, they both
3406 are, and those names are equivalent. */
3407 return template_parameter_constraints_equivalent_p (parm1, parm2);
3408}
3409
3410/* Returns true if two template parameters lists are equivalent.
3411 Two template parameter lists are equivalent if they have the
3412 same length and their corresponding parameters are equivalent.
3413
3414 PARMS1 and PARMS2 are TREE_LISTs containing TREE_VECs: the
3415 data structure returned by DECL_TEMPLATE_PARMS.
3416
3417 This is generally the same implementation as comp_template_parms
3418 except that it also the concept names and arguments used to
3419 introduce parameters. */
3420
3421static bool
3422template_parameter_lists_equivalent_p (const_tree parms1, const_tree parms2)
3423{
3424 if (parms1 == parms2)
3425 return true;
3426
3427 const_tree p1 = parms1;
3428 const_tree p2 = parms2;
3429 while (p1 != NULL_TREE(tree) __null && p2 != NULL_TREE(tree) __null)
3430 {
3431 tree list1 = TREE_VALUE (p1)((tree_check ((p1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3431, __FUNCTION__, (TREE_LIST)))->list.value)
;
3432 tree list2 = TREE_VALUE (p2)((tree_check ((p2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3432, __FUNCTION__, (TREE_LIST)))->list.value)
;
3433
3434 if (TREE_VEC_LENGTH (list1)((tree_check ((list1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3434, __FUNCTION__, (TREE_VEC)))->base.u.length)
!= TREE_VEC_LENGTH (list2)((tree_check ((list2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3434, __FUNCTION__, (TREE_VEC)))->base.u.length)
)
3435 return 0;
3436
3437 for (int i = 0; i < TREE_VEC_LENGTH (list2)((tree_check ((list2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3437, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
3438 {
3439 tree parm1 = TREE_VEC_ELT (list1, i)(*((const_cast<tree *> (tree_vec_elt_check ((list1), (i
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3439, __FUNCTION__)))))
;
3440 tree parm2 = TREE_VEC_ELT (list2, i)(*((const_cast<tree *> (tree_vec_elt_check ((list2), (i
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3440, __FUNCTION__)))))
;
3441 if (!template_parameters_equivalent_p (parm1, parm2))
3442 return false;
3443 }
3444
3445 p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3445, __FUNCTION__))->common.chain)
;
3446 p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3446, __FUNCTION__))->common.chain)
;
3447 }
3448
3449 if ((p1 != NULL_TREE(tree) __null) != (p2 != NULL_TREE(tree) __null))
3450 return false;
3451
3452 return true;
3453}
3454
3455/* Return true if the requires-clause of the template parameter lists are
3456 equivalent and false otherwise. */
3457static bool
3458template_requirements_equivalent_p (const_tree parms1, const_tree parms2)
3459{
3460 tree req1 = TEMPLATE_PARMS_CONSTRAINTS (parms1)((contains_struct_check (((tree_check ((parms1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3460, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3460, __FUNCTION__))->typed.type)
;
3461 tree req2 = TEMPLATE_PARMS_CONSTRAINTS (parms2)((contains_struct_check (((tree_check ((parms2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3461, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3461, __FUNCTION__))->typed.type)
;
3462 if ((req1 != NULL_TREE(tree) __null) != (req2 != NULL_TREE(tree) __null))
3463 return false;
3464 if (!cp_tree_equal (req1, req2))
3465 return false;
3466 return true;
3467}
3468
3469/* Returns true if two template heads are equivalent. 17.6.6.1p6:
3470 Two template heads are equivalent if their template parameter
3471 lists are equivalent and their requires clauses are equivalent.
3472
3473 In pre-C++20, this is equivalent to calling comp_template_parms
3474 for the template parameters of TMPL1 and TMPL2. */
3475
3476bool
3477template_heads_equivalent_p (const_tree tmpl1, const_tree tmpl2)
3478{
3479 tree parms1 = DECL_TEMPLATE_PARMS (tmpl1)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3479, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
;
3480 tree parms2 = DECL_TEMPLATE_PARMS (tmpl2)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3480, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
;
3481
3482 /* Don't change the matching rules for pre-C++20. */
3483 if (cxx_dialect < cxx20)
3484 return comp_template_parms (parms1, parms2);
3485
3486 /* ... have the same number of template parameters, and their
3487 corresponding parameters are equivalent. */
3488 if (!template_parameter_lists_equivalent_p (parms1, parms2))
3489 return false;
3490
3491 /* ... if either has a requires-clause, they both do and their
3492 corresponding constraint-expressions are equivalent. */
3493 return template_requirements_equivalent_p (parms1, parms2);
3494}
3495
3496/* Determine whether PARM is a parameter pack. */
3497
3498bool
3499template_parameter_pack_p (const_tree parm)
3500{
3501 /* Determine if we have a non-type template parameter pack. */
3502 if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == PARM_DECL)
3503 return (DECL_TEMPLATE_PARM_P (parm)(((contains_struct_check ((parm), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3503, __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))
3504 && TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm))(((tree_not_check2 (((tree_check ((((contains_struct_check ((
parm), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3504, __FUNCTION__))->decl_common.initial)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3504, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3504, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
);
3505 if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_PARM_INDEX)
3506 return TEMPLATE_PARM_PARAMETER_PACK (parm)(((tree_not_check2 (((tree_check ((parm), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3506, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3506, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
;
3507
3508 /* If this is a list of template parameters, we could get a
3509 TYPE_DECL or a TEMPLATE_DECL. */
3510 if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TYPE_DECL || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_DECL)
3511 parm = TREE_TYPE (parm)((contains_struct_check ((parm), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3511, __FUNCTION__))->typed.type)
;
3512
3513 /* Otherwise it must be a type template parameter. */
3514 return ((TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_TYPE_PARM
3515 || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_TEMPLATE_PARM)
3516 && TEMPLATE_TYPE_PARAMETER_PACK (parm)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((parm)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3516, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3516, __FUNCTION__))->type_non_common.values))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3516, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3516, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
);
3517}
3518
3519/* Determine if T is a function parameter pack. */
3520
3521bool
3522function_parameter_pack_p (const_tree t)
3523{
3524 if (t && TREE_CODE (t)((enum tree_code) (t)->base.code) == PARM_DECL)
3525 return DECL_PACK_P (t)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (t)->base.code))] == tcc_declaration) &&
(((enum tree_code) (((contains_struct_check ((t), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3525, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3525, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION
))
;
3526 return false;
3527}
3528
3529/* Return the function template declaration of PRIMARY_FUNC_TMPL_INST.
3530 PRIMARY_FUNC_TMPL_INST is a primary function template instantiation. */
3531
3532tree
3533get_function_template_decl (const_tree primary_func_tmpl_inst)
3534{
3535 if (! primary_func_tmpl_inst
3536 || TREE_CODE (primary_func_tmpl_inst)((enum tree_code) (primary_func_tmpl_inst)->base.code) != FUNCTION_DECL
3537 || ! primary_template_specialization_p (primary_func_tmpl_inst))
3538 return NULL__null;
3539
3540 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
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3540, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3540, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3540, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3540, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
3541}
3542
3543/* Return true iff the function parameter PARAM_DECL was expanded
3544 from the function parameter pack PACK. */
3545
3546bool
3547function_parameter_expanded_from_pack_p (tree param_decl, tree pack)
3548{
3549 if (DECL_ARTIFICIAL (param_decl)((contains_struct_check ((param_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3549, __FUNCTION__))->decl_common.artificial_flag)
3550 || !function_parameter_pack_p (pack))
3551 return false;
3552
3553 /* The parameter pack and its pack arguments have the same
3554 DECL_PARM_INDEX. */
3555 return DECL_PARM_INDEX (pack)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((pack), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3555, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (pack)->base.code) != PARM_DECL || lt->
u.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3555, __FUNCTION__); &lt->u.parm; })->index)
== DECL_PARM_INDEX (param_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((param_decl), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3555, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (param_decl)->base.code) != PARM_DECL || lt
->u.base.selector != lds_parm) lang_check_failed ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3555, __FUNCTION__); &lt->u.parm; })->index)
;
3556}
3557
3558/* Determine whether ARGS describes a variadic template args list,
3559 i.e., one that is terminated by a template argument pack. */
3560
3561static bool
3562template_args_variadic_p (tree args)
3563{
3564 int nargs;
3565 tree last_parm;
3566
3567 if (args == NULL_TREE(tree) __null)
3568 return false;
3569
3570 args = INNERMOST_TEMPLATE_ARGS (args)(get_innermost_template_args ((args), 1));
3571 nargs = TREE_VEC_LENGTH (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3571, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
3572
3573 if (nargs == 0)
3574 return false;
3575
3576 last_parm = TREE_VEC_ELT (args, nargs - 1)(*((const_cast<tree *> (tree_vec_elt_check ((args), (nargs
- 1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3576, __FUNCTION__)))))
;
3577
3578 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
)
;
3579}
3580
3581/* Generate a new name for the parameter pack name NAME (an
3582 IDENTIFIER_NODE) that incorporates its */
3583
3584static tree
3585make_ith_pack_parameter_name (tree name, int i)
3586{
3587 /* Munge the name to include the parameter index. */
3588#define NUMBUF_LEN128 128
3589 char numbuf[NUMBUF_LEN128];
3590 char* newname;
3591 int newname_len;
3592
3593 if (name == NULL_TREE(tree) __null)
3594 return name;
3595 snprintf (numbuf, NUMBUF_LEN128, "%i", i);
3596 newname_len = IDENTIFIER_LENGTH (name)((tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3596, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.len
)
3597 + strlen (numbuf) + 2;
3598 newname = (char*)alloca (newname_len)__builtin_alloca(newname_len);
3599 snprintf (newname, newname_len,
3600 "%s#%i", IDENTIFIER_POINTER (name)((const char *) (tree_check ((name), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3600, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
, i);
3601 return get_identifier (newname)(__builtin_constant_p (newname) ? get_identifier_with_length (
(newname), strlen (newname)) : get_identifier (newname))
;
3602}
3603
3604/* Return true if T is a primary function, class or alias template
3605 specialization, not including the template pattern. */
3606
3607bool
3608primary_template_specialization_p (const_tree t)
3609{
3610 if (!t)
3611 return false;
3612
3613 if (VAR_OR_FUNCTION_DECL_P (t)(((enum tree_code) (t)->base.code) == VAR_DECL || ((enum tree_code
) (t)->base.code) == FUNCTION_DECL)
)
3614 return (DECL_LANG_SPECIFIC (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3614, __FUNCTION__))->decl_common.lang_specific)
3615 && DECL_USE_TEMPLATE (t)(((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3615, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
3616 && DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3616, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3616, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
3617 && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((contains_struct_check (
(template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3617, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
);
3618 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3618, __FUNCTION__))->type_common.lang_flag_5))
&& !TYPE_DECL_ALIAS_P (TYPE_NAME (t))((contains_struct_check (((tree_check ((((tree_class_check ((
t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3618, __FUNCTION__))->type_common.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3618, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3618, __FUNCTION__))->decl_common.lang_flag_6)
)
3619 return (CLASSTYPE_TEMPLATE_INFO (t)(((tree_class_check (((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3619, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3619, __FUNCTION__))->type_non_common.lang_1))
3620 && CLASSTYPE_USE_TEMPLATE (t)((((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3620, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
3621 && 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__))->type_non_common.lang_1))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3621, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
);
3622 else if (alias_template_specialization_p (t, nt_transparent))
3623 return true;
3624 return false;
3625}
3626
3627/* Return true if PARM is a template template parameter. */
3628
3629bool
3630template_template_parameter_p (const_tree parm)
3631{
3632 return DECL_TEMPLATE_TEMPLATE_PARM_P (parm)(((enum tree_code) (parm)->base.code) == TEMPLATE_DECL &&
(((contains_struct_check ((parm), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3632, __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)))
;
3633}
3634
3635/* Return true iff PARM is a DECL representing a type template
3636 parameter. */
3637
3638bool
3639template_type_parameter_p (const_tree parm)
3640{
3641 return (parm
3642 && (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TYPE_DECL
3643 || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_DECL)
3644 && DECL_TEMPLATE_PARM_P (parm)(((contains_struct_check ((parm), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3644, __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))
);
3645}
3646
3647/* Return the template parameters of T if T is a
3648 primary template instantiation, NULL otherwise. */
3649
3650tree
3651get_primary_template_innermost_parameters (const_tree t)
3652{
3653 tree parms = NULL__null, template_info = NULL__null;
3654
3655 if ((template_info = get_template_info (t))
3656 && primary_template_specialization_p (t))
3657 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3658, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3658, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3658, __FUNCTION__, (TREE_LIST)))->list.value)
3658 (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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3658, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3658, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3658, __FUNCTION__, (TREE_LIST)))->list.value)
;
3659
3660 return parms;
3661}
3662
3663/* Returns the template arguments of T if T is a template instantiation,
3664 NULL otherwise. */
3665
3666tree
3667get_template_innermost_arguments (const_tree t)
3668{
3669 tree args = NULL__null, template_info = NULL__null;
3670
3671 if ((template_info = get_template_info (t))
3672 && TI_ARGS (template_info)((struct tree_template_info*)(tree_check ((template_info), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3672, __FUNCTION__, (TEMPLATE_INFO))))->args
)
3673 args = INNERMOST_TEMPLATE_ARGS (TI_ARGS (template_info))(get_innermost_template_args ((((struct tree_template_info*)(
tree_check ((template_info), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3673, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
;
3674
3675 return args;
3676}
3677
3678/* Return the argument pack elements of T if T is a template argument pack,
3679 NULL otherwise. */
3680
3681tree
3682get_template_argument_pack_elems (const_tree t)
3683{
3684 if (TREE_CODE (t)((enum tree_code) (t)->base.code) != TYPE_ARGUMENT_PACK
3685 && TREE_CODE (t)((enum tree_code) (t)->base.code) != NONTYPE_ARGUMENT_PACK)
3686 return NULL__null;
3687
3688 return ARGUMENT_PACK_ARGS (t)(((enum tree_code) ((tree_check2 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3688, __FUNCTION__, (TYPE_ARGUMENT_PACK), (NONTYPE_ARGUMENT_PACK
))))->base.code) == TYPE_ARGUMENT_PACK ? ((contains_struct_check
((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3688, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((t), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3688, __FUNCTION__))))))
;
3689}
3690
3691/* In an ARGUMENT_PACK_SELECT, the actual underlying argument that the
3692 ARGUMENT_PACK_SELECT represents. */
3693
3694static tree
3695argument_pack_select_arg (tree t)
3696{
3697 tree args = ARGUMENT_PACK_ARGS (ARGUMENT_PACK_SELECT_FROM_PACK (t))(((enum tree_code) ((tree_check2 (((((struct tree_argument_pack_select
*)(tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3697, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3697, __FUNCTION__, (TYPE_ARGUMENT_PACK), (NONTYPE_ARGUMENT_PACK
))))->base.code) == TYPE_ARGUMENT_PACK ? ((contains_struct_check
(((((struct tree_argument_pack_select *)(tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3697, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack
)), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3697, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check (((((struct tree_argument_pack_select
*)(tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3697, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack
)), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3697, __FUNCTION__))))))
;
3698 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3698, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->index)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3698, __FUNCTION__)))))
;
3699
3700 /* If the selected argument is an expansion E, that most likely means we were
3701 called from gen_elem_of_pack_expansion_instantiation during the
3702 substituting of an argument pack (of which the Ith element is a pack
3703 expansion, where I is ARGUMENT_PACK_SELECT_INDEX) into a pack expansion.
3704 In this case, the Ith element resulting from this substituting is going to
3705 be a pack expansion, which pattern is the pattern of E. Let's return the
3706 pattern of E, and gen_elem_of_pack_expansion_instantiation will build the
3707 resulting pack expansion from it. */
3708 if (PACK_EXPANSION_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (arg)->base.code) == EXPR_PACK_EXPANSION
)
)
3709 {
3710 /* Make sure we aren't throwing away arg info. */
3711 gcc_assert (!PACK_EXPANSION_EXTRA_ARGS (arg))((void)(!(!*(((enum tree_code) ((tree_check2 ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3711, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == TYPE_PACK_EXPANSION ? &((tree_class_check
((arg), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3711, __FUNCTION__))->type_non_common.maxval) : &(*(
(const_cast<tree*> (tree_operand_check (((arg)), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3711, __FUNCTION__))))))) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3711, __FUNCTION__), 0 : 0))
;
3712 arg = PACK_EXPANSION_PATTERN (arg)(((enum tree_code) ((tree_check2 ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3712, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check
((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3712, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3712, __FUNCTION__))))))
;
3713 }
3714
3715 return arg;
3716}
3717
3718/* Return a modification of ARGS that's suitable for preserving inside a hash
3719 table. In particular, this replaces each ARGUMENT_PACK_SELECT with its
3720 underlying argument. ARGS is copied (upon modification) iff COW_P. */
3721
3722static tree
3723preserve_args (tree args, bool cow_p = true)
3724{
3725 if (!args)
3726 return NULL_TREE(tree) __null;
3727
3728 for (int i = 0, len = TREE_VEC_LENGTH (args)((tree_check ((args), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3728, __FUNCTION__, (TREE_VEC)))->base.u.length)
; i < len; ++i)
3729 {
3730 tree t = TREE_VEC_ELT (args, i)(*((const_cast<tree *> (tree_vec_elt_check ((args), (i)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3730, __FUNCTION__)))))
;
3731 tree r;
3732 if (!t)
3733 r = NULL_TREE(tree) __null;
3734 else if (TREE_CODE (t)((enum tree_code) (t)->base.code) == ARGUMENT_PACK_SELECT)
3735 r = argument_pack_select_arg (t);
3736 else if (TREE_CODE (t)((enum tree_code) (t)->base.code) == TREE_VEC)
3737 r = preserve_args (t, cow_p);
3738 else
3739 r = t;
3740 if (r != t)
3741 {
3742 if (cow_p)
3743 {
3744 args = copy_template_args (args);
3745 cow_p = false;
3746 }
3747 TREE_VEC_ELT (args, i)(*((const_cast<tree *> (tree_vec_elt_check ((args), (i)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3747, __FUNCTION__)))))
= r;
3748 }
3749 }
3750
3751 return args;
3752}
3753
3754/* True iff FN is a function representing a built-in variadic parameter
3755 pack. */
3756
3757bool
3758builtin_pack_fn_p (tree fn)
3759{
3760 if (!fn
3761 || TREE_CODE (fn)((enum tree_code) (fn)->base.code) != FUNCTION_DECL
3762 || !DECL_IS_UNDECLARED_BUILTIN (fn)(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3762, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
)
3763 return false;
3764
3765 if (id_equal (DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3765, __FUNCTION__))->decl_minimal.name)
, "__integer_pack"))
3766 return true;
3767
3768 return false;
3769}
3770
3771/* True iff CALL is a call to a function representing a built-in variadic
3772 parameter pack. */
3773
3774static bool
3775builtin_pack_call_p (tree call)
3776{
3777 if (TREE_CODE (call)((enum tree_code) (call)->base.code) != CALL_EXPR)
3778 return false;
3779 return builtin_pack_fn_p (CALL_EXPR_FN (call)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3779, __FUNCTION__, (CALL_EXPR)))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3779, __FUNCTION__)))))
);
3780}
3781
3782/* Return a TREE_VEC for the expansion of __integer_pack(HI). */
3783
3784static tree
3785expand_integer_pack (tree call, tree args, tsubst_flags_t complain,
3786 tree in_decl)
3787{
3788 tree ohi = CALL_EXPR_ARG (call, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3788, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3788, __FUNCTION__)))))
;
3789 tree hi = tsubst_copy_and_build (ohi, args, complain, in_decl);
3790
3791 if (instantiation_dependent_expression_p (hi))
3792 {
3793 if (hi != ohi)
3794 {
3795 call = copy_node (call);
3796 CALL_EXPR_ARG (call, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3796, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3796, __FUNCTION__)))))
= hi;
3797 }
3798 tree ex = make_pack_expansion (call, complain);
3799 tree vec = make_tree_vec (1);
3800 TREE_VEC_ELT (vec, 0)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (0),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3800, __FUNCTION__)))))
= ex;
3801 return vec;
3802 }
3803 else
3804 {
3805 hi = instantiate_non_dependent_expr (hi, complain);
3806 hi = cxx_constant_value (hi, complain);
3807 int len = valid_constant_size_p (hi) ? tree_to_shwi (hi) : -1;
3808
3809 /* Calculate the largest value of len that won't make the size of the vec
3810 overflow an int. The compiler will exceed resource limits long before
3811 this, but it seems a decent place to diagnose. */
3812 int max = ((INT_MAX2147483647 - sizeof (tree_vec)) / sizeof (tree)) + 1;
3813
3814 if (len < 0 || len > max)
3815 {
3816 if ((complain & tf_error)
3817 && hi != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3818 error ("argument to %<__integer_pack%> must be between 0 and %d",
3819 max);
3820 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3821 }
3822
3823 tree vec = make_tree_vec (len);
3824
3825 for (int i = 0; i < len; ++i)
3826 TREE_VEC_ELT (vec, i)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (i),
"/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3826, __FUNCTION__)))))
= size_int (i)size_int_kind (i, stk_sizetype);
3827
3828 return vec;
3829 }
3830}
3831
3832/* Return a TREE_VEC for the expansion of built-in template parameter pack
3833 CALL. */
3834
3835static tree
3836expand_builtin_pack_call (tree call, tree args, tsubst_flags_t complain,
3837 tree in_decl)
3838{
3839 if (!builtin_pack_call_p (call))
3840 return NULL_TREE(tree) __null;
3841
3842 tree fn = CALL_EXPR_FN (call)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3842, __FUNCTION__, (CALL_EXPR)))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3842, __FUNCTION__)))))
;
3843
3844 if (id_equal (DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3844, __FUNCTION__))->decl_minimal.name)
, "__integer_pack"))
3845 return expand_integer_pack (call, args, complain, in_decl);
3846
3847 return NULL_TREE(tree) __null;
3848}
3849
3850/* Return true if the tree T has the extra args mechanism for
3851 avoiding partial instantiation. */
3852
3853static bool
3854has_extra_args_mechanism_p (const_tree t)
3855{
3856 return (PACK_EXPANSION_P (t)(((enum tree_code) (t)->base.code) == TYPE_PACK_EXPANSION ||
((enum tree_code) (t)->base.code) == EXPR_PACK_EXPANSION)
/* PACK_EXPANSION_EXTRA_ARGS */
3857 || TREE_CODE (t)((enum tree_code) (t)->base.code) == REQUIRES_EXPR /* REQUIRES_EXPR_EXTRA_ARGS */
3858 || (TREE_CODE (t)((enum tree_code) (t)->base.code) == IF_STMT
3859 && IF_STMT_CONSTEXPR_P (t)((tree_not_check2 (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3859, __FUNCTION__, (IF_STMT)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3859, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)); /* IF_STMT_EXTRA_ARGS */
3860}
3861
3862/* Structure used to track the progress of find_parameter_packs_r. */
3863struct find_parameter_pack_data
3864{
3865 /* TREE_LIST that will contain all of the parameter packs found by
3866 the traversal. */
3867 tree* parameter_packs;
3868
3869 /* Set of AST nodes that have been visited by the traversal. */
3870 hash_set<tree> *visited;
3871
3872 /* True iff we're making a type pack expansion. */
3873 bool type_pack_expansion_p;
3874
3875 /* True iff we found a subtree that has the extra args mechanism. */
3876 bool found_extra_args_tree_p = false;
3877};
3878
3879/* Identifies all of the argument packs that occur in a template
3880 argument and appends them to the TREE_LIST inside DATA, which is a
3881 find_parameter_pack_data structure. This is a subroutine of
3882 make_pack_expansion and uses_parameter_packs. */
3883static tree
3884find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
3885{
3886 tree t = *tp;
3887 struct find_parameter_pack_data* ppd =
3888 (struct find_parameter_pack_data*)data;
3889 bool parameter_pack_p = false;
3890
3891#define WALK_SUBTREE(NODE)do { for_each_template_parm (NODE, keep_template_parm, data, &
ftpi->visited, true, any_template_parm_r); } while (0)
\
3892 cp_walk_tree (&(NODE), &find_parameter_packs_r, \walk_tree_1 (&(NODE), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
3893 ppd, ppd->visited)walk_tree_1 (&(NODE), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
\
3894
3895 /* Don't look through typedefs; we are interested in whether a
3896 parameter pack is actually written in the expression/type we're
3897 looking at, not the target type. */
3898 if (TYPE_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (t)->base.code))] == tcc_type)
&& typedef_variant_p (t))
3899 {
3900 /* But do look at arguments for an alias template. */
3901 if (tree tinfo = TYPE_ALIAS_TEMPLATE_INFO (t)(((contains_struct_check ((((tree_class_check ((t), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3901, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3901, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((template_info_decl_check ((((tree_class_check ((t), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3901, __FUNCTION__))->type_common.name)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3901, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3901, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) : (tree) __null)
)
3902 cp_walk_tree (&TI_ARGS (tinfo),walk_tree_1 (&((struct tree_template_info*)(tree_check ((
tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3902, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3903 &find_parameter_packs_r,walk_tree_1 (&((struct tree_template_info*)(tree_check ((
tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3902, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3904 ppd, ppd->visited)walk_tree_1 (&((struct tree_template_info*)(tree_check ((
tinfo), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3902, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3905 *walk_subtrees = 0;
3906 return NULL_TREE(tree) __null;
3907 }
3908
3909 /* Identify whether this is a parameter pack or not. */
3910 switch (TREE_CODE (t)((enum tree_code) (t)->base.code))
3911 {
3912 case TEMPLATE_PARM_INDEX:
3913 if (TEMPLATE_PARM_PARAMETER_PACK (t)(((tree_not_check2 (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3913, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3913, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
3914 parameter_pack_p = true;
3915 break;
3916
3917 case TEMPLATE_TYPE_PARM:
3918 t = TYPE_MAIN_VARIANT (t)((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3918, __FUNCTION__))->type_common.main_variant)
;
3919 /* FALLTHRU */
3920 case TEMPLATE_TEMPLATE_PARM:
3921 /* If the placeholder appears in the decl-specifier-seq of a function
3922 parameter pack (14.6.3), or the type-specifier-seq of a type-id that
3923 is a pack expansion, the invented template parameter is a template
3924 parameter pack. */
3925 if (ppd->type_pack_expansion_p && is_auto (t))
3926 TEMPLATE_TYPE_PARAMETER_PACK (t)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((t)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3926, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3926, __FUNCTION__))->type_non_common.values))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3926, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3926, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
= true;
3927 if (TEMPLATE_TYPE_PARAMETER_PACK (t)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((t)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3927, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3927, __FUNCTION__))->type_non_common.values))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3927, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3927, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
3928 parameter_pack_p = true;
3929 break;
3930
3931 case FIELD_DECL:
3932 case PARM_DECL:
3933 if (DECL_PACK_P (t)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (t)->base.code))] == tcc_declaration) &&
(((enum tree_code) (((contains_struct_check ((t), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3933, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3933, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION
))
)
3934 {
3935 /* We don't want to walk into the type of a PARM_DECL,
3936 because we don't want to see the type parameter pack. */
3937 *walk_subtrees = 0;
3938 parameter_pack_p = true;
3939 }
3940 break;
3941
3942 case VAR_DECL:
3943 if (DECL_PACK_P (t)((tree_code_type_tmpl <0>::tree_code_type[(int) (((enum
tree_code) (t)->base.code))] == tcc_declaration) &&
(((enum tree_code) (((contains_struct_check ((t), (TS_TYPED)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3943, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3943, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION
))
)
3944 {
3945 /* We don't want to walk into the type of a variadic capture proxy,
3946 because we don't want to see the type parameter pack. */
3947 *walk_subtrees = 0;
3948 parameter_pack_p = true;
3949 }
3950 else if (variable_template_specialization_p (t))
3951 {
3952 cp_walk_tree (&DECL_TI_ARGS (t),walk_tree_1 (&((struct tree_template_info*)(tree_check ((
(((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3953 find_parameter_packs_r,walk_tree_1 (&((struct tree_template_info*)(tree_check ((
(((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3954 ppd, ppd->visited)walk_tree_1 (&((struct tree_template_info*)(tree_check ((
(((contains_struct_check ((template_info_decl_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__)), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3952, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3955 *walk_subtrees = 0;
3956 }
3957 break;
3958
3959 case CALL_EXPR:
3960 if (builtin_pack_call_p (t))
3961 parameter_pack_p = true;
3962 break;
3963
3964 case BASES:
3965 parameter_pack_p = true;
3966 break;
3967 default:
3968 /* Not a parameter pack. */
3969 break;
3970 }
3971
3972 if (parameter_pack_p)
3973 {
3974 /* Add this parameter pack to the list. */
3975 *ppd->parameter_packs = tree_cons (NULL_TREE(tree) __null, t, *ppd->parameter_packs);
3976 }
3977
3978 if (has_extra_args_mechanism_p (t) && !PACK_EXPANSION_P (t)(((enum tree_code) (t)->base.code) == TYPE_PACK_EXPANSION ||
((enum tree_code) (t)->base.code) == EXPR_PACK_EXPANSION)
)
3979 ppd->found_extra_args_tree_p = true;
3980
3981 if (TYPE_P (t)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (t)->base.code))] == tcc_type)
)
3982 cp_walk_tree (&TYPE_CONTEXT (t),walk_tree_1 (&((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3982, __FUNCTION__))->type_common.context), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3983 &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3982, __FUNCTION__))->type_common.context), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3984
3985 /* This switch statement will return immediately if we don't find a
3986 parameter pack. ??? Should some of these be in cp_walk_subtrees? */
3987 switch (TREE_CODE (t)((enum tree_code) (t)->base.code))
3988 {
3989 case BOUND_TEMPLATE_TEMPLATE_PARM:
3990 /* Check the template itself. */
3991 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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3991, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3991, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3991, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3992 &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), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3991, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3991, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)), (TS_TYPED
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3991, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3993 return NULL_TREE(tree) __null;
3994
3995 case DECL_EXPR:
3996 {
3997 tree decl = DECL_EXPR_DECL (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3997, __FUNCTION__, (DECL_EXPR)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 3997, __FUNCTION__)))))
;
3998 /* Ignore the declaration of a capture proxy for a parameter pack. */
3999 if (is_capture_proxy (decl))
4000 *walk_subtrees = 0;
4001 if (is_typedef_decl (decl))
4002 /* Since we stop at typedefs above, we need to look through them at
4003 the point of the DECL_EXPR. */
4004 cp_walk_tree (&DECL_ORIGINAL_TYPE (decl),walk_tree_1 (&((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4004, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
4005 &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((tree_check ((decl), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4004, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
;
4006 return NULL_TREE(tree) __null;
4007 }
4008
4009 case TEMPLATE_DECL:
4010 if (!DECL_TEMPLATE_TEMPLATE_PARM_P (t)(((enum tree_code) (t)->base.code) == TEMPLATE_DECL &&
(((contains_struct_check ((t), (TS_DECL_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4010, __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)))
)
4011 return NULL_TREE(tree) __null;
4012 cp_walk_tree (&TREE_TYPE (t),walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4012, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4013 &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4012, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4014 return NULL_TREE(tree) __null;
4015
4016 case TYPE_PACK_EXPANSION:
4017 case EXPR_PACK_EXPANSION:
4018 *walk_subtrees = 0;
4019 return NULL_TREE(tree) __null;
4020
4021 case INTEGER_TYPE:
4022 cp_walk_tree (&TYPE_MAX_VALUE (t), &find_parameter_packs_r,walk_tree_1 (&((tree_check5 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4022, __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
)
4023 ppd, ppd->visited)walk_tree_1 (&((tree_check5 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4022, __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
)
;
4024 *walk_subtrees = 0;
4025 return NULL_TREE(tree) __null;
4026
4027 case IDENTIFIER_NODE:
4028 cp_walk_tree (&TREE_TYPE (t), &find_parameter_packs_r, ppd,walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4028, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4029 ppd->visited)walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4028, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4030 *walk_subtrees = 0;
4031 return NULL_TREE(tree) __null;
4032
4033 case LAMBDA_EXPR:
4034 {
4035 /* Since we defer implicit capture, look in the parms and body. */
4036 tree fn = lambda_function (t);
4037 cp_walk_tree (&TREE_TYPE (fn), &find_parameter_packs_r, ppd,walk_tree_1 (&((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4037, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4038 ppd->visited)walk_tree_1 (&((contains_struct_check ((fn), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4037, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4039 cp_walk_tree (&DECL_SAVED_TREE (fn), &find_parameter_packs_r, ppd,walk_tree_1 (&((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4039, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
4040 ppd->visited)walk_tree_1 (&((tree_check ((fn), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4039, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
;
4041 return NULL_TREE(tree) __null;
4042 }
4043
4044 case DECLTYPE_TYPE:
4045 {
4046 /* When traversing a DECLTYPE_TYPE_EXPR, we need to set
4047 type_pack_expansion_p to false so that any placeholders
4048 within the expression don't get marked as parameter packs. */
4049 bool type_pack_expansion_p = ppd->type_pack_expansion_p;
4050 ppd->type_pack_expansion_p = false;
4051 cp_walk_tree (&DECLTYPE_TYPE_EXPR (t), &find_parameter_packs_r,walk_tree_1 (&(((tree_class_check (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4051, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4051, __FUNCTION__))->type_non_common.values)), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4052 ppd, ppd->visited)walk_tree_1 (&(((tree_class_check (((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4051, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4051, __FUNCTION__))->type_non_common.values)), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4053 ppd->type_pack_expansion_p = type_pack_expansion_p;
4054 *walk_subtrees = 0;
4055 return NULL_TREE(tree) __null;
4056 }
4057
4058 case IF_STMT:
4059 cp_walk_tree (&IF_COND (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4059, __FUNCTION__, (IF_STMT)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4059, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
4060 ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4059, __FUNCTION__, (IF_STMT)))), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4059, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
;
4061 cp_walk_tree (&THEN_CLAUSE (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4061, __FUNCTION__, (IF_STMT)))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4061, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
4062 ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4061, __FUNCTION__, (IF_STMT)))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4061, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
;
4063 cp_walk_tree (&ELSE_CLAUSE (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4063, __FUNCTION__, (IF_STMT)))), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4063, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
4064 ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4063, __FUNCTION__, (IF_STMT)))), (2), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4063, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
;
4065 /* Don't walk into IF_STMT_EXTRA_ARGS. */
4066 *walk_subtrees = 0;
4067 return NULL_TREE(tree) __null;
4068
4069 case TAG_DEFN:
4070 t = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4070, __FUNCTION__))->typed.type)
;
4071 if (CLASS_TYPE_P (t)(((((enum tree_code) (t)->base.code)) == RECORD_TYPE || ((
(enum tree_code) (t)->base.code)) == UNION_TYPE) &&
((tree_class_check ((t), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4071, __FUNCTION__))->type_common.lang_flag_5))
)
4072 {
4073 /* Local class, need to look through the whole definition.
4074 TYPE_BINFO might be unset for a partial instantiation. */
4075 if (TYPE_BINFO (t)((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4075, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.maxval)
)
4076 for (tree bb : BINFO_BASE_BINFOS (TYPE_BINFO (t))(&(tree_check ((((tree_check3 ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4076, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.maxval)), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4076, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)
)
4077 cp_walk_tree (&BINFO_TYPE (bb), &find_parameter_packs_r,walk_tree_1 (&((contains_struct_check (((tree_check ((bb)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4077, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4077, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4078 ppd, ppd->visited)walk_tree_1 (&((contains_struct_check (((tree_check ((bb)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4077, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4077, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4079 }
4080 else
4081 /* Enum, look at the values. */
4082 for (tree l = TYPE_VALUES (t)((tree_check ((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4082, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
; l; l = TREE_CHAIN (l)((contains_struct_check ((l), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4082, __FUNCTION__))->common.chain)
)
4083 cp_walk_tree (&DECL_INITIAL (TREE_VALUE (l)),walk_tree_1 (&((contains_struct_check ((((tree_check ((l)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4083, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4083, __FUNCTION__))->decl_common.initial), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4084 &find_parameter_packs_r,walk_tree_1 (&((contains_struct_check ((((tree_check ((l)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4083, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4083, __FUNCTION__))->decl_common.initial), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4085 ppd, ppd->visited)walk_tree_1 (&((contains_struct_check ((((tree_check ((l)
, "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4083, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_DECL_COMMON
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4083, __FUNCTION__))->decl_common.initial), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4086 return NULL_TREE(tree) __null;
4087
4088 case FUNCTION_TYPE:
4089 case METHOD_TYPE:
4090 WALK_SUBTREE (TYPE_RAISES_EXCEPTIONS (t))do { for_each_template_parm (((tree_class_check (((tree_check2
((t), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4090, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4090, __FUNCTION__))->type_non_common.lang_1), keep_template_parm
, data, &ftpi->visited, true, any_template_parm_r); } while
(0)
;
4091 break;
4092
4093 default:
4094 return NULL_TREE(tree) __null;
4095 }
4096
4097#undef WALK_SUBTREE
4098
4099 return NULL_TREE(tree) __null;
4100}
4101
4102/* Determines if the expression or type T uses any parameter packs. */
4103tree
4104uses_parameter_packs (tree t)
4105{
4106 tree parameter_packs = NULL_TREE(tree) __null;
4107 struct find_parameter_pack_data ppd;
4108 ppd.parameter_packs = &parameter_packs;
4109 ppd.visited = new hash_set<tree>;
4110 ppd.type_pack_expansion_p = false;
4111 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)
;
4112 delete ppd.visited;
4113 return parameter_packs;
4114}
4115
4116/* Turn ARG, which may be an expression, type, or a TREE_LIST
4117 representation a base-class initializer into a parameter pack
4118 expansion. If all goes well, the resulting node will be an
4119 EXPR_PACK_EXPANSION, TYPE_PACK_EXPANSION, or TREE_LIST,
4120 respectively. */
4121tree
4122make_pack_expansion (tree arg, tsubst_flags_t complain)
4123{
4124 tree result;
4125 tree parameter_packs = NULL_TREE(tree) __null;
4126 bool for_types = false;
4127 struct find_parameter_pack_data ppd;
4128
4129 if (!arg || arg == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4130 return arg;
4131
4132 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TREE_LIST && TREE_PURPOSE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4132, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
4133 {
4134 /* A TREE_LIST with a non-null TREE_PURPOSE is for a base
4135 class initializer. In this case, the TREE_PURPOSE will be a
4136 _TYPE node (representing the base class expansion we're
4137 initializing) and the TREE_VALUE will be a TREE_LIST
4138 containing the initialization arguments.
4139
4140 The resulting expansion looks somewhat different from most
4141 expansions. Rather than returning just one _EXPANSION, we
4142 return a TREE_LIST whose TREE_PURPOSE is a
4143 TYPE_PACK_EXPANSION containing the bases that will be
4144 initialized. The TREE_VALUE will be identical to the
4145 original TREE_VALUE, which is a list of arguments that will
4146 be passed to each base. We do not introduce any new pack
4147 expansion nodes into the TREE_VALUE (although it is possible
4148 that some already exist), because the TREE_PURPOSE and
4149 TREE_VALUE all need to be expanded together with the same
4150 _EXPANSION node. Note that the TYPE_PACK_EXPANSION in the
4151 resulting TREE_PURPOSE will mention the parameter packs in
4152 both the bases and the arguments to the bases. */
4153 tree purpose;
4154 tree value;
4155 tree parameter_packs = NULL_TREE(tree) __null;
4156
4157 /* Determine which parameter packs will be used by the base
4158 class expansion. */
4159 ppd.visited = new hash_set<tree>;
4160 ppd.parameter_packs = &parameter_packs;
4161 ppd.type_pack_expansion_p = false;
4162 gcc_assert (TYPE_P (TREE_PURPOSE (arg)))((void)(!((tree_code_type_tmpl <0>::tree_code_type[(int
) (((enum tree_code) (((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4162, __FUNCTION__, (TREE_LIST)))->list.purpose))->base
.code))] == tcc_type)) ? fancy_abort ("/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4162, __FUNCTION__), 0 : 0))
;
4163 cp_walk_tree (&TREE_PURPOSE (arg), &find_parameter_packs_r,walk_tree_1 (&((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4163, __FUNCTION__, (TREE_LIST)))->list.purpose), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
4164 &ppd, ppd.visited)walk_tree_1 (&((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4163, __FUNCTION__, (TREE_LIST)))->list.purpose), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
;
4165
4166 if (parameter_packs == NULL_TREE(tree) __null)
4167 {
4168 if (complain & tf_error)
4169 error ("base initializer expansion %qT contains no parameter packs",
4170 arg);
4171 delete ppd.visited;
4172 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4173 }
4174
4175 if (TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4175, __FUNCTION__, (TREE_LIST)))->list.value)
!= void_type_nodeglobal_trees[TI_VOID_TYPE])
4176 {
4177 /* Collect the sets of parameter packs used in each of the
4178 initialization arguments. */
4179 for (value = TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4179, __FUNCTION__, (TREE_LIST)))->list.value)
; value; value = TREE_CHAIN (value)((contains_struct_check ((value), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4179, __FUNCTION__))->common.chain)
)
4180 {
4181 /* Determine which parameter packs will be expanded in this
4182 argument. */
4183 cp_walk_tree (&TREE_VALUE (value), &find_parameter_packs_r,walk_tree_1 (&((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4183, __FUNCTION__, (TREE_LIST)))->list.value), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
4184 &ppd, ppd.visited)walk_tree_1 (&((tree_check ((value), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4183, __FUNCTION__, (TREE_LIST)))->list.value), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
;
4185 }
4186 }
4187
4188 delete ppd.visited;
4189
4190 /* Create the pack expansion type for the base type. */
4191 purpose = cxx_make_type (TYPE_PACK_EXPANSION);
4192 PACK_EXPANSION_PATTERN (purpose)(((enum tree_code) ((tree_check2 ((purpose), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4192, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check
((purpose), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4192, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((purpose), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4192, __FUNCTION__))))))
= TREE_PURPOSE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4192, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
4193 PACK_EXPANSION_PARAMETER_PACKS (purpose)*(((enum tree_code) ((tree_check2 ((purpose), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4193, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == EXPR_PACK_EXPANSION ? &(*((const_cast
<tree*> (tree_operand_check ((purpose), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4193, __FUNCTION__))))) : &((tree_class_check (((tree_check
((purpose), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4193, __FUNCTION__, (TYPE_PACK_EXPANSION)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4193, __FUNCTION__))->type_non_common.minval))
= parameter_packs;
4194 PACK_EXPANSION_LOCAL_P (purpose)((tree_not_check2 (((tree_check2 ((purpose), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4194, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4194, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= at_function_scope_p ();
4195
4196 /* Just use structural equality for these TYPE_PACK_EXPANSIONS;
4197 they will rarely be compared to anything. */
4198 SET_TYPE_STRUCTURAL_EQUALITY (purpose)(((tree_class_check ((purpose), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4198, __FUNCTION__))->type_common.canonical) = (tree) __null
)
;
4199
4200 return tree_cons (purpose, TREE_VALUE (arg)((tree_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4200, __FUNCTION__, (TREE_LIST)))->list.value)
, NULL_TREE(tree) __null);
4201 }
4202
4203 if (TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
|| TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL)
4204 for_types = true;
4205
4206 /* Build the PACK_EXPANSION_* node. */
4207 result = for_types
4208 ? cxx_make_type (TYPE_PACK_EXPANSION)
4209 : make_node (EXPR_PACK_EXPANSION);
4210 PACK_EXPANSION_PATTERN (result)(((enum tree_code) ((tree_check2 ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4210, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == TYPE_PACK_EXPANSION ? ((contains_struct_check
((result), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4210, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((result), (0), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4210, __FUNCTION__))))))
= arg;
4211 if (TREE_CODE (result)((enum tree_code) (result)->base.code) == EXPR_PACK_EXPANSION)
4212 {
4213 /* Propagate type and const-expression information. */
4214 TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4214, __FUNCTION__))->typed.type)
= TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4214, __FUNCTION__))->typed.type)
;
4215 TREE_CONSTANT (result)((non_type_check ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4215, __FUNCTION__))->base.constant_flag)
= TREE_CONSTANT (arg)((non_type_check ((arg), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4215, __FUNCTION__))->base.constant_flag)
;
4216 /* Mark this read now, since the expansion might be length 0. */
4217 mark_exp_read (arg);
4218 }
4219 else
4220 /* Just use structural equality for these TYPE_PACK_EXPANSIONS;
4221 they will rarely be compared to anything. */
4222 SET_TYPE_STRUCTURAL_EQUALITY (result)(((tree_class_check ((result), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4222, __FUNCTION__))->type_common.canonical) = (tree) __null
)
;
4223
4224 /* Determine which parameter packs will be expanded. */
4225 ppd.parameter_packs = &parameter_packs;
4226 ppd.visited = new hash_set<tree>;
4227 ppd.type_pack_expansion_p = TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
;
4228 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)
;
4229 delete ppd.visited;
4230
4231 /* Make sure we found some parameter packs. */
4232 if (parameter_packs == NULL_TREE(tree) __null)
4233 {
4234 if (complain & tf_error)
4235 {
4236 if (TYPE_P (arg)(tree_code_type_tmpl <0>::tree_code_type[(int) (((enum tree_code
) (arg)->base.code))] == tcc_type)
)
4237 error ("expansion pattern %qT contains no parameter packs", arg);
4238 else
4239 error ("expansion pattern %qE contains no parameter packs", arg);
4240 }
4241 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4242 }
4243 PACK_EXPANSION_PARAMETER_PACKS (result)*(((enum tree_code) ((tree_check2 ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4243, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
))))->base.code) == EXPR_PACK_EXPANSION ? &(*((const_cast
<tree*> (tree_operand_check ((result), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4243, __FUNCTION__))))) : &((tree_class_check (((tree_check
((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4243, __FUNCTION__, (TYPE_PACK_EXPANSION)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4243, __FUNCTION__))->type_non_common.minval))
= parameter_packs;
4244
4245 PACK_EXPANSION_LOCAL_P (result)((tree_not_check2 (((tree_check2 ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4245, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4245, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= at_function_scope_p ();
4246 if (ppd.found_extra_args_tree_p)
4247 /* If the pattern of this pack expansion contains a subtree that has
4248 the extra args mechanism for avoiding partial instantiation, then
4249 force this pack expansion to also use extra args. Otherwise
4250 partial instantiation of this pack expansion may not lower the
4251 level of some parameter packs within the pattern, which would
4252 confuse tsubst_pack_expansion later (PR101764). */
4253 PACK_EXPANSION_FORCE_EXTRA_ARGS_P (result)((tree_not_check2 (((tree_check2 ((result), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4253, __FUNCTION__, (TYPE_PACK_EXPANSION), (EXPR_PACK_EXPANSION
)))), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4253, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
= true;
4254
4255 return result;
4256}
4257
4258/* Checks T for any "bare" parameter packs, which have not yet been
4259 expanded, and issues an error if any are found. This operation can
4260 only be done on full expressions or types (e.g., an expression
4261 statement, "if" condition, etc.), because we could have expressions like:
4262
4263 foo(f(g(h(args)))...)
4264
4265 where "args" is a parameter pack. check_for_bare_parameter_packs
4266 should not be called for the subexpressions args, h(args),
4267 g(h(args)), or f(g(h(args))), because we would produce erroneous
4268 error messages.
4269
4270 Returns TRUE and emits an error if there were bare parameter packs,
4271 returns FALSE otherwise. */
4272bool
4273check_for_bare_parameter_packs (tree t, location_t loc /* = UNKNOWN_LOCATION */)
4274{
4275 tree parameter_packs = NULL_TREE(tree) __null;
4276 struct find_parameter_pack_data ppd;
4277
4278 if (!processing_template_declscope_chain->x_processing_template_decl || !t || t == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4279 return false;
4280
4281 if (TREE_CODE (t)((enum tree_code) (t)->base.code) == TYPE_DECL)
4282 t = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4282, __FUNCTION__))->typed.type)
;
4283
4284 ppd.parameter_packs = &parameter_packs;
4285 ppd.visited = new hash_set<tree>;
4286 ppd.type_pack_expansion_p = false;
4287 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)
;
4288 delete ppd.visited;
4289
4290 if (!parameter_packs)
4291 return false;
4292
4293 if (loc == UNKNOWN_LOCATION((location_t) 0))
4294 loc = cp_expr_loc_or_input_loc (t);
4295
4296 /* It's OK for a lambda to have an unexpanded parameter pack from the
4297 containing context, but do complain about unexpanded capture packs. */
4298 tree lam = current_lambda_expr ();
4299 if (lam)
4300 lam = TREE_TYPE (lam)((contains_struct_check ((lam), (TS_TYPED), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4300, __FUNCTION__))->typed.type)
;
4301
4302 if (lam && lam != current_class_typescope_chain->class_type)
4303 {
4304 /* We're in a lambda, but it isn't the innermost class.
4305 This should work, but currently doesn't. */
4306 sorry_at (loc, "unexpanded parameter pack in local class in lambda");
4307 return true;
4308 }
4309
4310 if (lam && CLASSTYPE_TEMPLATE_INFO (lam)(((tree_class_check (((tree_check3 ((lam), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4310, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4310, __FUNCTION__))->type_non_common.lang_1))
)
4311 for (; parameter_packs;
4312 parameter_packs = TREE_CHAIN (parameter_packs)((contains_struct_check ((parameter_packs), (TS_COMMON), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4312, __FUNCTION__))->common.chain)
)
4313 {
4314 tree pack = TREE_VALUE (parameter_packs)((tree_check ((parameter_packs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4314, __FUNCTION__, (TREE_LIST)))->list.value)
;
4315 if (is_capture_proxy (pack)
4316 || (TREE_CODE (pack)((enum tree_code) (pack)->base.code) == PARM_DECL
4317 && DECL_CONTEXT (DECL_CONTEXT (pack))((contains_struct_check ((((contains_struct_check ((pack), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4317, __FUNCTION__))->decl_minimal.context)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4317, __FUNCTION__))->decl_minimal.context)
== lam))
4318 break;
4319 }
4320
4321 if (parameter_packs)
4322 {
4323 error_at (loc, "parameter packs not expanded with %<...%>:");
4324 while (parameter_packs)
4325 {
4326 tree pack = TREE_VALUE (parameter_packs)((tree_check ((parameter_packs), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4326, __FUNCTION__, (TREE_LIST)))->list.value)
;
4327 tree name = NULL_TREE(tree) __null;
4328
4329 if (TREE_CODE (pack)((enum tree_code) (pack)->base.code) == TEMPLATE_TYPE_PARM
4330 || TREE_CODE (pack)((enum tree_code) (pack)->base.code) == TEMPLATE_TEMPLATE_PARM)
4331 name = TYPE_NAME (pack)((tree_class_check ((pack), (tcc_type), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4331, __FUNCTION__))->type_common.name)
;
4332 else if (TREE_CODE (pack)((enum tree_code) (pack)->base.code) == TEMPLATE_PARM_INDEX)
4333 name = DECL_NAME (TEMPLATE_PARM_DECL (pack))((contains_struct_check (((((template_parm_index*)(tree_check
((pack), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4333, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->decl)), (TS_DECL_MINIMAL
), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4333, __FUNCTION__))->decl_minimal.name)
;
4334 else if (TREE_CODE (pack)((enum tree_code) (pack)->base.code) == CALL_EXPR)
4335 name = DECL_NAME (CALL_EXPR_FN (pack))((contains_struct_check (((*((const_cast<tree*> (tree_operand_check
(((tree_check ((pack), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4335, __FUNCTION__, (CALL_EXPR)))), (1), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4335, __FUNCTION__)))))), (TS_DECL_MINIMAL), "/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.cc"
, 4335, __FUNCTION__))->decl_minimal.name)
;
4336 else