Bug Summary

File:build/gcc/vec.h
Warning:line 741, column 3
Called C++ object pointer is null

Annotated Source Code

Press '?' to see keyboard shortcuts

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

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

1/* Handle parameterized types (templates) for GNU -*- C++ -*-.
2 Copyright (C) 1992-2021 Free Software Foundation, Inc.
3 Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
4 Rewritten by Jason Merrill (jason@cygnus.com).
5
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#include "system.h"
31#include "coretypes.h"
32#include "cp-tree.h"
33#include "timevar.h"
34#include "stringpool.h"
35#include "varasm.h"
36#include "attribs.h"
37#include "stor-layout.h"
38#include "intl.h"
39#include "c-family/c-objc.h"
40#include "cp-objcp-common.h"
41#include "toplev.h"
42#include "tree-iterator.h"
43#include "type-utils.h"
44#include "gimplify.h"
45#include "gcc-rich-location.h"
46#include "selftest.h"
47#include "target.h"
48
49/* The type of functions taking a tree, and some additional data, and
50 returning an int. */
51typedef int (*tree_fn_t) (tree, void*);
52
53/* The PENDING_TEMPLATES is a list of templates whose instantiations
54 have been deferred, either because their definitions were not yet
55 available, or because we were putting off doing the work. */
56struct GTY ((chain_next ("%h.next"))) pending_template
57{
58 struct pending_template *next;
59 struct tinst_level *tinst;
60};
61
62static GTY(()) struct pending_template *pending_templates;
63static GTY(()) struct pending_template *last_pending_template;
64
65int processing_template_parmlist;
66static int template_header_count;
67
68static vec<int> inline_parm_levels;
69
70static GTY(()) struct tinst_level *current_tinst_level;
71
72static GTY(()) vec<tree, va_gc> *saved_access_scope;
73
74/* Live only within one (recursive) call to tsubst_expr. We use
75 this to pass the statement expression node from the STMT_EXPR
76 to the EXPR_STMT that is its result. */
77static tree cur_stmt_expr;
78
79// -------------------------------------------------------------------------- //
80// Local Specialization Stack
81//
82// Implementation of the RAII helper for creating new local
83// specializations.
84local_specialization_stack::local_specialization_stack (lss_policy policy)
85 : saved (local_specializationsscope_chain->x_local_specializations)
86{
87 if (policy == lss_nop)
88 ;
89 else if (policy == lss_blank || !saved)
90 local_specializationsscope_chain->x_local_specializations = new hash_map<tree, tree>;
91 else
92 local_specializationsscope_chain->x_local_specializations = new hash_map<tree, tree>(*saved);
93}
94
95local_specialization_stack::~local_specialization_stack ()
96{
97 if (local_specializationsscope_chain->x_local_specializations != saved)
98 {
99 delete local_specializationsscope_chain->x_local_specializations;
100 local_specializationsscope_chain->x_local_specializations = saved;
101 }
102}
103
104/* True if we've recursed into fn_type_unification too many times. */
105static bool excessive_deduction_depth;
106
107struct spec_hasher : ggc_ptr_hash<spec_entry>
108{
109 static hashval_t hash (spec_entry *);
110 static bool equal (spec_entry *, spec_entry *);
111};
112
113/* The general template is not in these tables. */
114typedef hash_table<spec_hasher> spec_hash_table;
115static GTY (()) spec_hash_table *decl_specializations;
116static GTY (()) spec_hash_table *type_specializations;
117
118/* Contains canonical template parameter types. The vector is indexed by
119 the TEMPLATE_TYPE_IDX of the template parameter. Each element is a
120 TREE_LIST, whose TREE_VALUEs contain the canonical template
121 parameters of various types and levels. */
122static GTY(()) vec<tree, va_gc> *canonical_template_parms;
123
124#define UNIFY_ALLOW_NONE0 0
125#define UNIFY_ALLOW_MORE_CV_QUAL1 1
126#define UNIFY_ALLOW_LESS_CV_QUAL2 2
127#define UNIFY_ALLOW_DERIVED4 4
128#define UNIFY_ALLOW_INTEGER8 8
129#define UNIFY_ALLOW_OUTER_LEVEL16 16
130#define UNIFY_ALLOW_OUTER_MORE_CV_QUAL32 32
131#define UNIFY_ALLOW_OUTER_LESS_CV_QUAL64 64
132
133enum template_base_result {
134 tbr_incomplete_type,
135 tbr_ambiguous_baseclass,
136 tbr_success
137};
138
139static bool resolve_overloaded_unification (tree, tree, tree, tree,
140 unification_kind_t, int,
141 bool);
142static int try_one_overload (tree, tree, tree, tree, tree,
143 unification_kind_t, int, bool, bool);
144static int unify (tree, tree, tree, tree, int, bool);
145static void add_pending_template (tree);
146static tree reopen_tinst_level (struct tinst_level *);
147static tree tsubst_initializer_list (tree, tree);
148static tree get_partial_spec_bindings (tree, tree, tree);
149static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t,
150 bool, bool);
151static tree coerce_innermost_template_parms (tree, tree, tree, tsubst_flags_t,
152 bool, bool);
153static void tsubst_enum (tree, tree, tree);
154static bool check_instantiated_args (tree, tree, tsubst_flags_t);
155static int check_non_deducible_conversion (tree, tree, int, int,
156 struct conversion **, bool);
157static int maybe_adjust_types_for_deduction (tree, unification_kind_t,
158 tree*, tree*, tree);
159static int type_unification_real (tree, tree, tree, const tree *,
160 unsigned int, int, unification_kind_t,
161 vec<deferred_access_check, va_gc> **,
162 bool);
163static void note_template_header (int);
164static tree convert_nontype_argument_function (tree, tree, tsubst_flags_t);
165static tree convert_nontype_argument (tree, tree, tsubst_flags_t);
166static tree convert_template_argument (tree, tree, tree,
167 tsubst_flags_t, int, tree);
168static tree for_each_template_parm (tree, tree_fn_t, void*,
169 hash_set<tree> *, bool, tree_fn_t = NULL__null);
170static tree expand_template_argument_pack (tree);
171static tree build_template_parm_index (int, int, int, tree, tree);
172static bool inline_needs_template_parms (tree, bool);
173static void push_inline_template_parms_recursive (tree, int);
174static tree reduce_template_parm_level (tree, tree, int, tree, tsubst_flags_t);
175static int mark_template_parm (tree, void *);
176static int template_parm_this_level_p (tree, void *);
177static tree tsubst_friend_function (tree, tree);
178static tree tsubst_friend_class (tree, tree);
179static int can_complete_type_without_circularity (tree);
180static tree get_bindings (tree, tree, tree, bool);
181static int template_decl_level (tree);
182static int check_cv_quals_for_unify (int, tree, tree);
183static int unify_pack_expansion (tree, tree, tree,
184 tree, unification_kind_t, bool, bool);
185static tree copy_template_args (tree);
186static tree tsubst_template_parms (tree, tree, tsubst_flags_t);
187tree most_specialized_partial_spec (tree, tsubst_flags_t);
188static tree tsubst_aggr_type (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 any_template_arguments_need_structural_equality_p (tree);
207static bool dependent_type_p_r (tree);
208static tree tsubst_copy (tree, tree, tsubst_flags_t, tree);
209static tree tsubst_decl (tree, tree, tsubst_flags_t);
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 void register_parameter_specializations (tree, tree);
221static tree enclosing_instantiation_of (tree tctx);
222static void instantiate_body (tree pattern, tree args, tree d, bool nested);
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
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
(TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 235, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
(TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 236, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 237, __FUNCTION__))->decl_common.lang_flag_2))
238 && CLASS_TYPE_P (TREE_TYPE (t))(((((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 238, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 238, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((t
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 238, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 238, __FUNCTION__))->type_common.lang_flag_5))
)
239 push_nested_class (TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 239, __FUNCTION__))->typed.type)
);
240 else if (DECL_CLASS_SCOPE_P (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 240, __FUNCTION__))->decl_minimal.context) && (tree_code_type
[(int) (((enum tree_code) (((contains_struct_check ((t), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 240, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
)
241 push_nested_class (DECL_CONTEXT (t)((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 241, __FUNCTION__))->decl_minimal.context)
);
242 else if (deduction_guide_p (t) && DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 245, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result : t)),
(TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 265, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 266, __FUNCTION__))->decl_common.lang_flag_2))
267 && CLASS_TYPE_P (TREE_TYPE (t))(((((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 267, __FUNCTION__))->typed.type))->base.code)) == RECORD_TYPE
|| (((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 267, __FUNCTION__))->typed.type))->base.code)) == UNION_TYPE
) && ((tree_class_check ((((contains_struct_check ((t
), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 267, __FUNCTION__))->typed.type)), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 267, __FUNCTION__))->type_common.lang_flag_5))
)
268 || DECL_CLASS_SCOPE_P (t)(((contains_struct_check ((t), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 268, __FUNCTION__))->decl_minimal.context) && (tree_code_type
[(int) (((enum tree_code) (((contains_struct_check ((t), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 268, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
269 || (deduction_guide_p (t) && DECL_ARTIFICIAL (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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[(int) (((enum tree_code) (decl)->
base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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)) == RECORD_TYPE
|| (((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 295, __FUNCTION__))->type_common.lang_flag_5)))
296 && CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 296, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 296, __FUNCTION__))->type_non_common.lang_1))
297 && !CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 299, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 299, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 308, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 308, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)
)
309 {
310 if (!DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 312, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 312, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 313, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 313, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 331, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
= template_decl;
332 TI_ARGS (result)((struct tree_template_info*)(tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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[(int) (((enum tree_code) (t)->base.code))]
== tcc_declaration)
&& DECL_LANG_SPECIFIC (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 350, __FUNCTION__))->decl_common.lang_specific)
)
351 tinfo = DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 351, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 353, __FUNCTION__))->decl_common.lang_flag_2))
)
354 t = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 359, __FUNCTION__, (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 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 && PRIMARY_TEMPLATE_P (TI_TEMPLATE (tinfo))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 391, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 391, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 391, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 391, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 391, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
392 && uses_template_parms (INNERMOST_TEMPLATE_ARGS (TI_ARGS (tinfo))(get_innermost_template_args ((((struct tree_template_info*)(
tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 392, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
))
393 ++depth;
394
395 if (DECL_P (type)(tree_code_type[(int) (((enum tree_code) (type)->base.code
))] == tcc_declaration)
)
396 {
397 if (tree fctx = DECL_FRIEND_CONTEXT (type)(((((enum tree_code) (type)->base.code) == FUNCTION_DECL ||
(((enum tree_code) (type)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) && !((contains_struct_check
((type), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__))->decl_common.virtual_flag) &&
!((tree_check (((((enum tree_code) (type)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__, (TEMPLATE_DECL))))))))->result : type
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)) ? __extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (type)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__, (TEMPLATE_DECL))))))))->result : type
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__))->decl_common.lang_specific); if (!((
(enum tree_code) (type)->base.code) == FUNCTION_DECL || ((
(enum tree_code) (type)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->base
.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 397, __FUNCTION__); &lt->u.fn; })->context : (tree
) __null)
)
398 type = fctx;
399 else
400 type = CP_DECL_CONTEXT (type)(!(! (((contains_struct_check ((type), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 400, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((type), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 400, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((type)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 400, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
401 }
402 else if (LAMBDA_TYPE_P (type)(((enum tree_code) (type)->base.code) == RECORD_TYPE &&
((((tree_class_check ((((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name))) && ((tree_check
((((((tree_class_check ((((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name) && (tree_code_type
[(int) (((enum tree_code) (((tree_class_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name))->base.code))]
== tcc_declaration) ? ((contains_struct_check ((((tree_class_check
((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->decl_minimal.name) : ((tree_class_check
((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_common.name)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__, (IDENTIFIER_NODE)))->base.protected_flag
))
&& LAMBDA_TYPE_EXTRA_SCOPE (type)((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 402, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope))
)
403 type = LAMBDA_TYPE_EXTRA_SCOPE (type)((((struct tree_lambda_expr *)(tree_check ((((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 403, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 403, __FUNCTION__, (LAMBDA_EXPR))))->extra_scope))
;
404 else
405 type = CP_TYPE_CONTEXT (type)(!(! (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 405, __FUNCTION__))->type_common.context)) || ((enum tree_code
) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 405, __FUNCTION__))->type_common.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 405, __FUNCTION__))->type_common.context) : cp_global_trees
[CPTI_GLOBAL])
;
406 }
407
408 return depth;
409}
410
411/* Return TRUE if NODE instantiates a template that has arguments of
412 its own, be it directly a primary template or indirectly through a
413 partial specializations. */
414static bool
415instantiates_primary_template_p (tree node)
416{
417 tree tinfo = get_template_info (node);
418 if (!tinfo)
419 return false;
420
421 tree tmpl = TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 421, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
422 if (PRIMARY_TEMPLATE_P (tmpl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 422, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 422, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 422, __FUNCTION__))->typed.type))) == (tmpl))
)
423 return true;
424
425 if (!DECL_TEMPLATE_SPECIALIZATION (tmpl)((((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 425, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
426 return false;
427
428 /* So now we know we have a specialization, but it could be a full
429 or a partial specialization. To tell which, compare the depth of
430 its template arguments with those of its context. */
431
432 tree ctxt = DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 432, __FUNCTION__))->decl_minimal.context)
;
433 tree ctinfo = get_template_info (ctxt);
434 if (!ctinfo)
435 return true;
436
437 return (TMPL_ARGS_DEPTH (TI_ARGS (tinfo))((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__, (TEMPLATE_INFO))))->args && (
(tree_check ((((struct tree_template_info*)(tree_check ((tinfo
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 437, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
438 > TMPL_ARGS_DEPTH (TI_ARGS (ctinfo))((((struct tree_template_info*)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__, (TEMPLATE_INFO))))->args && (
(tree_check ((((struct tree_template_info*)(tree_check ((ctinfo
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((((struct tree_template_info
*)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__, (TEMPLATE_INFO))))->args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((((struct tree_template_info*)(tree_check ((ctinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__, (TEMPLATE_INFO))))->args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 438, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
);
439}
440
441/* Subroutine of maybe_begin_member_template_processing.
442 Returns true if processing DECL needs us to push template parms. */
443
444static bool
445inline_needs_template_parms (tree decl, bool nsdmi)
446{
447 if (!decl || (!nsdmi && ! DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 447, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 447, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info)
))
448 return false;
449
450 return (TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (most_general_template (decl)))((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((most_general_template (decl)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 450, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 450, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 450, __FUNCTION__))))
451 > (processing_template_declscope_chain->x_processing_template_decl + DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 451, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
));
452}
453
454/* Subroutine of maybe_begin_member_template_processing.
455 Push the template parms in PARMS, starting from LEVELS steps into the
456 chain, and ending at the beginning, since template parms are listed
457 innermost first. */
458
459static void
460push_inline_template_parms_recursive (tree parmlist, int levels)
461{
462 tree parms = TREE_VALUE (parmlist)((tree_check ((parmlist), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 462, __FUNCTION__, (TREE_LIST)))->list.value)
;
463 int i;
464
465 if (levels > 1)
466 push_inline_template_parms_recursive (TREE_CHAIN (parmlist)((contains_struct_check ((parmlist), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 466, __FUNCTION__))->common.chain)
, levels - 1);
467
468 ++processing_template_declscope_chain->x_processing_template_decl;
469 current_template_parmsscope_chain->template_parms
470 = tree_cons (size_int (processing_template_decl)size_int_kind (scope_chain->x_processing_template_decl, stk_sizetype
)
,
471 parms, current_template_parmsscope_chain->template_parms);
472 TEMPLATE_PARMS_FOR_INLINE (current_template_parms)((tree_not_check2 ((scope_chain->template_parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 472, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)
= 1;
473
474 begin_scope (TREE_VEC_LENGTH (parms)((tree_check ((parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 474, __FUNCTION__, (TREE_VEC)))->base.u.length)
? sk_template_parms : sk_template_spec,
475 NULL__null);
476 for (i = 0; i < TREE_VEC_LENGTH (parms)((tree_check ((parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 476, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
477 {
478 tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
((parms), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 478, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 478, __FUNCTION__, (TREE_LIST)))->list.value)
;
479
480 if (error_operand_p (parm))
481 continue;
482
483 gcc_assert (DECL_P (parm))((void)(!((tree_code_type[(int) (((enum tree_code) (parm)->
base.code))] == tcc_declaration)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 483, __FUNCTION__), 0 : 0))
;
484
485 switch (TREE_CODE (parm)((enum tree_code) (parm)->base.code))
486 {
487 case TYPE_DECL:
488 case TEMPLATE_DECL:
489 pushdecl (parm);
490 break;
491
492 case PARM_DECL:
493 /* Push the CONST_DECL. */
494 pushdecl (TEMPLATE_PARM_DECL (DECL_INITIAL (parm))(((template_parm_index*)(tree_check ((((contains_struct_check
((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 494, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 494, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->decl)
);
495 break;
496
497 default:
498 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 498, __FUNCTION__))
;
499 }
500 }
501}
502
503/* Restore the template parameter context for a member template, a
504 friend template defined in a class definition, or a non-template
505 member of template class. */
506
507void
508maybe_begin_member_template_processing (tree decl)
509{
510 tree parms;
511 int levels = 0;
512 bool nsdmi = TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FIELD_DECL;
513
514 if (nsdmi)
515 {
516 tree ctx = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 516, __FUNCTION__))->decl_minimal.context)
;
517 decl = (CLASSTYPE_TEMPLATE_INFO (ctx)(((tree_class_check (((tree_check3 ((ctx), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 517, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 517, __FUNCTION__))->type_non_common.lang_1))
518 /* Disregard full specializations (c++/60999). */
519 && uses_template_parms (ctx)
520 ? CLASSTYPE_TI_TEMPLATE (ctx)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((ctx), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 520, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 520, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 520, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
: NULL_TREE(tree) __null);
521 }
522
523 if (inline_needs_template_parms (decl, nsdmi))
524 {
525 parms = DECL_TEMPLATE_PARMS (most_general_template (decl))((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((most_general_template (decl)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 525, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
;
526 levels = TMPL_PARMS_DEPTH (parms)((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((parms), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 526, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 526, __FUNCTION__))))
- processing_template_declscope_chain->x_processing_template_decl;
527
528 if (DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 528, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
529 {
530 --levels;
531 parms = TREE_CHAIN (parms)((contains_struct_check ((parms), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 531, __FUNCTION__))->common.chain)
;
532 }
533
534 push_inline_template_parms_recursive (parms, levels);
535 }
536
537 /* Remember how many levels of template parameters we pushed so that
538 we can pop them later. */
539 inline_parm_levels.safe_push (levels);
540}
541
542/* Undo the effects of maybe_begin_member_template_processing. */
543
544void
545maybe_end_member_template_processing (void)
546{
547 int i;
548 int last;
549
550 if (inline_parm_levels.length () == 0)
551 return;
552
553 last = inline_parm_levels.pop ();
554 for (i = 0; i < last; ++i)
555 {
556 --processing_template_declscope_chain->x_processing_template_decl;
557 current_template_parmsscope_chain->template_parms = TREE_CHAIN (current_template_parms)((contains_struct_check ((scope_chain->template_parms), (TS_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 557, __FUNCTION__))->common.chain)
;
558 poplevel (0, 0, 0);
559 }
560}
561
562/* Return a new template argument vector which contains all of ARGS,
563 but has as its innermost set of arguments the EXTRA_ARGS. */
564
565tree
566add_to_template_args (tree args, tree extra_args)
567{
568 tree new_args;
569 int extra_depth;
570 int i;
571 int j;
572
573 if (args == NULL_TREE(tree) __null || extra_args == error_mark_nodeglobal_trees[TI_ERROR_MARK])
574 return extra_args;
575
576 extra_depth = TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 576, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 576, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 576, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 576, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
577 new_args = make_tree_vec (TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 577, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 577, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 577, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 577, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
+ extra_depth);
578
579 for (i = 1; i <= TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 579, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 579, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 579, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 579, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
; ++i)
580 SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (args, i))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 580, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 580, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 580, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 580, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 580, __FUNCTION__))))) : (args))))
;
581
582 for (j = 1; j <= extra_depth; ++j, ++i)
583 SET_TMPL_ARGS_LEVEL (new_args, i, TMPL_ARGS_LEVEL (extra_args, j))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 583, __FUNCTION__))))) = (((extra_args && ((tree_check
((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 583, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 583, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 583, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), ((j) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 583, __FUNCTION__))))) : (extra_args))))
;
584
585 return new_args;
586}
587
588/* Like add_to_template_args, but only the outermost ARGS are added to
589 the EXTRA_ARGS. In particular, all but TMPL_ARGS_DEPTH
590 (EXTRA_ARGS) levels are added. This function is used to combine
591 the template arguments from a partial instantiation with the
592 template arguments used to attain the full instantiation from the
593 partial instantiation.
594
595 If ARGS is a TEMPLATE_DECL, use its parameters as args. */
596
597tree
598add_outermost_template_args (tree args, tree extra_args)
599{
600 tree new_args;
601
602 if (!args)
603 return extra_args;
604 if (TREE_CODE (args)((enum tree_code) (args)->base.code) == TEMPLATE_DECL)
605 {
606 tree ti = get_template_info (DECL_TEMPLATE_RESULT (args)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 606, __FUNCTION__, (TEMPLATE_DECL))))))))->result
);
607 args = TI_ARGS (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 607, __FUNCTION__, (TEMPLATE_INFO))))->args
;
608 }
609
610 /* If there are more levels of EXTRA_ARGS than there are ARGS,
611 something very fishy is going on. */
612 gcc_assert (TMPL_ARGS_DEPTH (args) >= TMPL_ARGS_DEPTH (extra_args))((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) >=
((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 612, __FUNCTION__), 0 : 0))
;
613
614 /* If *all* the new arguments will be the EXTRA_ARGS, just return
615 them. */
616 if (TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
== TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 616, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
)
617 return extra_args;
618
619 /* For the moment, we make ARGS look like it contains fewer levels. */
620 TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 620, __FUNCTION__, (TREE_VEC)))->base.u.length)
-= TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 620, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 620, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 620, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 620, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
621
622 new_args = add_to_template_args (args, extra_args);
623
624 /* Now, we restore ARGS to its full dimensions. */
625 TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 625, __FUNCTION__, (TREE_VEC)))->base.u.length)
+= TMPL_ARGS_DEPTH (extra_args)((extra_args && ((tree_check ((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 625, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((extra_args
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 625, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((extra_args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 625, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((extra_args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 625, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
626
627 return new_args;
628}
629
630/* Return the N levels of innermost template arguments from the ARGS. */
631
632tree
633get_innermost_template_args (tree args, int n)
634{
635 tree new_args;
636 int extra_levels;
637 int i;
638
639 gcc_assert (n >= 0)((void)(!(n >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 639, __FUNCTION__), 0 : 0))
;
640
641 /* If N is 1, just return the innermost set of template arguments. */
642 if (n == 1)
643 return TMPL_ARGS_LEVEL (args, TMPL_ARGS_DEPTH (args))((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((((args &&
((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) - 1
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 643, __FUNCTION__))))) : (args))
;
644
645 /* If we're not removing anything, just return the arguments we were
646 given. */
647 extra_levels = TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 647, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 647, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 647, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 647, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
- n;
648 gcc_assert (extra_levels >= 0)((void)(!(extra_levels >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 648, __FUNCTION__), 0 : 0))
;
649 if (extra_levels == 0)
650 return args;
651
652 /* Make a new set of arguments, not containing the outer arguments. */
653 new_args = make_tree_vec (n);
654 for (i = 1; i <= n; ++i)
655 SET_TMPL_ARGS_LEVEL (new_args, i,((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i + extra_levels
) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))) : (args))))
656 TMPL_ARGS_LEVEL (args, i + extra_levels))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i + extra_levels
) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 656, __FUNCTION__))))) : (args))))
;
657
658 return new_args;
659}
660
661/* The inverse of get_innermost_template_args: Return all but the innermost
662 EXTRA_LEVELS levels of template arguments from the ARGS. */
663
664static tree
665strip_innermost_template_args (tree args, int extra_levels)
666{
667 tree new_args;
668 int n = TMPL_ARGS_DEPTH (args)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 668, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 668, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 668, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 668, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
- extra_levels;
669 int i;
670
671 gcc_assert (n >= 0)((void)(!(n >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 671, __FUNCTION__), 0 : 0))
;
672
673 /* If N is 1, just return the outermost set of template arguments. */
674 if (n == 1)
675 return TMPL_ARGS_LEVEL (args, 1)((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 675, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 675, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 675, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((1) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 675, __FUNCTION__))))) : (args))
;
676
677 /* If we're not removing anything, just return the arguments we were
678 given. */
679 gcc_assert (extra_levels >= 0)((void)(!(extra_levels >= 0) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 679, __FUNCTION__), 0 : 0))
;
680 if (extra_levels == 0)
681 return args;
682
683 /* Make a new set of arguments, not containing the inner arguments. */
684 new_args = make_tree_vec (n);
685 for (i = 1; i <= n; ++i)
686 SET_TMPL_ARGS_LEVEL (new_args, i,((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))) : (args))))
687 TMPL_ARGS_LEVEL (args, i))((*((const_cast<tree *> (tree_vec_elt_check ((new_args)
, ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))) = (((args && ((tree_check ((
args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))))->base.code) == TREE_VEC) ? (*((const_cast
<tree *> (tree_vec_elt_check ((args), ((i) - 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 687, __FUNCTION__))))) : (args))))
;
688
689 return new_args;
690}
691
692/* We've got a template header coming up; push to a new level for storing
693 the parms. */
694
695void
696begin_template_parm_list (void)
697{
698 /* We use a non-tag-transparent scope here, which causes pushtag to
699 put tags in this scope, rather than in the enclosing class or
700 namespace scope. This is the right thing, since we want
701 TEMPLATE_DECLS, and not TYPE_DECLS for template classes. For a
702 global template class, push_template_decl handles putting the
703 TEMPLATE_DECL into top-level scope. For a nested template class,
704 e.g.:
705
706 template <class T> struct S1 {
707 template <class T> struct S2 {};
708 };
709
710 pushtag contains special code to insert the TEMPLATE_DECL for S2
711 at the right scope. */
712 begin_scope (sk_template_parms, NULL__null);
713 ++processing_template_declscope_chain->x_processing_template_decl;
714 ++processing_template_parmlist;
715 note_template_header (0);
716
717 /* Add a dummy parameter level while we process the parameter list. */
718 current_template_parmsscope_chain->template_parms
719 = tree_cons (size_int (processing_template_decl)size_int_kind (scope_chain->x_processing_template_decl, stk_sizetype
)
,
720 make_tree_vec (0),
721 current_template_parmsscope_chain->template_parms);
722}
723
724/* This routine is called when a specialization is declared. If it is
725 invalid to declare a specialization here, an error is reported and
726 false is returned, otherwise this routine will return true. */
727
728static bool
729check_specialization_scope (void)
730{
731 tree scope = current_scope ();
732
733 /* [temp.expl.spec]
734
735 An explicit specialization shall be declared in the namespace of
736 which the template is a member, or, for member templates, in the
737 namespace of which the enclosing class or enclosing class
738 template is a member. An explicit specialization of a member
739 function, member class or static data member of a class template
740 shall be declared in the namespace of which the class template
741 is a member. */
742 if (scope && TREE_CODE (scope)((enum tree_code) (scope)->base.code) != NAMESPACE_DECL)
743 {
744 error ("explicit specialization in non-namespace scope %qD", scope);
745 return false;
746 }
747
748 /* [temp.expl.spec]
749
750 In an explicit specialization declaration for a member of a class
751 template or a member template that appears in namespace scope,
752 the member template and some of its enclosing class templates may
753 remain unspecialized, except that the declaration shall not
754 explicitly specialize a class member template if its enclosing
755 class templates are not explicitly specialized as well. */
756 if (current_template_parmsscope_chain->template_parms)
757 {
758 error ("enclosing class templates are not explicitly specialized");
759 return false;
760 }
761
762 return true;
763}
764
765/* We've just seen template <>. */
766
767bool
768begin_specialization (void)
769{
770 begin_scope (sk_template_spec, NULL__null);
771 note_template_header (1);
772 return check_specialization_scope ();
773}
774
775/* Called at then end of processing a declaration preceded by
776 template<>. */
777
778void
779end_specialization (void)
780{
781 finish_scope ();
782 reset_specialization ();
783}
784
785/* Any template <>'s that we have seen thus far are not referring to a
786 function specialization. */
787
788void
789reset_specialization (void)
790{
791 processing_specializationscope_chain->x_processing_specialization = 0;
792 template_header_count = 0;
793}
794
795/* We've just seen a template header. If SPECIALIZATION is nonzero,
796 it was of the form template <>. */
797
798static void
799note_template_header (int specialization)
800{
801 processing_specializationscope_chain->x_processing_specialization = specialization;
802 template_header_count++;
803}
804
805/* We're beginning an explicit instantiation. */
806
807void
808begin_explicit_instantiation (void)
809{
810 gcc_assert (!processing_explicit_instantiation)((void)(!(!scope_chain->x_processing_explicit_instantiation
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 810, __FUNCTION__), 0 : 0))
;
811 processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation = true;
812}
813
814
815void
816end_explicit_instantiation (void)
817{
818 gcc_assert (processing_explicit_instantiation)((void)(!(scope_chain->x_processing_explicit_instantiation
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 818, __FUNCTION__), 0 : 0))
;
819 processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation = false;
820}
821
822/* An explicit specialization or partial specialization of TMPL is being
823 declared. Check that the namespace in which the specialization is
824 occurring is permissible. Returns false iff it is invalid to
825 specialize TMPL in the current namespace. */
826
827static bool
828check_specialization_namespace (tree tmpl)
829{
830 tree tpl_ns = decl_namespace_context (tmpl);
831
832 /* [tmpl.expl.spec]
833
834 An explicit specialization shall be declared in a namespace enclosing the
835 specialized template. An explicit specialization whose declarator-id is
836 not qualified shall be declared in the nearest enclosing namespace of the
837 template, or, if the namespace is inline (7.3.1), any namespace from its
838 enclosing namespace set. */
839 if (current_scope() != DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 839, __FUNCTION__))->decl_minimal.context)
840 && !at_namespace_scope_p ())
841 {
842 error ("specialization of %qD must appear at namespace scope", tmpl);
843 return false;
844 }
845
846 if (is_nested_namespace (current_namespacescope_chain->old_namespace, tpl_ns, cxx_dialect < cxx11))
847 /* Same or enclosing namespace. */
848 return true;
849 else
850 {
851 auto_diagnostic_group d;
852 if (permerror (input_location,
853 "specialization of %qD in different namespace", tmpl))
854 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 854, __FUNCTION__))->decl_minimal.locus)
,
855 " from definition of %q#D", tmpl);
856 return false;
857 }
858}
859
860/* SPEC is an explicit instantiation. Check that it is valid to
861 perform this explicit instantiation in the current namespace. */
862
863static void
864check_explicit_instantiation_namespace (tree spec)
865{
866 tree ns;
867
868 /* DR 275: An explicit instantiation shall appear in an enclosing
869 namespace of its template. */
870 ns = decl_namespace_context (spec);
871 if (!is_nested_namespace (current_namespacescope_chain->old_namespace, ns))
872 permerror (input_location, "explicit instantiation of %qD in namespace %qD "
873 "(which does not enclose namespace %qD)",
874 spec, current_namespacescope_chain->old_namespace, ns);
875}
876
877/* Returns the type of a template specialization only if that
878 specialization needs to be defined. Otherwise (e.g., if the type has
879 already been defined), the function returns NULL_TREE. */
880
881static tree
882maybe_new_partial_specialization (tree type)
883{
884 /* An implicit instantiation of an incomplete type implies
885 the definition of a new class template.
886
887 template<typename T>
888 struct S;
889
890 template<typename T>
891 struct S<T*>;
892
893 Here, S<T*> is an implicit instantiation of S whose type
894 is incomplete. */
895 if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 895, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 1)
&& !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 895, __FUNCTION__))->type_common.size) != (tree) __null)
)
896 return type;
897
898 /* It can also be the case that TYPE is a completed specialization.
899 Continuing the previous example, suppose we also declare:
900
901 template<typename T>
902 requires Integral<T>
903 struct S<T*>;
904
905 Here, S<T*> refers to the specialization S<T*> defined
906 above. However, we need to differentiate definitions because
907 we intend to define a new partial specialization. In this case,
908 we rely on the fact that the constraints are different for
909 this declaration than that above.
910
911 Note that we also get here for injected class names and
912 late-parsed template definitions. We must ensure that we
913 do not create new type declarations for those cases. */
914 if (flag_conceptsglobal_options.x_flag_concepts && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 914, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
)
915 {
916 tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 916, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 916, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 916, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
917 tree args = CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 917, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 917, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 917, __FUNCTION__, (TEMPLATE_INFO))))->args
;
918
919 /* If there are no template parameters, this cannot be a new
920 partial template specialization? */
921 if (!current_template_parmsscope_chain->template_parms)
922 return NULL_TREE(tree) __null;
923
924 /* The injected-class-name is not a new partial specialization. */
925 if (DECL_SELF_REFERENCE_P (TYPE_NAME (type))(((enum tree_code) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 925, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 925, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 925, __FUNCTION__))->decl_common.lang_flag_4))
)
926 return NULL_TREE(tree) __null;
927
928 /* If the constraints are not the same as those of the primary
929 then, we can probably create a new specialization. */
930 tree type_constr = current_template_constraints ();
931
932 if (type == TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 932, __FUNCTION__))->typed.type)
)
933 {
934 tree main_constr = get_constraints (tmpl);
935 if (equivalent_constraints (type_constr, main_constr))
936 return NULL_TREE(tree) __null;
937 }
938
939 /* Also, if there's a pre-existing specialization with matching
940 constraints, then this also isn't new. */
941 tree specs = DECL_TEMPLATE_SPECIALIZATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 941, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 941, __FUNCTION__))->decl_common.size)
;
942 while (specs)
943 {
944 tree spec_tmpl = TREE_VALUE (specs)((tree_check ((specs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 944, __FUNCTION__, (TREE_LIST)))->list.value)
;
945 tree spec_args = TREE_PURPOSE (specs)((tree_check ((specs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 945, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
946 tree spec_constr = get_constraints (spec_tmpl);
947 if (comp_template_args (args, spec_args)
948 && equivalent_constraints (type_constr, spec_constr))
949 return NULL_TREE(tree) __null;
950 specs = TREE_CHAIN (specs)((contains_struct_check ((specs), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 950, __FUNCTION__))->common.chain)
;
951 }
952
953 /* Create a new type node (and corresponding type decl)
954 for the newly declared specialization. */
955 tree t = make_class_type (TREE_CODE (type)((enum tree_code) (type)->base.code));
956 CLASSTYPE_DECLARED_CLASS (t)((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 956, __FUNCTION__))->type_with_lang_specific.lang_specific
))->declared_class)
= CLASSTYPE_DECLARED_CLASS (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 956, __FUNCTION__))->type_with_lang_specific.lang_specific
))->declared_class)
;
957 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), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->type_common.lang_flag_5)) &&
!((tree_code_type[(int) (((enum tree_code) (t)->base.code
))] == tcc_type) && ((tree_class_check ((t), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->type_common.name) && ((enum
tree_code) (((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check (((tree_check (
(((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->decl_common.lang_flag_6))) ? (((tree_class_check
((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->type_non_common.lang_1) = (build_template_info
(tmpl, args))) : ((((contains_struct_check ((template_info_decl_check
((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 957, __FUNCTION__))->decl_common.lang_specific) ->u.min
.template_info) = (build_template_info (tmpl, args))))
;
958
959 /* We only need a separate type node for storing the definition of this
960 partial specialization; uses of S<T*> are unconstrained, so all are
961 equivalent. So keep TYPE_CANONICAL the same. */
962 TYPE_CANONICAL (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 962, __FUNCTION__))->type_common.canonical)
= TYPE_CANONICAL (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 962, __FUNCTION__))->type_common.canonical)
;
963
964 /* Build the corresponding type decl. */
965 tree d = create_implicit_typedef (DECL_NAME (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 965, __FUNCTION__))->decl_minimal.name)
, t);
966 DECL_CONTEXT (d)((contains_struct_check ((d), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 966, __FUNCTION__))->decl_minimal.context)
= TYPE_CONTEXT (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 966, __FUNCTION__))->type_common.context)
;
967 DECL_SOURCE_LOCATION (d)((contains_struct_check ((d), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 967, __FUNCTION__))->decl_minimal.locus)
= input_location;
968 TREE_PRIVATE (d)((d)->base.private_flag) = (current_access_specifierscope_chain->access_specifier == access_private_nodeglobal_trees[TI_PRIVATE]);
969 TREE_PROTECTED (d)((d)->base.protected_flag) = (current_access_specifierscope_chain->access_specifier == access_protected_nodeglobal_trees[TI_PROTECTED]);
970
971 set_instantiating_module (d);
972 DECL_MODULE_EXPORT_P (d)((tree_not_check2 ((d), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 972, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
= DECL_MODULE_EXPORT_P (tmpl)((tree_not_check2 ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 972, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_3)
;
973
974 return t;
975 }
976
977 return NULL_TREE(tree) __null;
978}
979
980/* The TYPE is being declared. If it is a template type, that means it
981 is a partial specialization. Do appropriate error-checking. */
982
983tree
984maybe_process_partial_specialization (tree type)
985{
986 tree context;
987
988 if (type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
989 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
990
991 /* A lambda that appears in specialization context is not itself a
992 specialization. */
993 if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 993, __FUNCTION__))->type_common.lang_flag_5))
&& CLASSTYPE_LAMBDA_EXPR (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 993, __FUNCTION__))->type_with_lang_specific.lang_specific
))->lambda_expr)
)
994 return type;
995
996 /* An injected-class-name is not a specialization. */
997 if (DECL_SELF_REFERENCE_P (TYPE_NAME (type))(((enum tree_code) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 997, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check ((((tree_class_check
((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 997, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 997, __FUNCTION__))->decl_common.lang_flag_4))
)
998 return type;
999
1000 if (TREE_CODE (type)((enum tree_code) (type)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM)
1001 {
1002 error ("name of class shadows template template parameter %qD",
1003 TYPE_NAME (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1003, __FUNCTION__))->type_common.name)
);
1004 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1005 }
1006
1007 context = TYPE_CONTEXT (type)((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1007, __FUNCTION__))->type_common.context)
;
1008
1009 if (TYPE_ALIAS_P (type)((tree_code_type[(int) (((enum tree_code) (type)->base.code
))] == tcc_type) && ((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1009, __FUNCTION__))->type_common.name) && ((enum
tree_code) (((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1009, __FUNCTION__))->type_common.name))->base.code) ==
TYPE_DECL && ((contains_struct_check (((tree_check (
(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1009, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1009, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1009, __FUNCTION__))->decl_common.lang_flag_6))
)
1010 {
1011 tree tinfo = TYPE_ALIAS_TEMPLATE_INFO (type)(((contains_struct_check ((((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1011, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1011, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((template_info_decl_check ((((tree_class_check ((type), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1011, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1011, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1011, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) : (tree) __null)
;
1012
1013 if (tinfo && DECL_ALIAS_TEMPLATE_P (TI_TEMPLATE (tinfo))((((enum tree_code) (((struct tree_template_info*)(tree_check
((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)->base.code
) == TEMPLATE_DECL && ((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL) && !((contains_struct_check (
(((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((((struct tree_template_info*)(tree_check
((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1013, __FUNCTION__))->decl_common.artificial_flag))
)
1014 error ("specialization of alias template %qD",
1015 TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1015, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
);
1016 else
1017 error ("explicit specialization of non-template %qT", type);
1018 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1019 }
1020 else if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1020, __FUNCTION__))->type_common.lang_flag_5))
&& CLASSTYPE_USE_TEMPLATE (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1020, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
)
1021 {
1022 /* This is for ordinary explicit specialization and partial
1023 specialization of a template class such as:
1024
1025 template <> class C<int>;
1026
1027 or:
1028
1029 template <class T> class C<T*>;
1030
1031 Make sure that `C<int>' and `C<T*>' are implicit instantiations. */
1032
1033 if (tree t = maybe_new_partial_specialization (type))
1034 {
1035 if (!check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (t)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1035, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1035, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1035, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
)
1036 && !at_namespace_scope_p ())
1037 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1038 SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (t)(((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1038, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) = 2)
;
1039 DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (t))((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1039, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1039, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1039, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1039, __FUNCTION__))->decl_minimal.locus)
= input_location;
1040 if (processing_template_declscope_chain->x_processing_template_decl)
1041 {
1042 tree decl = push_template_decl (TYPE_MAIN_DECL (t)((((contains_struct_check (((tree_class_check ((((tree_class_check
((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1042, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1042, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1042, __FUNCTION__))->common.chain)))
);
1043 if (decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1044 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1045 return TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1045, __FUNCTION__))->typed.type)
;
1046 }
1047 }
1048 else if (CLASSTYPE_TEMPLATE_INSTANTIATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1048, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) & 1)
)
1049 error ("specialization of %qT after instantiation", type);
1050 else if (errorcount(global_dc)->diagnostic_count[(int) (DK_ERROR)] && !processing_specializationscope_chain->x_processing_specialization
1051 && CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1051, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
1052 && !uses_template_parms (CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1052, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1052, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1052, __FUNCTION__, (TEMPLATE_INFO))))->args
))
1053 /* Trying to define a specialization either without a template<> header
1054 or in an inappropriate place. We've already given an error, so just
1055 bail now so we don't actually define the specialization. */
1056 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1057 }
1058 else if (CLASS_TYPE_P (type)(((((enum tree_code) (type)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (type)->base.code)) == UNION_TYPE) &&
((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1058, __FUNCTION__))->type_common.lang_flag_5))
1059 && !CLASSTYPE_USE_TEMPLATE (type)((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1059, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
1060 && CLASSTYPE_TEMPLATE_INFO (type)(((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1060, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1060, __FUNCTION__))->type_non_common.lang_1))
1061 && context && CLASS_TYPE_P (context)(((((enum tree_code) (context)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (context)->base.code)) == UNION_TYPE
) && ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1061, __FUNCTION__))->type_common.lang_flag_5))
1062 && CLASSTYPE_TEMPLATE_INFO (context)(((tree_class_check (((tree_check3 ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1062, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1062, __FUNCTION__))->type_non_common.lang_1))
)
1063 {
1064 /* This is for an explicit specialization of member class
1065 template according to [temp.expl.spec/18]:
1066
1067 template <> template <class U> class C<int>::D;
1068
1069 The context `C<int>' must be an implicit instantiation.
1070 Otherwise this is just a member class template declared
1071 earlier like:
1072
1073 template <> class C<int> { template <class U> class D; };
1074 template <> template <class U> class C<int>::D;
1075
1076 In the first case, `C<int>::D' is a specialization of `C<T>::D'
1077 while in the second case, `C<int>::D' is a primary template
1078 and `C<T>::D' may not exist. */
1079
1080 if (CLASSTYPE_IMPLICIT_INSTANTIATION (context)(((((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1080, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 1)
1081 && !COMPLETE_TYPE_P (type)(((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1081, __FUNCTION__))->type_common.size) != (tree) __null
)
)
1082 {
1083 tree t;
1084 tree tmpl = CLASSTYPE_TI_TEMPLATE (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1084, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1084, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1084, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
1085
1086 if (current_namespacescope_chain->old_namespace
1087 != decl_namespace_context (tmpl))
1088 {
1089 if (permerror (input_location,
1090 "specialization of %qD in different namespace",
1091 type))
1092 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1092, __FUNCTION__))->decl_minimal.locus)
,
1093 "from definition of %q#D", tmpl);
1094 }
1095
1096 /* Check for invalid specialization after instantiation:
1097
1098 template <> template <> class C<int>::D<int>;
1099 template <> template <class U> class C<int>::D; */
1100
1101 for (t = DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1101, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1101, __FUNCTION__))->decl_common.size_unit)
;
1102 t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1102, __FUNCTION__))->common.chain)
)
1103 {
1104 tree inst = TREE_VALUE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1104, __FUNCTION__, (TREE_LIST)))->list.value)
;
1105 if (CLASSTYPE_TEMPLATE_SPECIALIZATION (inst)(((((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1105, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
1106 || !COMPLETE_OR_OPEN_TYPE_P (inst)((((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1106, __FUNCTION__))->type_common.size) != (tree) __null
) || ((((((enum tree_code) (inst)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (inst)->base.code)) == UNION_TYPE) &&
((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1106, __FUNCTION__))->type_common.lang_flag_5)) &&
((((tree_class_check ((inst), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1106, __FUNCTION__))->type_with_lang_specific.lang_specific
))->being_defined)))
)
1107 {
1108 /* We already have a full specialization of this partial
1109 instantiation, or a full specialization has been
1110 looked up but not instantiated. Reassign it to the
1111 new member specialization template. */
1112 spec_entry elt;
1113 spec_entry *entry;
1114
1115 elt.tmpl = most_general_template (tmpl);
1116 elt.args = CLASSTYPE_TI_ARGS (inst)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((inst), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1116, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1116, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1116, __FUNCTION__, (TEMPLATE_INFO))))->args
;
1117 elt.spec = inst;
1118
1119 type_specializations->remove_elt (&elt);
1120
1121 elt.tmpl = tmpl;
1122 CLASSTYPE_TI_ARGS (inst)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((inst), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1122, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1122, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1122, __FUNCTION__, (TEMPLATE_INFO))))->args
1123 = elt.args = INNERMOST_TEMPLATE_ARGS (elt.args)(get_innermost_template_args ((elt.args), 1));
1124
1125 spec_entry **slot
1126 = type_specializations->find_slot (&elt, INSERT);
1127 entry = ggc_alloc<spec_entry> ();
1128 *entry = elt;
1129 *slot = entry;
1130 }
1131 else
1132 /* But if we've had an implicit instantiation, that's a
1133 problem ([temp.expl.spec]/6). */
1134 error ("specialization %qT after instantiation %qT",
1135 type, inst);
1136 }
1137
1138 /* Mark TYPE as a specialization. And as a result, we only
1139 have one level of template argument for the innermost
1140 class template. */
1141 SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1141, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) = 2)
;
1142 DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type))((contains_struct_check ((((((contains_struct_check (((tree_class_check
((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1142, __FUNCTION__))->type_common.main_variant)), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1142, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1142, __FUNCTION__))->common.chain)))), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1142, __FUNCTION__))->decl_minimal.locus)
= input_location;
1143 CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1143, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1143, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1143, __FUNCTION__, (TEMPLATE_INFO))))->args
1144 = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (type))(get_innermost_template_args ((((struct tree_template_info*)(
tree_check (((((tree_class_check (((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1144, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1144, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1144, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
;
1145 }
1146 }
1147 else if (processing_specializationscope_chain->x_processing_specialization)
1148 {
1149 /* Someday C++0x may allow for enum template specialization. */
1150 if (cxx_dialect > cxx98 && TREE_CODE (type)((enum tree_code) (type)->base.code) == ENUMERAL_TYPE
1151 && CLASS_TYPE_P (context)(((((enum tree_code) (context)->base.code)) == RECORD_TYPE
|| (((enum tree_code) (context)->base.code)) == UNION_TYPE
) && ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1151, __FUNCTION__))->type_common.lang_flag_5))
&& CLASSTYPE_USE_TEMPLATE (context)((((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1151, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
)
1152 pedwarn (input_location, OPT_Wpedantic, "template specialization "
1153 "of %qD not allowed by ISO C++", type);
1154 else
1155 {
1156 error ("explicit specialization of non-template %qT", type);
1157 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1158 }
1159 }
1160
1161 return type;
1162}
1163
1164/* Returns nonzero if we can optimize the retrieval of specializations
1165 for TMPL, a TEMPLATE_DECL. In particular, for such a template, we
1166 do not use DECL_TEMPLATE_SPECIALIZATIONS at all. */
1167
1168static inline bool
1169optimize_specialization_lookup_p (tree tmpl)
1170{
1171 return (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1171, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1171, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
1172 && DECL_CLASS_SCOPE_P (tmpl)(((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1172, __FUNCTION__))->decl_minimal.context) && (
tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1172, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
1173 /* DECL_CLASS_SCOPE_P holds of T::f even if T is a template
1174 parameter. */
1175 && CLASS_TYPE_P (DECL_CONTEXT (tmpl))(((((enum tree_code) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1175, __FUNCTION__))->decl_minimal.context))->base.code
)) == RECORD_TYPE || (((enum tree_code) (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1175, __FUNCTION__))->decl_minimal.context))->base.code
)) == UNION_TYPE) && ((tree_class_check ((((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1175, __FUNCTION__))->decl_minimal.context)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1175, __FUNCTION__))->type_common.lang_flag_5))
1176 /* The optimized lookup depends on the fact that the
1177 template arguments for the member function template apply
1178 purely to the containing class, which is not true if the
1179 containing class is an explicit or partial
1180 specialization. */
1181 && !CLASSTYPE_TEMPLATE_SPECIALIZATION (DECL_CONTEXT (tmpl))(((((tree_class_check ((((contains_struct_check ((tmpl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1181, __FUNCTION__))->decl_minimal.context)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1181, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
1182 && !DECL_MEMBER_TEMPLATE_P (tmpl)(((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1182, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1182, __FUNCTION__))->decl_common.lang_flag_1))
1183 && !DECL_CONV_FN_P (tmpl)((((tree_not_check2 (((tree_check ((((contains_struct_check (
(tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1183, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
1184 /* It is possible to have a template that is not a member
1185 template and is not a member of a template class:
1186
1187 template <typename T>
1188 struct S { friend A::f(); };
1189
1190 Here, the friend function is a template, but the context does
1191 not have template information. The optimized lookup relies
1192 on having ARGS be the template arguments for both the class
1193 and the function template. */
1194 && !DECL_UNIQUE_FRIEND_P (DECL_TEMPLATE_RESULT (tmpl))(((contains_struct_check (((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1194, __FUNCTION__, (TEMPLATE_DECL))))))))->result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1194, __FUNCTION__, (FUNCTION_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1194, __FUNCTION__))->decl_common.lang_specific) ->u.
base.friend_or_tls)
);
1195}
1196
1197/* Make sure ARGS doesn't use any inappropriate typedefs; we should have
1198 gone through coerce_template_parms by now. */
1199
1200static void
1201verify_unstripped_args_1 (tree inner)
1202{
1203 for (int i = 0; i < TREE_VEC_LENGTH (inner)((tree_check ((inner), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1203, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
1204 {
1205 tree arg = TREE_VEC_ELT (inner, i)(*((const_cast<tree *> (tree_vec_elt_check ((inner), (i
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1205, __FUNCTION__)))))
;
1206 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL)
1207 /* OK */;
1208 else if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code)
)] == tcc_type)
)
1209 gcc_assert (strip_typedefs (arg, NULL) == arg)((void)(!(strip_typedefs (arg, __null) == arg) ? fancy_abort (
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1209, __FUNCTION__), 0 : 0))
;
1210 else if (ARGUMENT_PACK_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
|| ((enum tree_code) (arg)->base.code) == NONTYPE_ARGUMENT_PACK
)
)
1211 verify_unstripped_args_1 (ARGUMENT_PACK_ARGS (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1211, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1211, __FUNCTION__))))))
);
1212 else if (strip_typedefs (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1212, __FUNCTION__))->typed.type)
, NULL__null) != TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1212, __FUNCTION__))->typed.type)
)
1213 /* Allow typedefs on the type of a non-type argument, since a
1214 parameter can have them. */;
1215 else
1216 gcc_assert (strip_typedefs_expr (arg, NULL) == arg)((void)(!(strip_typedefs_expr (arg, __null) == arg) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1216, __FUNCTION__), 0 : 0))
;
1217 }
1218}
1219
1220static void
1221verify_unstripped_args (tree args)
1222{
1223 ++processing_template_declscope_chain->x_processing_template_decl;
1224 if (!any_dependent_template_arguments_p (args))
1225 verify_unstripped_args_1 (INNERMOST_TEMPLATE_ARGS (args)(get_innermost_template_args ((args), 1)));
1226 --processing_template_declscope_chain->x_processing_template_decl;
1227}
1228
1229/* Retrieve the specialization (in the sense of [temp.spec] - a
1230 specialization is either an instantiation or an explicit
1231 specialization) of TMPL for the given template ARGS. If there is
1232 no such specialization, return NULL_TREE. The ARGS are a vector of
1233 arguments, or a vector of vectors of arguments, in the case of
1234 templates with more than one level of parameters.
1235
1236 If TMPL is a type template and CLASS_SPECIALIZATIONS_P is true,
1237 then we search for a partial specialization matching ARGS. This
1238 parameter is ignored if TMPL is not a class template.
1239
1240 We can also look up a FIELD_DECL, if it is a lambda capture pack; the
1241 result is a NONTYPE_ARGUMENT_PACK. */
1242
1243static tree
1244retrieve_specialization (tree tmpl, tree args, hashval_t hash)
1245{
1246 if (tmpl == NULL_TREE(tree) __null)
1247 return NULL_TREE(tree) __null;
1248
1249 if (args == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1250 return NULL_TREE(tree) __null;
1251
1252 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL((void)(!(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
|| ((enum tree_code) (tmpl)->base.code) == FIELD_DECL) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1253, __FUNCTION__), 0 : 0))
1253 || TREE_CODE (tmpl) == FIELD_DECL)((void)(!(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
|| ((enum tree_code) (tmpl)->base.code) == FIELD_DECL) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1253, __FUNCTION__), 0 : 0))
;
1254
1255 /* There should be as many levels of arguments as there are
1256 levels of parameters. */
1257 gcc_assert (TMPL_ARGS_DEPTH (args)((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) ==
(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? (
(long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__), 0 : 0))
1258 == (TREE_CODE (tmpl) == TEMPLATE_DECL((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) ==
(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? (
(long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__), 0 : 0))
1259 ? TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) ==
(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? (
(long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__), 0 : 0))
1260 : template_class_depth (DECL_CONTEXT (tmpl))))((void)(!(((args && ((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((args), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((args), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1257, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1) ==
(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ? (
(long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1259, __FUNCTION__)))) : template_class_depth (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__))->decl_minimal.context)))) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1260, __FUNCTION__), 0 : 0))
;
1261
1262 if (flag_checkingglobal_options.x_flag_checking)
1263 verify_unstripped_args (args);
1264
1265 /* Lambda functions in templates aren't instantiated normally, but through
1266 tsubst_lambda_expr. */
1267 if (lambda_fn_in_template_p (tmpl))
1268 return NULL_TREE(tree) __null;
1269
1270 if (optimize_specialization_lookup_p (tmpl))
1271 {
1272 /* The template arguments actually apply to the containing
1273 class. Find the class specialization with those
1274 arguments. */
1275 tree class_template = CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (tmpl))((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((((contains_struct_check ((tmpl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1275, __FUNCTION__))->decl_minimal.context)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1275, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1275, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1275, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
1276 tree class_specialization
1277 = retrieve_specialization (class_template, args, 0);
1278 if (!class_specialization)
1279 return NULL_TREE(tree) __null;
1280
1281 /* Find the instance of TMPL. */
1282 tree fns = get_class_binding (class_specialization, DECL_NAME (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1282, __FUNCTION__))->decl_minimal.name)
);
1283 for (ovl_iterator iter (fns); iter; ++iter)
1284 {
1285 tree fn = *iter;
1286 if (tree ti = get_template_info (fn))
1287 if (TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1287, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
== tmpl
1288 /* using-declarations can bring in a different
1289 instantiation of tmpl as a member of a different
1290 instantiation of tmpl's class. We don't want those
1291 here. */
1292 && DECL_CONTEXT (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1292, __FUNCTION__))->decl_minimal.context)
== class_specialization)
1293 return fn;
1294 }
1295 return NULL_TREE(tree) __null;
1296 }
1297 else
1298 {
1299 spec_entry *found;
1300 spec_entry elt;
1301 spec_hash_table *specializations;
1302
1303 elt.tmpl = tmpl;
1304 elt.args = args;
1305 elt.spec = NULL_TREE(tree) __null;
1306
1307 if (DECL_CLASS_TEMPLATE_P (tmpl)((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1307, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1307, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL) && (((enum tree_code) (((struct
tree_template_decl *)(const_cast<union tree_node *> ((
((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1307, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == TYPE_DECL && ((contains_struct_check ((
((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1307, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1307, __FUNCTION__))->decl_common.lang_flag_2)))
)
1308 specializations = type_specializations;
1309 else
1310 specializations = decl_specializations;
1311
1312 if (hash == 0)
1313 hash = spec_hasher::hash (&elt);
1314 found = specializations->find_with_hash (&elt, hash);
1315 if (found)
1316 return found->spec;
1317 }
1318
1319 return NULL_TREE(tree) __null;
1320}
1321
1322/* Like retrieve_specialization, but for local declarations. */
1323
1324tree
1325retrieve_local_specialization (tree tmpl)
1326{
1327 if (local_specializationsscope_chain->x_local_specializations == NULL__null)
1328 return NULL_TREE(tree) __null;
1329
1330 tree *slot = local_specializationsscope_chain->x_local_specializations->get (tmpl);
1331 return slot ? *slot : NULL_TREE(tree) __null;
1332}
1333
1334/* Returns nonzero iff DECL is a specialization of TMPL. */
1335
1336int
1337is_specialization_of (tree decl, tree tmpl)
1338{
1339 tree t;
1340
1341 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
1342 {
1343 for (t = decl;
1344 t != NULL_TREE(tree) __null;
1345 t = DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1345, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1345, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
? DECL_TI_TEMPLATE (t)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1345, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1345, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1345, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
: NULL_TREE(tree) __null)
1346 if (t == tmpl)
1347 return 1;
1348 }
1349 else
1350 {
1351 gcc_assert (TREE_CODE (decl) == TYPE_DECL)((void)(!(((enum tree_code) (decl)->base.code) == TYPE_DECL
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1351, __FUNCTION__), 0 : 0))
;
1352
1353 for (t = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1353, __FUNCTION__))->typed.type)
;
1354 t != NULL_TREE(tree) __null;
1355 t = CLASSTYPE_USE_TEMPLATE (t)((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1355, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
1356 ? TREE_TYPE (CLASSTYPE_TI_TEMPLATE (t))((contains_struct_check ((((struct tree_template_info*)(tree_check
(((((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1356, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1356, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1356, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1356, __FUNCTION__))->typed.type)
: NULL_TREE(tree) __null)
1357 if (same_type_ignoring_top_level_qualifiers_p (t, TREE_TYPE (tmpl)((contains_struct_check ((tmpl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1357, __FUNCTION__))->typed.type)
))
1358 return 1;
1359 }
1360
1361 return 0;
1362}
1363
1364/* Returns nonzero iff DECL is a specialization of friend declaration
1365 FRIEND_DECL according to [temp.friend]. */
1366
1367bool
1368is_specialization_of_friend (tree decl, tree friend_decl)
1369{
1370 bool need_template = true;
1371 int template_depth;
1372
1373 gcc_assert (TREE_CODE (decl) == FUNCTION_DECL((void)(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL
|| ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1374, __FUNCTION__), 0 : 0))
1374 || TREE_CODE (decl) == TYPE_DECL)((void)(!(((enum tree_code) (decl)->base.code) == FUNCTION_DECL
|| ((enum tree_code) (decl)->base.code) == TYPE_DECL) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1374, __FUNCTION__), 0 : 0))
;
1375
1376 /* For [temp.friend/6] when FRIEND_DECL is an ordinary member function
1377 of a template class, we want to check if DECL is a specialization
1378 if this. */
1379 if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) == FUNCTION_DECL
1380 && DECL_TEMPLATE_INFO (friend_decl)(((contains_struct_check ((template_info_decl_check ((friend_decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1380, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1380, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
1381 && !DECL_USE_TEMPLATE (friend_decl)(((contains_struct_check ((friend_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1381, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
)
1382 {
1383 /* We want a TEMPLATE_DECL for `is_specialization_of'. */
1384 friend_decl = DECL_TI_TEMPLATE (friend_decl)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((friend_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1384, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1384, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1384, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
1385 need_template = false;
1386 }
1387 else if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) == TEMPLATE_DECL
1388 && !PRIMARY_TEMPLATE_P (friend_decl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((friend_decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1388, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1388, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1388, __FUNCTION__))->typed.type))) == (friend_decl))
)
1389 need_template = false;
1390
1391 /* There is nothing to do if this is not a template friend. */
1392 if (TREE_CODE (friend_decl)((enum tree_code) (friend_decl)->base.code) != TEMPLATE_DECL)
1393 return false;
1394
1395 if (is_specialization_of (decl, friend_decl))
1396 return true;
1397
1398 /* [temp.friend/6]
1399 A member of a class template may be declared to be a friend of a
1400 non-template class. In this case, the corresponding member of
1401 every specialization of the class template is a friend of the
1402 class granting friendship.
1403
1404 For example, given a template friend declaration
1405
1406 template <class T> friend void A<T>::f();
1407
1408 the member function below is considered a friend
1409
1410 template <> struct A<int> {
1411 void f();
1412 };
1413
1414 For this type of template friend, TEMPLATE_DEPTH below will be
1415 nonzero. To determine if DECL is a friend of FRIEND, we first
1416 check if the enclosing class is a specialization of another. */
1417
1418 template_depth = template_class_depth (CP_DECL_CONTEXT (friend_decl)(!(! (((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1418, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1418, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((friend_decl
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1418, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
);
1419 if (template_depth
1420 && DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1420, __FUNCTION__))->decl_minimal.context) && (
tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1420, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
1421 && is_specialization_of (TYPE_NAME (DECL_CONTEXT (decl))((tree_class_check ((((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1421, __FUNCTION__))->decl_minimal.context)), (tcc_type)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1421, __FUNCTION__))->type_common.name)
,
1422 CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (friend_decl))((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1422, __FUNCTION__))->decl_minimal.context)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1422, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1422, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1422, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
))
1423 {
1424 /* Next, we check the members themselves. In order to handle
1425 a few tricky cases, such as when FRIEND_DECL's are
1426
1427 template <class T> friend void A<T>::g(T t);
1428 template <class T> template <T t> friend void A<T>::h();
1429
1430 and DECL's are
1431
1432 void A<int>::g(int);
1433 template <int> void A<int>::h();
1434
1435 we need to figure out ARGS, the template arguments from
1436 the context of DECL. This is required for template substitution
1437 of `T' in the function parameter of `g' and template parameter
1438 of `h' in the above examples. Here ARGS corresponds to `int'. */
1439
1440 tree context = DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1440, __FUNCTION__))->decl_minimal.context)
;
1441 tree args = NULL_TREE(tree) __null;
1442 int current_depth = 0;
1443
1444 while (current_depth < template_depth)
1445 {
1446 if (CLASSTYPE_TEMPLATE_INFO (context)(((tree_class_check (((tree_check3 ((context), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1446, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1446, __FUNCTION__))->type_non_common.lang_1))
)
1447 {
1448 if (current_depth == 0)
1449 args = TYPE_TI_ARGS (context)(((struct tree_template_info*)(tree_check (((((enum tree_code
) (context)->base.code) == ENUMERAL_TYPE || ((enum tree_code
) (context)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM ||
(((enum tree_code) (context)->base.code) == RECORD_TYPE ||
((enum tree_code) (context)->base.code) == UNION_TYPE || (
(enum tree_code) (context)->base.code) == QUAL_UNION_TYPE)
? ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1449, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1449, __FUNCTION__, (TEMPLATE_INFO))))->args)
;
1450 else
1451 args = add_to_template_args (TYPE_TI_ARGS (context)(((struct tree_template_info*)(tree_check (((((enum tree_code
) (context)->base.code) == ENUMERAL_TYPE || ((enum tree_code
) (context)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM ||
(((enum tree_code) (context)->base.code) == RECORD_TYPE ||
((enum tree_code) (context)->base.code) == UNION_TYPE || (
(enum tree_code) (context)->base.code) == QUAL_UNION_TYPE)
? ((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1451, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1451, __FUNCTION__, (TEMPLATE_INFO))))->args)
, args);
1452 current_depth++;
1453 }
1454 context = TYPE_CONTEXT (context)((tree_class_check ((context), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1454, __FUNCTION__))->type_common.context)
;
1455 }
1456
1457 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
1458 {
1459 bool is_template;
1460 tree friend_type;
1461 tree decl_type;
1462 tree friend_args_type;
1463 tree decl_args_type;
1464
1465 /* Make sure that both DECL and FRIEND_DECL are templates or
1466 non-templates. */
1467 is_template = DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1467, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1467, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
1468 && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((contains_struct_check (
(template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1468, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
;
1469 if (need_template ^ is_template)
1470 return false;
1471 else if (is_template)
1472 {
1473 /* If both are templates, check template parameter list. */
1474 tree friend_parms
1475 = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_decl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((friend_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1475, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1476 args, tf_none);
1477 if (!comp_template_parms
1478 (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (decl))((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((((struct tree_template_info*)(tree_check
(((((contains_struct_check ((template_info_decl_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1478, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1478, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1478, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1478, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1479 friend_parms))
1480 return false;
1481
1482 decl_type = TREE_TYPE (DECL_TI_TEMPLATE (decl))((contains_struct_check ((((struct tree_template_info*)(tree_check
(((((contains_struct_check ((template_info_decl_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1482, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1482, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1482, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1482, __FUNCTION__))->typed.type)
;
1483 }
1484 else
1485 decl_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1485, __FUNCTION__))->typed.type)
;
1486
1487 friend_type = tsubst_function_type (TREE_TYPE (friend_decl)((contains_struct_check ((friend_decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1487, __FUNCTION__))->typed.type)
, args,
1488 tf_none, NULL_TREE(tree) __null);
1489 if (friend_type == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1490 return false;
1491
1492 /* Check if return types match. */
1493 if (!same_type_p (TREE_TYPE (decl_type), TREE_TYPE (friend_type))comptypes ((((contains_struct_check ((decl_type), (TS_TYPED),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1493, __FUNCTION__))->typed.type)), (((contains_struct_check
((friend_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1493, __FUNCTION__))->typed.type)), 0)
)
1494 return false;
1495
1496 /* Check if function parameter types match, ignoring the
1497 `this' parameter. */
1498 friend_args_type = TYPE_ARG_TYPES (friend_type)((tree_check2 ((friend_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1498, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1499 decl_args_type = TYPE_ARG_TYPES (decl_type)((tree_check2 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1499, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
1500 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (friend_decl)(((enum tree_code) (((contains_struct_check ((friend_decl), (
TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1500, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
1501 friend_args_type = TREE_CHAIN (friend_args_type)((contains_struct_check ((friend_args_type), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1501, __FUNCTION__))->common.chain)
;
1502 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1502, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
1503 decl_args_type = TREE_CHAIN (decl_args_type)((contains_struct_check ((decl_args_type), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1503, __FUNCTION__))->common.chain)
;
1504
1505 return compparms (decl_args_type, friend_args_type);
1506 }
1507 else
1508 {
1509 /* DECL is a TYPE_DECL */
1510 bool is_template;
1511 tree decl_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1511, __FUNCTION__))->typed.type)
;
1512
1513 /* Make sure that both DECL and FRIEND_DECL are templates or
1514 non-templates. */
1515 is_template
1516 = CLASSTYPE_TEMPLATE_INFO (decl_type)(((tree_class_check (((tree_check3 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1516, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1516, __FUNCTION__))->type_non_common.lang_1))
1517 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (decl_type))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((tree_class_check (((tree_check3
((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((decl_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1517, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
;
1518
1519 if (need_template ^ is_template)
1520 return false;
1521 else if (is_template)
1522 {
1523 tree friend_parms;
1524 /* If both are templates, check the name of the two
1525 TEMPLATE_DECL's first because is_friend didn't. */
1526 if (DECL_NAME (CLASSTYPE_TI_TEMPLATE (decl_type))((contains_struct_check ((((struct tree_template_info*)(tree_check
(((((tree_class_check (((tree_check3 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1526, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1526, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1526, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1526, __FUNCTION__))->decl_minimal.name)
1527 != DECL_NAME (friend_decl)((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1527, __FUNCTION__))->decl_minimal.name)
)
1528 return false;
1529
1530 /* Now check template parameter list. */
1531 friend_parms
1532 = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend_decl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((friend_decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1532, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1533 args, tf_none);
1534 return comp_template_parms
1535 (DECL_TEMPLATE_PARMS (CLASSTYPE_TI_TEMPLATE (decl_type))((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((((struct tree_template_info*)(tree_check
(((((tree_class_check (((tree_check3 ((decl_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1535, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1535, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1535, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1535, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
1536 friend_parms);
1537 }
1538 else
1539 return (DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1539, __FUNCTION__))->decl_minimal.name)
1540 == DECL_NAME (friend_decl)((contains_struct_check ((friend_decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1540, __FUNCTION__))->decl_minimal.name)
);
1541 }
1542 }
1543 return false;
1544}
1545
1546/* Register the specialization SPEC as a specialization of TMPL with
1547 the indicated ARGS. IS_FRIEND indicates whether the specialization
1548 is actually just a friend declaration. ATTRLIST is the list of
1549 attributes that the specialization is declared with or NULL when
1550 it isn't. Returns SPEC, or an equivalent prior declaration, if
1551 available.
1552
1553 We also store instantiations of field packs in the hash table, even
1554 though they are not themselves templates, to make lookup easier. */
1555
1556static tree
1557register_specialization (tree spec, tree tmpl, tree args, bool is_friend,
1558 hashval_t hash)
1559{
1560 tree fn;
1561 spec_entry **slot = NULL__null;
1562 spec_entry elt;
1563
1564 gcc_assert ((TREE_CODE (tmpl) == TEMPLATE_DECL && DECL_P (spec))((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
&& (tree_code_type[(int) (((enum tree_code) (spec)->
base.code))] == tcc_declaration)) || (((enum tree_code) (tmpl
)->base.code) == FIELD_DECL && ((enum tree_code) (
spec)->base.code) == NONTYPE_ARGUMENT_PACK)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1566, __FUNCTION__), 0 : 0))
1565 || (TREE_CODE (tmpl) == FIELD_DECL((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
&& (tree_code_type[(int) (((enum tree_code) (spec)->
base.code))] == tcc_declaration)) || (((enum tree_code) (tmpl
)->base.code) == FIELD_DECL && ((enum tree_code) (
spec)->base.code) == NONTYPE_ARGUMENT_PACK)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1566, __FUNCTION__), 0 : 0))
1566 && TREE_CODE (spec) == NONTYPE_ARGUMENT_PACK))((void)(!((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL
&& (tree_code_type[(int) (((enum tree_code) (spec)->
base.code))] == tcc_declaration)) || (((enum tree_code) (tmpl
)->base.code) == FIELD_DECL && ((enum tree_code) (
spec)->base.code) == NONTYPE_ARGUMENT_PACK)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1566, __FUNCTION__), 0 : 0))
;
1567
1568 if (TREE_CODE (spec)((enum tree_code) (spec)->base.code) == FUNCTION_DECL
1569 && uses_template_parms (DECL_TI_ARGS (spec)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((spec), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1569, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1569, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1569, __FUNCTION__, (TEMPLATE_INFO))))->args
))
1570 /* This is the FUNCTION_DECL for a partial instantiation. Don't
1571 register it; we want the corresponding TEMPLATE_DECL instead.
1572 We use `uses_template_parms (DECL_TI_ARGS (spec))' rather than
1573 the more obvious `uses_template_parms (spec)' to avoid problems
1574 with default function arguments. In particular, given
1575 something like this:
1576
1577 template <class T> void f(T t1, T t = T())
1578
1579 the default argument expression is not substituted for in an
1580 instantiation unless and until it is actually needed. */
1581 return spec;
1582
1583 if (optimize_specialization_lookup_p (tmpl))
1584 /* We don't put these specializations in the hash table, but we might
1585 want to give an error about a mismatch. */
1586 fn = retrieve_specialization (tmpl, args, 0);
1587 else
1588 {
1589 elt.tmpl = tmpl;
1590 elt.args = args;
1591 elt.spec = spec;
1592
1593 if (hash == 0)
1594 hash = spec_hasher::hash (&elt);
1595
1596 slot = decl_specializations->find_slot_with_hash (&elt, hash, INSERT);
1597 if (*slot)
1598 fn = (*slot)->spec;
1599 else
1600 fn = NULL_TREE(tree) __null;
1601 }
1602
1603 /* We can sometimes try to re-register a specialization that we've
1604 already got. In particular, regenerate_decl_from_template calls
1605 duplicate_decls which will update the specialization list. But,
1606 we'll still get called again here anyhow. It's more convenient
1607 to simply allow this than to try to prevent it. */
1608 if (fn == spec)
1609 return spec;
1610 else if (fn && DECL_TEMPLATE_SPECIALIZATION (spec)((((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1610, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
1611 {
1612 if (DECL_TEMPLATE_INSTANTIATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1612, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) & 1)
)
1613 {
1614 if (DECL_ODR_USED (fn)(((contains_struct_check (((tree_check2 ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1614, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL)))), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1614, __FUNCTION__))->decl_common.lang_specific) ->u.
base.odr_used)
1615 || DECL_EXPLICIT_INSTANTIATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1615, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 3)
)
1616 {
1617 error ("specialization of %qD after instantiation",
1618 fn);
1619 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1620 }
1621 else
1622 {
1623 tree clone;
1624 /* This situation should occur only if the first
1625 specialization is an implicit instantiation, the
1626 second is an explicit specialization, and the
1627 implicit instantiation has not yet been used. That
1628 situation can occur if we have implicitly
1629 instantiated a member function and then specialized
1630 it later.
1631
1632 We can also wind up here if a friend declaration that
1633 looked like an instantiation turns out to be a
1634 specialization:
1635
1636 template <class T> void foo(T);
1637 class S { friend void foo<>(int) };
1638 template <> void foo(int);
1639
1640 We transform the existing DECL in place so that any
1641 pointers to it become pointers to the updated
1642 declaration.
1643
1644 If there was a definition for the template, but not
1645 for the specialization, we want this to look as if
1646 there were no definition, and vice versa. */
1647 DECL_INITIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1647, __FUNCTION__))->decl_common.initial)
= NULL_TREE(tree) __null;
1648 duplicate_decls (spec, fn, /*hiding=*/is_friend);
1649 /* The call to duplicate_decls will have applied
1650 [temp.expl.spec]:
1651
1652 An explicit specialization of a function template
1653 is inline only if it is explicitly declared to be,
1654 and independently of whether its function template
1655 is.
1656
1657 to the primary function; now copy the inline bits to
1658 the various clones. */
1659 FOR_EACH_CLONE (clone, fn)if (!(((enum tree_code) (fn)->base.code) == FUNCTION_DECL &&
((((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((fn), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ; else for (clone = (((contains_struct_check
(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->common.chain)); clone && (
((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((clone
), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check ((clone)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check ((clone),
(TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER]))); clone = (((contains_struct_check (
((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1659, __FUNCTION__))->common.chain)))
1660 {
1661 DECL_DECLARED_INLINE_P (clone)((tree_check ((clone), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1661, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
1662 = DECL_DECLARED_INLINE_P (fn)((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1662, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
;
1663 DECL_SOURCE_LOCATION (clone)((contains_struct_check ((clone), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1663, __FUNCTION__))->decl_minimal.locus)
1664 = DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1664, __FUNCTION__))->decl_minimal.locus)
;
1665 DECL_DELETED_FN (clone)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (clone)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((clone), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1665, __FUNCTION__, (TEMPLATE_DECL))))))))->result : clone
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1665, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (clone)->base.code) == FUNCTION_DECL || (
((enum tree_code) (clone)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((clone), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1665, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((clone
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1665, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1665, __FUNCTION__); &lt->u.fn; })->min.base.threadprivate_or_deleted_p
)
1666 = DECL_DELETED_FN (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1666, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1666, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1666, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1666, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1666, __FUNCTION__); &lt->u.fn; })->min.base.threadprivate_or_deleted_p
)
;
1667 }
1668 check_specialization_namespace (tmpl);
1669
1670 return fn;
1671 }
1672 }
1673 else if (DECL_TEMPLATE_SPECIALIZATION (fn)((((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1673, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
)
1674 {
1675 tree dd = duplicate_decls (spec, fn, /*hiding=*/is_friend);
1676 if (dd == error_mark_nodeglobal_trees[TI_ERROR_MARK])
1677 /* We've already complained in duplicate_decls. */
1678 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
1679
1680 if (dd == NULL_TREE(tree) __null && DECL_INITIAL (spec)((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1680, __FUNCTION__))->decl_common.initial)
)
1681 /* Dup decl failed, but this is a new definition. Set the
1682 line number so any errors match this new
1683 definition. */
1684 DECL_SOURCE_LOCATION (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1684, __FUNCTION__))->decl_minimal.locus)
= DECL_SOURCE_LOCATION (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1684, __FUNCTION__))->decl_minimal.locus)
;
1685
1686 return fn;
1687 }
1688 }
1689 else if (fn)
1690 return duplicate_decls (spec, fn, /*hiding=*/is_friend);
1691
1692 /* A specialization must be declared in the same namespace as the
1693 template it is specializing. */
1694 if (DECL_P (spec)(tree_code_type[(int) (((enum tree_code) (spec)->base.code
))] == tcc_declaration)
&& DECL_TEMPLATE_SPECIALIZATION (spec)((((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1694, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) == 2)
1695 && !check_specialization_namespace (tmpl))
1696 DECL_CONTEXT (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1696, __FUNCTION__))->decl_minimal.context)
= DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1696, __FUNCTION__))->decl_minimal.context)
;
1697
1698 if (slot != NULL__null /* !optimize_specialization_lookup_p (tmpl) */)
1699 {
1700 spec_entry *entry = ggc_alloc<spec_entry> ();
1701 gcc_assert (tmpl && args && spec)((void)(!(tmpl && args && spec) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1701, __FUNCTION__), 0 : 0))
;
1702 *entry = elt;
1703 *slot = entry;
1704 if ((TREE_CODE (spec)((enum tree_code) (spec)->base.code) == FUNCTION_DECL && DECL_NAMESPACE_SCOPE_P (spec)(!(((contains_struct_check ((spec), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1704, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (spec)->base.code) == CONST_DECL || ((
enum tree_code) (spec)->base.code) == PARM_DECL || ((enum tree_code
) (spec)->base.code) == TYPE_DECL || ((enum tree_code) (spec
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1704, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1704, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((spec)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1704, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
1705 && PRIMARY_TEMPLATE_P (tmpl)(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1705, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1705, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1705, __FUNCTION__))->typed.type))) == (tmpl))
1706 && DECL_SAVED_TREE (DECL_TEMPLATE_RESULT (tmpl))((tree_check ((((struct tree_template_decl *)(const_cast<union
tree_node *> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1706, __FUNCTION__, (TEMPLATE_DECL))))))))->result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1706, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
)
== NULL_TREE(tree) __null)
1707 || variable_template_p (tmpl))
1708 /* If TMPL is a forward declaration of a template function, keep a list
1709 of all specializations in case we need to reassign them to a friend
1710 template later in tsubst_friend_function.
1711
1712 Also keep a list of all variable template instantiations so that
1713 process_partial_specialization can check whether a later partial
1714 specialization would have used it. */
1715 DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1715, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1715, __FUNCTION__))->decl_common.size_unit)
1716 = tree_cons (args, spec, DECL_TEMPLATE_INSTANTIATIONS (tmpl)((contains_struct_check (((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1716, __FUNCTION__, (TEMPLATE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1716, __FUNCTION__))->decl_common.size_unit)
);
1717 }
1718
1719 return spec;
1720}
1721
1722/* Restricts tree and type comparisons. */
1723int comparing_specializations;
1724int comparing_dependent_aliases;
1725
1726/* Returns true iff two spec_entry nodes are equivalent. */
1727
1728bool
1729spec_hasher::equal (spec_entry *e1, spec_entry *e2)
1730{
1731 int equal;
1732
1733 ++comparing_specializations;
1734 ++comparing_dependent_aliases;
1735 ++processing_template_declscope_chain->x_processing_template_decl;
1736 equal = (e1->tmpl == e2->tmpl
1737 && comp_template_args (e1->args, e2->args));
1738 if (equal && flag_conceptsglobal_options.x_flag_concepts
1739 /* tmpl could be a FIELD_DECL for a capture pack. */
1740 && TREE_CODE (e1->tmpl)((enum tree_code) (e1->tmpl)->base.code) == TEMPLATE_DECL
1741 && VAR_P (DECL_TEMPLATE_RESULT (e1->tmpl))(((enum tree_code) (((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((e1->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1741, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == VAR_DECL)
1742 && uses_template_parms (e1->args))
1743 {
1744 /* Partial specializations of a variable template can be distinguished by
1745 constraints. */
1746 tree c1 = e1->spec ? get_constraints (e1->spec) : NULL_TREE(tree) __null;
1747 tree c2 = e2->spec ? get_constraints (e2->spec) : NULL_TREE(tree) __null;
1748 equal = equivalent_constraints (c1, c2);
1749 }
1750 --processing_template_declscope_chain->x_processing_template_decl;
1751 --comparing_dependent_aliases;
1752 --comparing_specializations;
1753
1754 return equal;
1755}
1756
1757/* Returns a hash for a template TMPL and template arguments ARGS. */
1758
1759static hashval_t
1760hash_tmpl_and_args (tree tmpl, tree args)
1761{
1762 hashval_t val = iterative_hash_object (DECL_UID (tmpl), 0)iterative_hash (&((contains_struct_check ((tmpl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1762, __FUNCTION__))->decl_minimal.uid), sizeof (((contains_struct_check
((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1762, __FUNCTION__))->decl_minimal.uid)), 0)
;
1763 return iterative_hash_template_arg (args, val);
1764}
1765
1766/* Returns a hash for a spec_entry node based on the TMPL and ARGS members,
1767 ignoring SPEC. */
1768
1769hashval_t
1770spec_hasher::hash (spec_entry *e)
1771{
1772 return hash_tmpl_and_args (e->tmpl, e->args);
1773}
1774
1775/* Recursively calculate a hash value for a template argument ARG, for use
1776 in the hash tables of template specializations. We must be
1777 careful to (at least) skip the same entities template_args_equal
1778 does. */
1779
1780hashval_t
1781iterative_hash_template_arg (tree arg, hashval_t val)
1782{
1783 if (arg == NULL_TREE(tree) __null)
1784 return iterative_hash_object (arg, val)iterative_hash (&arg, sizeof (arg), val);
1785
1786 if (!TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code)
)] == tcc_type)
)
1787 /* Strip nop-like things, but not the same as STRIP_NOPS. */
1788 while (CONVERT_EXPR_P (arg)((((enum tree_code) (arg)->base.code)) == NOP_EXPR || (((enum
tree_code) (arg)->base.code)) == CONVERT_EXPR)
1789 || TREE_CODE (arg)((enum tree_code) (arg)->base.code) == NON_LVALUE_EXPR
1790 || class_nttp_const_wrapper_p (arg))
1791 arg = TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1791, __FUNCTION__)))))
;
1792
1793 enum tree_code code = TREE_CODE (arg)((enum tree_code) (arg)->base.code);
1794
1795 val = iterative_hash_object (code, val)iterative_hash (&code, sizeof (code), val);
1796
1797 switch (code)
1798 {
1799 case ARGUMENT_PACK_SELECT:
1800 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1800, __FUNCTION__))
;
1801
1802 case ERROR_MARK:
1803 return val;
1804
1805 case IDENTIFIER_NODE:
1806 return iterative_hash_object (IDENTIFIER_HASH_VALUE (arg), val)iterative_hash (&((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1806, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
), sizeof (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1806, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.hash_value
)), val)
;
1807
1808 case TREE_VEC:
1809 for (int i = 0, len = TREE_VEC_LENGTH (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1809, __FUNCTION__, (TREE_VEC)))->base.u.length)
; i < len; ++i)
1810 val = iterative_hash_template_arg (TREE_VEC_ELT (arg, i)(*((const_cast<tree *> (tree_vec_elt_check ((arg), (i),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1810, __FUNCTION__)))))
, val);
1811 return val;
1812
1813 case TYPE_PACK_EXPANSION:
1814 case EXPR_PACK_EXPANSION:
1815 val = iterative_hash_template_arg (PACK_EXPANSION_PATTERN (arg)(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION
? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1815, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1815, __FUNCTION__))))))
, val);
1816 return iterative_hash_template_arg (PACK_EXPANSION_EXTRA_ARGS (arg)*(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION
? &((tree_class_check ((arg), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1816, __FUNCTION__))->type_non_common.maxval) : &(*(
(const_cast<tree*> (tree_operand_check (((arg)), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1816, __FUNCTION__))))))
, val);
1817
1818 case TYPE_ARGUMENT_PACK:
1819 case NONTYPE_ARGUMENT_PACK:
1820 return iterative_hash_template_arg (ARGUMENT_PACK_ARGS (arg)(((enum tree_code) (arg)->base.code) == TYPE_ARGUMENT_PACK
? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1820, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1820, __FUNCTION__))))))
, val);
1821
1822 case TREE_LIST:
1823 for (; arg; arg = TREE_CHAIN (arg)((contains_struct_check ((arg), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1823, __FUNCTION__))->common.chain)
)
1824 val = iterative_hash_template_arg (TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1824, __FUNCTION__, (TREE_LIST)))->list.value)
, val);
1825 return val;
1826
1827 case OVERLOAD:
1828 for (lkp_iterator iter (arg); iter; ++iter)
1829 val = iterative_hash_template_arg (*iter, val);
1830 return val;
1831
1832 case CONSTRUCTOR:
1833 {
1834 iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1834, __FUNCTION__))->typed.type)
, val);
1835 for (auto &e: CONSTRUCTOR_ELTS (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1835, __FUNCTION__, (CONSTRUCTOR)))->constructor.elts)
)
1836 {
1837 val = iterative_hash_template_arg (e.index, val);
1838 val = iterative_hash_template_arg (e.value, val);
1839 }
1840 return val;
1841 }
1842
1843 case PARM_DECL:
1844 if (!DECL_ARTIFICIAL (arg)((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1844, __FUNCTION__))->decl_common.artificial_flag)
)
1845 {
1846 val = iterative_hash_object (DECL_PARM_INDEX (arg), val)iterative_hash (&(__extension__ ({ struct lang_decl *lt =
((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1846, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1846, __FUNCTION__); &lt->u.parm; })->index), sizeof
((__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1846, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1846, __FUNCTION__); &lt->u.parm; })->index)), val
)
;
1847 val = iterative_hash_object (DECL_PARM_LEVEL (arg), val)iterative_hash (&(__extension__ ({ struct lang_decl *lt =
((contains_struct_check ((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1847, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1847, __FUNCTION__); &lt->u.parm; })->level), sizeof
((__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((arg), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1847, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (arg)->base.code) != PARM_DECL || lt->u
.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1847, __FUNCTION__); &lt->u.parm; })->level)), val
)
;
1848 }
1849 return iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1849, __FUNCTION__))->typed.type)
, val);
1850
1851 case TARGET_EXPR:
1852 return iterative_hash_template_arg (TARGET_EXPR_INITIAL (arg)(*(tree_operand_check_code ((arg), (TARGET_EXPR), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1852, __FUNCTION__)))
, val);
1853
1854 case PTRMEM_CST:
1855 val = iterative_hash_template_arg (PTRMEM_CST_CLASS (arg)((((enum tree_code) (((contains_struct_check (((tree_check ((
arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__))->typed.type))->base.code) == OFFSET_TYPE
) ? ((tree_check ((((contains_struct_check (((tree_check ((arg
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__, (OFFSET_TYPE)))->type_non_common.maxval
) : ((tree_check2 ((((contains_struct_check (((cp_build_qualified_type_real
((((contains_struct_check ((((tree_check3 ((((contains_struct_check
(((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.values)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__))->typed.type)), (cp_type_quals (((contains_struct_check
(((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__, (PTRMEM_CST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__))->typed.type))), tf_warning_or_error
))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1855, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.maxval))
, val);
1856 return iterative_hash_template_arg (PTRMEM_CST_MEMBER (arg)(((ptrmem_cst_t)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1856, __FUNCTION__, (PTRMEM_CST))))->member)
, val);
1857
1858 case TEMPLATE_PARM_INDEX:
1859 val = iterative_hash_template_arg
1860 (TREE_TYPE (TEMPLATE_PARM_DECL (arg))((contains_struct_check (((((template_parm_index*)(tree_check
((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1860, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->decl)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1860, __FUNCTION__))->typed.type)
, val);
1861 val = iterative_hash_object (TEMPLATE_PARM_LEVEL (arg), val)iterative_hash (&(((template_parm_index*)(tree_check ((arg
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1861, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level), sizeof
((((template_parm_index*)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1861, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)), val
)
;
1862 return iterative_hash_object (TEMPLATE_PARM_IDX (arg), val)iterative_hash (&(((template_parm_index*)(tree_check ((arg
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1862, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index), sizeof
((((template_parm_index*)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1862, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)), val
)
;
1863
1864 case TRAIT_EXPR:
1865 val = iterative_hash_object (TRAIT_EXPR_KIND (arg), val)iterative_hash (&(((struct tree_trait_expr *)(tree_check (
(arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1865, __FUNCTION__, (TRAIT_EXPR))))->kind), sizeof ((((struct
tree_trait_expr *)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1865, __FUNCTION__, (TRAIT_EXPR))))->kind)), val)
;
1866 val = iterative_hash_template_arg (TRAIT_EXPR_TYPE1 (arg)(((struct tree_trait_expr *)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1866, __FUNCTION__, (TRAIT_EXPR))))->type1)
, val);
1867 return iterative_hash_template_arg (TRAIT_EXPR_TYPE2 (arg)(((struct tree_trait_expr *)(tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1867, __FUNCTION__, (TRAIT_EXPR))))->type2)
, val);
1868
1869 case BASELINK:
1870 val = iterative_hash_template_arg (BINFO_TYPE (BASELINK_BINFO (arg))((contains_struct_check (((tree_check (((((struct tree_baselink
*) (tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1870, __FUNCTION__, (BASELINK))))->binfo)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1870, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1870, __FUNCTION__))->typed.type)
,
1871 val);
1872 return iterative_hash_template_arg (DECL_NAME (get_first_fn (arg))((contains_struct_check ((get_first_fn (arg)), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1872, __FUNCTION__))->decl_minimal.name)
,
1873 val);
1874
1875 case MODOP_EXPR:
1876 val = iterative_hash_template_arg (TREE_OPERAND (arg, 0)(*((const_cast<tree*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1876, __FUNCTION__)))))
, val);
1877 code = TREE_CODE (TREE_OPERAND (arg, 1))((enum tree_code) ((*((const_cast<tree*> (tree_operand_check
((arg), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1877, __FUNCTION__))))))->base.code)
;
1878 val = iterative_hash_object (code, val)iterative_hash (&code, sizeof (code), val);
1879 return iterative_hash_template_arg (TREE_OPERAND (arg, 2)(*((const_cast<tree*> (tree_operand_check ((arg), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1879, __FUNCTION__)))))
, val);
1880
1881 case LAMBDA_EXPR:
1882 /* [temp.over.link] Two lambda-expressions are never considered
1883 equivalent.
1884
1885 So just hash the closure type. */
1886 return iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1886, __FUNCTION__))->typed.type)
, val);
1887
1888 case CAST_EXPR:
1889 case IMPLICIT_CONV_EXPR:
1890 case STATIC_CAST_EXPR:
1891 case REINTERPRET_CAST_EXPR:
1892 case CONST_CAST_EXPR:
1893 case DYNAMIC_CAST_EXPR:
1894 case NEW_EXPR:
1895 val = iterative_hash_template_arg (TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1895, __FUNCTION__))->typed.type)
, val);
1896 /* Now hash operands as usual. */
1897 break;
1898
1899 case CALL_EXPR:
1900 {
1901 tree fn = CALL_EXPR_FN (arg)(*((const_cast<tree*> (tree_operand_check (((tree_check
((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1901, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1901, __FUNCTION__)))))
;
1902 if (tree name = dependent_name (fn))
1903 {
1904 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_ID_EXPR)
1905 val = iterative_hash_template_arg (TREE_OPERAND (fn, 1)(*((const_cast<tree*> (tree_operand_check ((fn), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1905, __FUNCTION__)))))
, val);
1906 fn = name;
1907 }
1908 val = iterative_hash_template_arg (fn, val);
1909 call_expr_arg_iterator ai;
1910 for (tree x = first_call_expr_arg (arg, &ai); x;
1911 x = next_call_expr_arg (&ai))
1912 val = iterative_hash_template_arg (x, val);
1913 return val;
1914 }
1915
1916 default:
1917 break;
1918 }
1919
1920 char tclass = TREE_CODE_CLASS (code)tree_code_type[(int) (code)];
1921 switch (tclass)
1922 {
1923 case tcc_type:
1924 if (tree ats = alias_template_specialization_p (arg, nt_transparent))
1925 {
1926 // We want an alias specialization that survived strip_typedefs
1927 // to hash differently from its TYPE_CANONICAL, to avoid hash
1928 // collisions that compare as different in template_args_equal.
1929 // These could be dependent specializations that strip_typedefs
1930 // left alone, or untouched specializations because
1931 // coerce_template_parms returns the unconverted template
1932 // arguments if it sees incomplete argument packs.
1933 tree ti = TYPE_ALIAS_TEMPLATE_INFO (ats)(((contains_struct_check ((((tree_class_check ((ats), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1933, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1933, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((template_info_decl_check ((((tree_class_check ((ats), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1933, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1933, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1933, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) : (tree) __null)
;
1934 return hash_tmpl_and_args (TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1934, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
, TI_ARGS (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1934, __FUNCTION__, (TEMPLATE_INFO))))->args
);
1935 }
1936
1937 switch (TREE_CODE (arg)((enum tree_code) (arg)->base.code))
1938 {
1939 case TEMPLATE_TEMPLATE_PARM:
1940 {
1941 tree tpi = TEMPLATE_TYPE_PARM_INDEX (arg)(((tree_class_check (((tree_check3 (((arg)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1941, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1941, __FUNCTION__))->type_non_common.values))
;
1942
1943 /* Do not recurse with TPI directly, as that is unbounded
1944 recursion. */
1945 val = iterative_hash_object (TEMPLATE_PARM_LEVEL (tpi), val)iterative_hash (&(((template_parm_index*)(tree_check ((tpi
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1945, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level), sizeof
((((template_parm_index*)(tree_check ((tpi), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1945, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->level)), val
)
;
1946 val = iterative_hash_object (TEMPLATE_PARM_IDX (tpi), val)iterative_hash (&(((template_parm_index*)(tree_check ((tpi
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1946, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index), sizeof
((((template_parm_index*)(tree_check ((tpi), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1946, __FUNCTION__, (TEMPLATE_PARM_INDEX))))->index)), val
)
;
1947 }
1948 break;
1949
1950 case DECLTYPE_TYPE:
1951 val = iterative_hash_template_arg (DECLTYPE_TYPE_EXPR (arg)(((tree_class_check (((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1951, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1951, __FUNCTION__))->type_non_common.values))
, val);
1952 break;
1953
1954 default:
1955 if (tree canonical = TYPE_CANONICAL (arg)((tree_class_check ((arg), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1955, __FUNCTION__))->type_common.canonical)
)
1956 val = iterative_hash_object (TYPE_HASH (canonical), val)iterative_hash (&(((tree_class_check ((canonical), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1956, __FUNCTION__))->type_common.uid)), sizeof ((((tree_class_check
((canonical), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1956, __FUNCTION__))->type_common.uid))), val)
;
1957 break;
1958 }
1959
1960 return val;
1961
1962 case tcc_declaration:
1963 case tcc_constant:
1964 return iterative_hash_expr (arg, val);
1965
1966 default:
1967 gcc_assert (IS_EXPR_CODE_CLASS (tclass))((void)(!(((tclass) >= tcc_reference && (tclass) <=
tcc_expression)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1967, __FUNCTION__), 0 : 0))
;
1968 for (int i = 0, n = cp_tree_operand_length (arg); i < n; ++i)
1969 val = iterative_hash_template_arg (TREE_OPERAND (arg, i)(*((const_cast<tree*> (tree_operand_check ((arg), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1969, __FUNCTION__)))))
, val);
1970 return val;
1971 }
1972
1973 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1973, __FUNCTION__))
;
1974 return 0;
1975}
1976
1977/* Unregister the specialization SPEC as a specialization of TMPL.
1978 Replace it with NEW_SPEC, if NEW_SPEC is non-NULL. Returns true
1979 if the SPEC was listed as a specialization of TMPL.
1980
1981 Note that SPEC has been ggc_freed, so we can't look inside it. */
1982
1983bool
1984reregister_specialization (tree spec, tree tinfo, tree new_spec)
1985{
1986 spec_entry *entry;
1987 spec_entry elt;
1988
1989 elt.tmpl = most_general_template (TI_TEMPLATE (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1989, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
);
1990 elt.args = TI_ARGS (tinfo)((struct tree_template_info*)(tree_check ((tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1990, __FUNCTION__, (TEMPLATE_INFO))))->args
;
1991 elt.spec = NULL_TREE(tree) __null;
1992
1993 entry = decl_specializations->find (&elt);
1994 if (entry != NULL__null)
1995 {
1996 gcc_assert (entry->spec == spec || entry->spec == new_spec)((void)(!(entry->spec == spec || entry->spec == new_spec
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1996, __FUNCTION__), 0 : 0))
;
1997 gcc_assert (new_spec != NULL_TREE)((void)(!(new_spec != (tree) __null) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 1997, __FUNCTION__), 0 : 0))
;
1998 entry->spec = new_spec;
1999 return 1;
2000 }
2001
2002 return 0;
2003}
2004
2005/* Like register_specialization, but for local declarations. We are
2006 registering SPEC, an instantiation of TMPL. */
2007
2008void
2009register_local_specialization (tree spec, tree tmpl)
2010{
2011 gcc_assert (tmpl != spec)((void)(!(tmpl != spec) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2011, __FUNCTION__), 0 : 0))
;
2012 local_specializationsscope_chain->x_local_specializations->put (tmpl, spec);
2013}
2014
2015/* TYPE is a class type. Returns true if TYPE is an explicitly
2016 specialized class. */
2017
2018bool
2019explicit_class_specialization_p (tree type)
2020{
2021 if (!CLASSTYPE_TEMPLATE_SPECIALIZATION (type)(((((tree_class_check ((type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2021, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
)
2022 return false;
2023 return !uses_template_parms (CLASSTYPE_TI_ARGS (type)((struct tree_template_info*)(tree_check (((((tree_class_check
(((tree_check3 ((type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2023, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2023, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2023, __FUNCTION__, (TEMPLATE_INFO))))->args
);
2024}
2025
2026/* Print the list of functions at FNS, going through all the overloads
2027 for each element of the list. Alternatively, FNS cannot be a
2028 TREE_LIST, in which case it will be printed together with all the
2029 overloads.
2030
2031 MORE and *STR should respectively be FALSE and NULL when the function
2032 is called from the outside. They are used internally on recursive
2033 calls. print_candidates manages the two parameters and leaves NULL
2034 in *STR when it ends. */
2035
2036static void
2037print_candidates_1 (tree fns, char **str, bool more = false)
2038{
2039 if (TREE_CODE (fns)((enum tree_code) (fns)->base.code) == TREE_LIST)
2040 for (; fns; fns = TREE_CHAIN (fns)((contains_struct_check ((fns), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2040, __FUNCTION__))->common.chain)
)
2041 print_candidates_1 (TREE_VALUE (fns)((tree_check ((fns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2041, __FUNCTION__, (TREE_LIST)))->list.value)
, str, more || TREE_CHAIN (fns)((contains_struct_check ((fns), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2041, __FUNCTION__))->common.chain)
);
2042 else
2043 for (lkp_iterator iter (fns); iter;)
2044 {
2045 tree cand = *iter;
2046 ++iter;
2047
2048 const char *pfx = *str;
2049 if (!pfx)
2050 {
2051 if (more || iter)
2052 pfx = _("candidates are:")gettext ("candidates are:");
2053 else
2054 pfx = _("candidate is:")gettext ("candidate is:");
2055 *str = get_spaces (pfx);
2056 }
2057 inform (DECL_SOURCE_LOCATION (cand)((contains_struct_check ((cand), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2057, __FUNCTION__))->decl_minimal.locus)
, "%s %#qD", pfx, cand);
2058 }
2059}
2060
2061/* Print the list of candidate FNS in an error message. FNS can also
2062 be a TREE_LIST of non-functions in the case of an ambiguous lookup. */
2063
2064void
2065print_candidates (tree fns)
2066{
2067 char *str = NULL__null;
2068 print_candidates_1 (fns, &str);
2069 free (str);
2070}
2071
2072/* Get a (possibly) constrained template declaration for the
2073 purpose of ordering candidates. */
2074static tree
2075get_template_for_ordering (tree list)
2076{
2077 gcc_assert (TREE_CODE (list) == TREE_LIST)((void)(!(((enum tree_code) (list)->base.code) == TREE_LIST
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2077, __FUNCTION__), 0 : 0))
;
2078 tree f = TREE_VALUE (list)((tree_check ((list), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2078, __FUNCTION__, (TREE_LIST)))->list.value)
;
2079 if (tree ti = DECL_TEMPLATE_INFO (f)(((contains_struct_check ((template_info_decl_check ((f), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2079, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2079, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
)
2080 return TI_TEMPLATE (ti)((struct tree_template_info*)(tree_check ((ti), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2080, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
2081 return f;
2082}
2083
2084/* Among candidates having the same signature, return the
2085 most constrained or NULL_TREE if there is no best candidate.
2086 If the signatures of candidates vary (e.g., template
2087 specialization vs. member function), then there can be no
2088 most constrained.
2089
2090 Note that we don't compare constraints on the functions
2091 themselves, but rather those of their templates. */
2092static tree
2093most_constrained_function (tree candidates)
2094{
2095 // Try to find the best candidate in a first pass.
2096 tree champ = candidates;
2097 for (tree c = TREE_CHAIN (champ)((contains_struct_check ((champ), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2097, __FUNCTION__))->common.chain)
; c; c = TREE_CHAIN (c)((contains_struct_check ((c), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2097, __FUNCTION__))->common.chain)
)
2098 {
2099 int winner = more_constrained (get_template_for_ordering (champ),
2100 get_template_for_ordering (c));
2101 if (winner == -1)
2102 champ = c; // The candidate is more constrained
2103 else if (winner == 0)
2104 return NULL_TREE(tree) __null; // Neither is more constrained
2105 }
2106
2107 // Verify that the champ is better than previous candidates.
2108 for (tree c = candidates; c != champ; c = TREE_CHAIN (c)((contains_struct_check ((c), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2108, __FUNCTION__))->common.chain)
) {
2109 if (!more_constrained (get_template_for_ordering (champ),
2110 get_template_for_ordering (c)))
2111 return NULL_TREE(tree) __null;
2112 }
2113
2114 return champ;
2115}
2116
2117
2118/* Returns the template (one of the functions given by TEMPLATE_ID)
2119 which can be specialized to match the indicated DECL with the
2120 explicit template args given in TEMPLATE_ID. The DECL may be
2121 NULL_TREE if none is available. In that case, the functions in
2122 TEMPLATE_ID are non-members.
2123
2124 If NEED_MEMBER_TEMPLATE is nonzero the function is known to be a
2125 specialization of a member template.
2126
2127 The TEMPLATE_COUNT is the number of references to qualifying
2128 template classes that appeared in the name of the function. See
2129 check_explicit_specialization for a more accurate description.
2130
2131 TSK indicates what kind of template declaration (if any) is being
2132 declared. TSK_TEMPLATE indicates that the declaration given by
2133 DECL, though a FUNCTION_DECL, has template parameters, and is
2134 therefore a template function.
2135
2136 The template args (those explicitly specified and those deduced)
2137 are output in a newly created vector *TARGS_OUT.
2138
2139 If it is impossible to determine the result, an error message is
2140 issued. The error_mark_node is returned to indicate failure. */
2141
2142static tree
2143determine_specialization (tree template_id,
2144 tree decl,
2145 tree* targs_out,
2146 int need_member_template,
2147 int template_count,
2148 tmpl_spec_kind tsk)
2149{
2150 tree fns;
2151 tree targs;
2152 tree explicit_targs;
2153 tree candidates = NULL_TREE(tree) __null;
2154
2155 /* A TREE_LIST of templates of which DECL may be a specialization.
2156 The TREE_VALUE of each node is a TEMPLATE_DECL. The
2157 corresponding TREE_PURPOSE is the set of template arguments that,
2158 when used to instantiate the template, would produce a function
2159 with the signature of DECL. */
2160 tree templates = NULL_TREE(tree) __null;
2161 int header_count;
2162 cp_binding_level *b;
2163
2164 *targs_out = NULL_TREE(tree) __null;
2165
2166 if (template_id == error_mark_nodeglobal_trees[TI_ERROR_MARK] || decl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2167 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2168
2169 /* We shouldn't be specializing a member template of an
2170 unspecialized class template; we already gave an error in
2171 check_specialization_scope, now avoid crashing. */
2172 if (!VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL)
2173 && template_count && DECL_CLASS_SCOPE_P (decl)(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2173, __FUNCTION__))->decl_minimal.context) && (
tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2173, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type))
2174 && template_class_depth (DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2174, __FUNCTION__))->decl_minimal.context)
) > 0)
2175 {
2176 gcc_assert (errorcount)((void)(!((global_dc)->diagnostic_count[(int) (DK_ERROR)])
? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2176, __FUNCTION__), 0 : 0))
;
2177 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2178 }
2179
2180 fns = TREE_OPERAND (template_id, 0)(*((const_cast<tree*> (tree_operand_check ((template_id
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2180, __FUNCTION__)))))
;
2181 explicit_targs = TREE_OPERAND (template_id, 1)(*((const_cast<tree*> (tree_operand_check ((template_id
), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2181, __FUNCTION__)))))
;
2182
2183 if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK])
2184 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2185
2186 /* Check for baselinks. */
2187 if (BASELINK_P (fns)(((enum tree_code) (fns)->base.code) == BASELINK))
2188 fns = BASELINK_FUNCTIONS (fns)(((struct tree_baselink*) (tree_check ((fns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2188, __FUNCTION__, (BASELINK))))->functions)
;
2189
2190 if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL && !is_overloaded_fn (fns))
2191 {
2192 error_at (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2192, __FUNCTION__))->decl_minimal.locus)
,
2193 "%qD is not a function template", fns);
2194 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2195 }
2196 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && !variable_template_p (fns))
2197 {
2198 error ("%qD is not a variable template", fns);
2199 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2200 }
2201
2202 /* Count the number of template headers specified for this
2203 specialization. */
2204 header_count = 0;
2205 for (b = current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
;
2206 b->kind == sk_template_parms;
2207 b = b->level_chain)
2208 ++header_count;
2209
2210 tree orig_fns = fns;
2211 bool header_mismatch = false;
2212
2213 if (variable_template_p (fns))
2214 {
2215 tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (fns))((tree_check ((((struct tree_template_decl *)(const_cast<union
tree_node *> ((((tree_check ((fns), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2215, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2215, __FUNCTION__, (TREE_LIST)))->list.value)
;
2216 targs = coerce_template_parms (parms, explicit_targs, fns,
2217 tf_warning_or_error,
2218 /*req_all*/true, /*use_defarg*/true);
2219 if (targs != error_mark_nodeglobal_trees[TI_ERROR_MARK]
2220 && constraints_satisfied_p (fns, targs))
2221 templates = tree_cons (targs, fns, templates);
2222 }
2223 else for (lkp_iterator iter (fns); iter; ++iter)
2224 {
2225 tree fn = *iter;
2226
2227 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL)
2228 {
2229 tree decl_arg_types;
2230 tree fn_arg_types;
2231
2232 /* In case of explicit specialization, we need to check if
2233 the number of template headers appearing in the specialization
2234 is correct. This is usually done in check_explicit_specialization,
2235 but the check done there cannot be exhaustive when specializing
2236 member functions. Consider the following code:
2237
2238 template <> void A<int>::f(int);
2239 template <> template <> void A<int>::f(int);
2240
2241 Assuming that A<int> is not itself an explicit specialization
2242 already, the first line specializes "f" which is a non-template
2243 member function, whilst the second line specializes "f" which
2244 is a template member function. So both lines are syntactically
2245 correct, and check_explicit_specialization does not reject
2246 them.
2247
2248 Here, we can do better, as we are matching the specialization
2249 against the declarations. We count the number of template
2250 headers, and we check if they match TEMPLATE_COUNT + 1
2251 (TEMPLATE_COUNT is the number of qualifying template classes,
2252 plus there must be another header for the member template
2253 itself).
2254
2255 Notice that if header_count is zero, this is not a
2256 specialization but rather a template instantiation, so there
2257 is no check we can perform here. */
2258 if (header_count && header_count != template_count + 1)
2259 {
2260 header_mismatch = true;
2261 continue;
2262 }
2263
2264 /* Check that the number of template arguments at the
2265 innermost level for DECL is the same as for FN. */
2266 if (current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->kind == sk_template_parms
2267 && !current_binding_level(*((cfun + 0) && ((cfun + 0)->language) &&
((cfun + 0)->language)->bindings ? &((cfun + 0)->
language)->bindings : &scope_chain->bindings))
->explicit_spec_p
2268 && (TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (fn))((tree_check ((((tree_check ((((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2268, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2268, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2268, __FUNCTION__, (TREE_VEC)))->base.u.length)
2269 != TREE_VEC_LENGTH (INNERMOST_TEMPLATE_PARMS((tree_check ((((tree_check ((scope_chain->template_parms)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2270, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2270, __FUNCTION__, (TREE_VEC)))->base.u.length)
2270 (current_template_parms))((tree_check ((((tree_check ((scope_chain->template_parms)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2270, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2270, __FUNCTION__, (TREE_VEC)))->base.u.length)
))
2271 continue;
2272
2273 /* DECL might be a specialization of FN. */
2274 decl_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2274, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2274, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2275 fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2275, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2275, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2276
2277 /* For a non-static member function, we need to make sure
2278 that the const qualification is the same. Since
2279 get_bindings does not try to merge the "this" parameter,
2280 we must do the comparison explicitly. */
2281 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2281, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2282 {
2283 if (!same_type_p (TREE_VALUE (fn_arg_types),comptypes ((((tree_check ((fn_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2283, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check
((decl_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2284, __FUNCTION__, (TREE_LIST)))->list.value)), 0)
2284 TREE_VALUE (decl_arg_types))comptypes ((((tree_check ((fn_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2283, __FUNCTION__, (TREE_LIST)))->list.value)), (((tree_check
((decl_arg_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2284, __FUNCTION__, (TREE_LIST)))->list.value)), 0)
)
2285 continue;
2286
2287 /* And the ref-qualification. */
2288 if (type_memfn_rqual (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2288, __FUNCTION__))->typed.type)
)
2289 != type_memfn_rqual (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2289, __FUNCTION__))->typed.type)
))
2290 continue;
2291 }
2292
2293 /* Skip the "this" parameter and, for constructors of
2294 classes with virtual bases, the VTT parameter. A
2295 full specialization of a constructor will have a VTT
2296 parameter, but a template never will. */
2297 decl_arg_types
2298 = skip_artificial_parms_for (decl, decl_arg_types);
2299 fn_arg_types
2300 = skip_artificial_parms_for (fn, fn_arg_types);
2301
2302 /* Function templates cannot be specializations; there are
2303 no partial specializations of functions. Therefore, if
2304 the type of DECL does not match FN, there is no
2305 match.
2306
2307 Note that it should never be the case that we have both
2308 candidates added here, and for regular member functions
2309 below. */
2310 if (tsk == tsk_template)
2311 {
2312 if (!comp_template_parms (DECL_TEMPLATE_PARMS (fn)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2312, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
,
2313 current_template_parmsscope_chain->template_parms))
2314 continue;
2315 if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2315, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2315, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2316, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2316, __FUNCTION__))->typed.type)), 0)
2316 TREE_TYPE (TREE_TYPE (fn)))comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2315, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2315, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2316, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2316, __FUNCTION__))->typed.type)), 0)
)
2317 continue;
2318 if (!compparms (fn_arg_types, decl_arg_types))
2319 continue;
2320
2321 tree freq = get_trailing_function_requirements (fn);
2322 tree dreq = get_trailing_function_requirements (decl);
2323 if (!freq != !dreq)
2324 continue;
2325 if (freq)
2326 {
2327 tree fargs = DECL_TI_ARGS (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2327, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2327, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2327, __FUNCTION__, (TEMPLATE_INFO))))->args
;
2328 tsubst_flags_t complain = tf_none;
2329 freq = tsubst_constraint (freq, fargs, complain, fn);
2330 if (!cp_tree_equal (freq, dreq))
2331 continue;
2332 }
2333
2334 candidates = tree_cons (NULL_TREE(tree) __null, fn, candidates);
2335 continue;
2336 }
2337
2338 /* See whether this function might be a specialization of this
2339 template. Suppress access control because we might be trying
2340 to make this specialization a friend, and we have already done
2341 access control for the declaration of the specialization. */
2342 push_deferring_access_checks (dk_no_check);
2343 targs = get_bindings (fn, decl, explicit_targs, /*check_ret=*/true);
2344 pop_deferring_access_checks ();
2345
2346 if (!targs)
2347 /* We cannot deduce template arguments that when used to
2348 specialize TMPL will produce DECL. */
2349 continue;
2350
2351 if (uses_template_parms (targs))
2352 /* We deduced something involving 'auto', which isn't a valid
2353 template argument. */
2354 continue;
2355
2356 /* Save this template, and the arguments deduced. */
2357 templates = tree_cons (targs, fn, templates);
2358 }
2359 else if (need_member_template)
2360 /* FN is an ordinary member function, and we need a
2361 specialization of a member template. */
2362 ;
2363 else if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) != FUNCTION_DECL)
2364 /* We can get IDENTIFIER_NODEs here in certain erroneous
2365 cases. */
2366 ;
2367 else if (!DECL_FUNCTION_MEMBER_P (fn)((((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2367, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
) || (__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2367, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2367, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2367, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2367, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2367, __FUNCTION__); &lt->u.fn; })->static_function
))
)
2368 /* This is just an ordinary non-member function. Nothing can
2369 be a specialization of that. */
2370 ;
2371 else if (DECL_ARTIFICIAL (fn)((contains_struct_check ((fn), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2371, __FUNCTION__))->decl_common.artificial_flag)
)
2372 /* Cannot specialize functions that are created implicitly. */
2373 ;
2374 else
2375 {
2376 tree decl_arg_types;
2377
2378 /* This is an ordinary member function. However, since
2379 we're here, we can assume its enclosing class is a
2380 template class. For example,
2381
2382 template <typename T> struct S { void f(); };
2383 template <> void S<int>::f() {}
2384
2385 Here, S<int>::f is a non-template, but S<int> is a
2386 template class. If FN has the same type as DECL, we
2387 might be in business. */
2388
2389 if (!DECL_TEMPLATE_INFO (fn)(((contains_struct_check ((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2389, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2389, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
)
2390 /* Its enclosing class is an explicit specialization
2391 of a template class. This is not a candidate. */
2392 continue;
2393
2394 if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2394, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2394, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2395, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2395, __FUNCTION__))->typed.type)), 0)
2395 TREE_TYPE (TREE_TYPE (fn)))comptypes ((((contains_struct_check ((((contains_struct_check
((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2394, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2394, __FUNCTION__))->typed.type)), (((contains_struct_check
((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2395, __FUNCTION__))->typed.type)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2395, __FUNCTION__))->typed.type)), 0)
)
2396 /* The return types differ. */
2397 continue;
2398
2399 /* Adjust the type of DECL in case FN is a static member. */
2400 decl_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2400, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2400, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2401 if (DECL_STATIC_FUNCTION_P (fn)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (fn)->base.code) == TEMPLATE_DECL ? (
(struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2401, __FUNCTION__, (TEMPLATE_DECL))))))))->result : fn)
), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2401, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (fn)->base.code) == FUNCTION_DECL || (((
enum tree_code) (fn)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2401, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((fn),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2401, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2401, __FUNCTION__); &lt->u.fn; })->static_function
)
2402 && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2402, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2403 decl_arg_types = TREE_CHAIN (decl_arg_types)((contains_struct_check ((decl_arg_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2403, __FUNCTION__))->common.chain)
;
2404
2405 if (!compparms (TYPE_ARG_TYPES (TREE_TYPE (fn))((tree_check2 ((((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2405, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2405, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
,
2406 decl_arg_types))
2407 continue;
2408
2409 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)(((enum tree_code) (((contains_struct_check ((fn), (TS_TYPED)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2409, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
2410 && (type_memfn_rqual (TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2410, __FUNCTION__))->typed.type)
)
2411 != type_memfn_rqual (TREE_TYPE (fn)((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2411, __FUNCTION__))->typed.type)
)))
2412 continue;
2413
2414 // If the deduced arguments do not satisfy the constraints,
2415 // this is not a candidate.
2416 if (flag_conceptsglobal_options.x_flag_concepts && !constraints_satisfied_p (fn))
2417 continue;
2418
2419 // Add the candidate.
2420 candidates = tree_cons (NULL_TREE(tree) __null, fn, candidates);
2421 }
2422 }
2423
2424 if (templates && TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2424, __FUNCTION__))->common.chain)
)
2425 {
2426 /* We have:
2427
2428 [temp.expl.spec]
2429
2430 It is possible for a specialization with a given function
2431 signature to be instantiated from more than one function
2432 template. In such cases, explicit specification of the
2433 template arguments must be used to uniquely identify the
2434 function template specialization being specialized.
2435
2436 Note that here, there's no suggestion that we're supposed to
2437 determine which of the candidate templates is most
2438 specialized. However, we, also have:
2439
2440 [temp.func.order]
2441
2442 Partial ordering of overloaded function template
2443 declarations is used in the following contexts to select
2444 the function template to which a function template
2445 specialization refers:
2446
2447 -- when an explicit specialization refers to a function
2448 template.
2449
2450 So, we do use the partial ordering rules, at least for now.
2451 This extension can only serve to make invalid programs valid,
2452 so it's safe. And, there is strong anecdotal evidence that
2453 the committee intended the partial ordering rules to apply;
2454 the EDG front end has that behavior, and John Spicer claims
2455 that the committee simply forgot to delete the wording in
2456 [temp.expl.spec]. */
2457 tree tmpl = most_specialized_instantiation (templates);
2458 if (tmpl != error_mark_nodeglobal_trees[TI_ERROR_MARK])
2459 {
2460 templates = tmpl;
2461 TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2461, __FUNCTION__))->common.chain)
= NULL_TREE(tree) __null;
2462 }
2463 }
2464
2465 // Concepts allows multiple declarations of member functions
2466 // with the same signature. Like above, we need to rely on
2467 // on the partial ordering of those candidates to determine which
2468 // is the best.
2469 if (flag_conceptsglobal_options.x_flag_concepts && candidates && TREE_CHAIN (candidates)((contains_struct_check ((candidates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2469, __FUNCTION__))->common.chain)
)
2470 {
2471 if (tree cand = most_constrained_function (candidates))
2472 {
2473 candidates = cand;
2474 TREE_CHAIN (cand)((contains_struct_check ((cand), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2474, __FUNCTION__))->common.chain)
= NULL_TREE(tree) __null;
2475 }
2476 }
2477
2478 if (templates == NULL_TREE(tree) __null && candidates == NULL_TREE(tree) __null)
2479 {
2480 error ("template-id %qD for %q+D does not match any template "
2481 "declaration", template_id, decl);
2482 if (header_mismatch)
2483 inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2483, __FUNCTION__))->decl_minimal.locus)
,
2484 "saw %d %<template<>%>, need %d for "
2485 "specializing a member function template",
2486 header_count, template_count + 1);
2487 print_candidates (orig_fns);
2488 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2489 }
2490 else if ((templates && TREE_CHAIN (templates)((contains_struct_check ((templates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2490, __FUNCTION__))->common.chain)
)
2491 || (candidates && TREE_CHAIN (candidates)((contains_struct_check ((candidates), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2491, __FUNCTION__))->common.chain)
)
2492 || (templates && candidates))
2493 {
2494 error ("ambiguous template specialization %qD for %q+D",
2495 template_id, decl);
2496 candidates = chainon (candidates, templates);
2497 print_candidates (candidates);
2498 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2499 }
2500
2501 /* We have one, and exactly one, match. */
2502 if (candidates)
2503 {
2504 tree fn = TREE_VALUE (candidates)((tree_check ((candidates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2504, __FUNCTION__, (TREE_LIST)))->list.value)
;
2505 *targs_out = copy_node (DECL_TI_ARGS (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2505, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2505, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2505, __FUNCTION__, (TEMPLATE_INFO))))->args
);
2506
2507 /* Propagate the candidate's constraints to the declaration. */
2508 if (tsk != tsk_template)
2509 set_constraints (decl, get_constraints (fn));
2510
2511 /* DECL is a re-declaration or partial instantiation of a template
2512 function. */
2513 if (TREE_CODE (fn)((enum tree_code) (fn)->base.code) == TEMPLATE_DECL)
2514 return fn;
2515 /* It was a specialization of an ordinary member function in a
2516 template class. */
2517 return DECL_TI_TEMPLATE (fn)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2517, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2517, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2517, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
2518 }
2519
2520 /* It was a specialization of a template. */
2521 targs = DECL_TI_ARGS (DECL_TEMPLATE_RESULT (TREE_VALUE (templates)))((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((((struct tree_template_decl *)(
const_cast<union tree_node *> ((((tree_check ((((tree_check
((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2521, __FUNCTION__, (TREE_LIST)))->list.value)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2521, __FUNCTION__, (TEMPLATE_DECL))))))))->result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2521, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2521, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2521, __FUNCTION__, (TEMPLATE_INFO))))->args
;
2522 if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (targs)(targs && ((tree_check ((targs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2522, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((targs), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2522, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((targs), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2522, __FUNCTION__))))))->base.code) == TREE_VEC)
)
2523 {
2524 *targs_out = copy_node (targs);
2525 SET_TMPL_ARGS_LEVEL (*targs_out,((*((const_cast<tree *> (tree_vec_elt_check ((*targs_out
), ((((*targs_out && ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((*targs_out
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((*targs_out), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) -
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2527, __FUNCTION__))))) = (((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2527, __FUNCTION__, (TREE_LIST)))->list.purpose)))
2526 TMPL_ARGS_DEPTH (*targs_out),((*((const_cast<tree *> (tree_vec_elt_check ((*targs_out
), ((((*targs_out && ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((*targs_out
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((*targs_out), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) -
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2527, __FUNCTION__))))) = (((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2527, __FUNCTION__, (TREE_LIST)))->list.purpose)))
2527 TREE_PURPOSE (templates))((*((const_cast<tree *> (tree_vec_elt_check ((*targs_out
), ((((*targs_out && ((tree_check ((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((*targs_out
), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((*targs_out), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((*targs_out), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2526, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)) -
1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2527, __FUNCTION__))))) = (((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2527, __FUNCTION__, (TREE_LIST)))->list.purpose)))
;
2528 }
2529 else
2530 *targs_out = TREE_PURPOSE (templates)((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2530, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
2531 return TREE_VALUE (templates)((tree_check ((templates), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2531, __FUNCTION__, (TREE_LIST)))->list.value)
;
2532}
2533
2534/* Returns a chain of parameter types, exactly like the SPEC_TYPES,
2535 but with the default argument values filled in from those in the
2536 TMPL_TYPES. */
2537
2538static tree
2539copy_default_args_to_explicit_spec_1 (tree spec_types,
2540 tree tmpl_types)
2541{
2542 tree new_spec_types;
2543
2544 if (!spec_types)
2545 return NULL_TREE(tree) __null;
2546
2547 if (spec_types == void_list_nodeglobal_trees[TI_VOID_LIST_NODE])
2548 return void_list_nodeglobal_trees[TI_VOID_LIST_NODE];
2549
2550 /* Substitute into the rest of the list. */
2551 new_spec_types =
2552 copy_default_args_to_explicit_spec_1 (TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2552, __FUNCTION__))->common.chain)
,
2553 TREE_CHAIN (tmpl_types)((contains_struct_check ((tmpl_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2553, __FUNCTION__))->common.chain)
);
2554
2555 /* Add the default argument for this parameter. */
2556 return hash_tree_cons (TREE_PURPOSE (tmpl_types)((tree_check ((tmpl_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2556, __FUNCTION__, (TREE_LIST)))->list.purpose)
,
2557 TREE_VALUE (spec_types)((tree_check ((spec_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2557, __FUNCTION__, (TREE_LIST)))->list.value)
,
2558 new_spec_types);
2559}
2560
2561/* DECL is an explicit specialization. Replicate default arguments
2562 from the template it specializes. (That way, code like:
2563
2564 template <class T> void f(T = 3);
2565 template <> void f(double);
2566 void g () { f (); }
2567
2568 works, as required.) An alternative approach would be to look up
2569 the correct default arguments at the call-site, but this approach
2570 is consistent with how implicit instantiations are handled. */
2571
2572static void
2573copy_default_args_to_explicit_spec (tree decl)
2574{
2575 tree tmpl;
2576 tree spec_types;
2577 tree tmpl_types;
2578 tree new_spec_types;
2579 tree old_type;
2580 tree new_type;
2581 tree t;
2582 tree object_type = NULL_TREE(tree) __null;
2583 tree in_charge = NULL_TREE(tree) __null;
2584 tree vtt = NULL_TREE(tree) __null;
2585
2586 /* See if there's anything we need to do. */
2587 tmpl = DECL_TI_TEMPLATE (decl)((struct tree_template_info*)(tree_check (((((contains_struct_check
((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2587, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2587, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2587, __FUNCTION__, (TEMPLATE_INFO))))->tmpl
;
2588 tmpl_types = TYPE_ARG_TYPES (TREE_TYPE (DECL_TEMPLATE_RESULT (tmpl)))((tree_check2 ((((contains_struct_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2588, __FUNCTION__, (TEMPLATE_DECL))))))))->result), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2588, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2588, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2589 for (t = tmpl_types; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2589, __FUNCTION__))->common.chain)
)
2590 if (TREE_PURPOSE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2590, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
2591 break;
2592 if (!t)
2593 return;
2594
2595 old_type = TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2595, __FUNCTION__))->typed.type)
;
2596 spec_types = TYPE_ARG_TYPES (old_type)((tree_check2 ((old_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2596, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2597
2598 if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2598, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2599 {
2600 /* Remove the this pointer, but remember the object's type for
2601 CV quals. */
2602 object_type = TREE_TYPE (TREE_VALUE (spec_types))((contains_struct_check ((((tree_check ((spec_types), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2602, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2602, __FUNCTION__))->typed.type)
;
2603 spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2603, __FUNCTION__))->common.chain)
;
2604 tmpl_types = TREE_CHAIN (tmpl_types)((contains_struct_check ((tmpl_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2604, __FUNCTION__))->common.chain)
;
2605
2606 if (DECL_HAS_IN_CHARGE_PARM_P (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2606, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2606, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2606, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2606, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2606, __FUNCTION__); &lt->u.fn; })->has_in_charge_parm_p
)
)
2607 {
2608 /* DECL may contain more parameters than TMPL due to the extra
2609 in-charge parameter in constructors and destructors. */
2610 in_charge = spec_types;
2611 spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2611, __FUNCTION__))->common.chain)
;
2612 }
2613 if (DECL_HAS_VTT_PARM_P (decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2613, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2613, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (decl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (decl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2613, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((decl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2613, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2613, __FUNCTION__); &lt->u.fn; })->has_vtt_parm_p
)
)
2614 {
2615 vtt = spec_types;
2616 spec_types = TREE_CHAIN (spec_types)((contains_struct_check ((spec_types), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2616, __FUNCTION__))->common.chain)
;
2617 }
2618 }
2619
2620 /* Compute the merged default arguments. */
2621 new_spec_types =
2622 copy_default_args_to_explicit_spec_1 (spec_types, tmpl_types);
2623
2624 /* Compute the new FUNCTION_TYPE. */
2625 if (object_type)
2626 {
2627 if (vtt)
2628 new_spec_types = hash_tree_cons (TREE_PURPOSE (vtt)((tree_check ((vtt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2628, __FUNCTION__, (TREE_LIST)))->list.purpose)
,
2629 TREE_VALUE (vtt)((tree_check ((vtt), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2629, __FUNCTION__, (TREE_LIST)))->list.value)
,
2630 new_spec_types);
2631
2632 if (in_charge)
2633 /* Put the in-charge parameter back. */
2634 new_spec_types = hash_tree_cons (TREE_PURPOSE (in_charge)((tree_check ((in_charge), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2634, __FUNCTION__, (TREE_LIST)))->list.purpose)
,
2635 TREE_VALUE (in_charge)((tree_check ((in_charge), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2635, __FUNCTION__, (TREE_LIST)))->list.value)
,
2636 new_spec_types);
2637
2638 new_type = build_method_type_directly (object_type,
2639 TREE_TYPE (old_type)((contains_struct_check ((old_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2639, __FUNCTION__))->typed.type)
,
2640 new_spec_types);
2641 }
2642 else
2643 new_type = build_function_type (TREE_TYPE (old_type)((contains_struct_check ((old_type), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2643, __FUNCTION__))->typed.type)
,
2644 new_spec_types);
2645 new_type = cp_build_type_attribute_variant (new_type,
2646 TYPE_ATTRIBUTES (old_type)((tree_class_check ((old_type), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2646, __FUNCTION__))->type_common.attributes)
);
2647 new_type = cxx_copy_lang_qualifiers (new_type, old_type);
2648
2649 TREE_TYPE (decl)((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2649, __FUNCTION__))->typed.type)
= new_type;
2650}
2651
2652/* Return the number of template headers we expect to see for a definition
2653 or specialization of CTYPE or one of its non-template members. */
2654
2655int
2656num_template_headers_for_class (tree ctype)
2657{
2658 int num_templates = 0;
2659
2660 while (ctype && CLASS_TYPE_P (ctype)(((((enum tree_code) (ctype)->base.code)) == RECORD_TYPE ||
(((enum tree_code) (ctype)->base.code)) == UNION_TYPE) &&
((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2660, __FUNCTION__))->type_common.lang_flag_5))
)
2661 {
2662 /* You're supposed to have one `template <...>' for every
2663 template class, but you don't need one for a full
2664 specialization. For example:
2665
2666 template <class T> struct S{};
2667 template <> struct S<int> { void f(); };
2668 void S<int>::f () {}
2669
2670 is correct; there shouldn't be a `template <>' for the
2671 definition of `S<int>::f'. */
2672 if (!CLASSTYPE_TEMPLATE_INFO (ctype)(((tree_class_check (((tree_check3 ((ctype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2672, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2672, __FUNCTION__))->type_non_common.lang_1))
)
2673 /* If CTYPE does not have template information of any
2674 kind, then it is not a template, nor is it nested
2675 within a template. */
2676 break;
2677 if (explicit_class_specialization_p (ctype))
2678 break;
2679 if (PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (ctype))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((tree_class_check (((tree_check3
((ctype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((ctype), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2679, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
2680 ++num_templates;
2681
2682 ctype = TYPE_CONTEXT (ctype)((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2682, __FUNCTION__))->type_common.context)
;
2683 }
2684
2685 return num_templates;
2686}
2687
2688/* Do a simple sanity check on the template headers that precede the
2689 variable declaration DECL. */
2690
2691void
2692check_template_variable (tree decl)
2693{
2694 tree ctx = CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2694, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2694, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2694, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
;
2695 int wanted = num_template_headers_for_class (ctx);
2696 if (DECL_LANG_SPECIFIC (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2696, __FUNCTION__))->decl_common.lang_specific)
&& DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2696, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2696, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
2697 && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((contains_struct_check (
(template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2697, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
)
2698 {
2699 if (cxx_dialect < cxx14)
2700 pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2700, __FUNCTION__))->decl_minimal.locus)
, OPT_Wc__14_extensions,
2701 "variable templates only available with "
2702 "%<-std=c++14%> or %<-std=gnu++14%>");
2703
2704 // Namespace-scope variable templates should have a template header.
2705 ++wanted;
2706 }
2707 if (template_header_count > wanted)
2708 {
2709 auto_diagnostic_group d;
2710 bool warned = pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2710, __FUNCTION__))->decl_minimal.locus)
, 0,
2711 "too many template headers for %qD "
2712 "(should be %d)",
2713 decl, wanted);
2714 if (warned && CLASS_TYPE_P (ctx)(((((enum tree_code) (ctx)->base.code)) == RECORD_TYPE || (
((enum tree_code) (ctx)->base.code)) == UNION_TYPE) &&
((tree_class_check ((ctx), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2714, __FUNCTION__))->type_common.lang_flag_5))
2715 && CLASSTYPE_TEMPLATE_SPECIALIZATION (ctx)(((((tree_class_check ((ctx), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2715, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) == 2)
)
2716 inform (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2716, __FUNCTION__))->decl_minimal.locus)
,
2717 "members of an explicitly specialized class are defined "
2718 "without a template header");
2719 }
2720}
2721
2722/* An explicit specialization whose declarator-id or class-head-name is not
2723 qualified shall be declared in the nearest enclosing namespace of the
2724 template, or, if the namespace is inline (7.3.1), any namespace from its
2725 enclosing namespace set.
2726
2727 If the name declared in the explicit instantiation is an unqualified name,
2728 the explicit instantiation shall appear in the namespace where its template
2729 is declared or, if that namespace is inline (7.3.1), any namespace from its
2730 enclosing namespace set. */
2731
2732void
2733check_unqualified_spec_or_inst (tree t, location_t loc)
2734{
2735 tree tmpl = most_general_template (t);
2736 if (DECL_NAMESPACE_SCOPE_P (tmpl)(!(((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2736, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (tmpl)->base.code) == CONST_DECL || ((
enum tree_code) (tmpl)->base.code) == PARM_DECL || ((enum tree_code
) (tmpl)->base.code) == TYPE_DECL || ((enum tree_code) (tmpl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2736, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2736, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((tmpl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2736, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
2737 && !is_nested_namespace (current_namespacescope_chain->old_namespace,
2738 CP_DECL_CONTEXT (tmpl)(!(! (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2738, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2738, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((tmpl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2738, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
, true))
2739 {
2740 if (processing_specializationscope_chain->x_processing_specialization)
2741 permerror (loc, "explicit specialization of %qD outside its "
2742 "namespace must use a nested-name-specifier", tmpl);
2743 else if (processing_explicit_instantiationscope_chain->x_processing_explicit_instantiation
2744 && cxx_dialect >= cxx11)
2745 /* This was allowed in C++98, so only pedwarn. */
2746 pedwarn (loc, OPT_Wpedantic, "explicit instantiation of %qD "
2747 "outside its namespace must use a nested-name-"
2748 "specifier", tmpl);
2749 }
2750}
2751
2752/* Warn for a template specialization SPEC that is missing some of a set
2753 of function or type attributes that the template TEMPL is declared with.
2754 ATTRLIST is a list of additional attributes that SPEC should be taken
2755 to ultimately be declared with. */
2756
2757static void
2758warn_spec_missing_attributes (tree tmpl, tree spec, tree attrlist)
2759{
2760 if (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2760, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2760, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
)
2761 tmpl = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2761, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
2762
2763 /* Avoid warning if the difference between the primary and
2764 the specialization is not in one of the attributes below. */
2765 const char* const blacklist[] = {
2766 "alloc_align", "alloc_size", "assume_aligned", "format",
2767 "format_arg", "malloc", "nonnull", NULL__null
2768 };
2769
2770 /* Put together a list of the black listed attributes that the primary
2771 template is declared with that the specialization is not, in case
2772 it's not apparent from the most recent declaration of the primary. */
2773 pretty_printer str;
2774 unsigned nattrs = decls_mismatched_attributes (tmpl, spec, attrlist,
2775 blacklist, &str);
2776
2777 if (!nattrs)
2778 return;
2779
2780 auto_diagnostic_group d;
2781 if (warning_at (DECL_SOURCE_LOCATION (spec)((contains_struct_check ((spec), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2781, __FUNCTION__))->decl_minimal.locus)
, OPT_Wmissing_attributes,
2782 "explicit specialization %q#D may be missing attributes",
2783 spec))
2784 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2784, __FUNCTION__))->decl_minimal.locus)
,
2785 nattrs > 1
2786 ? G_("missing primary template attributes %s")"missing primary template attributes %s"
2787 : G_("missing primary template attribute %s")"missing primary template attribute %s",
2788 pp_formatted_text (&str));
2789}
2790
2791/* Check to see if the function just declared, as indicated in
2792 DECLARATOR, and in DECL, is a specialization of a function
2793 template. We may also discover that the declaration is an explicit
2794 instantiation at this point.
2795
2796 Returns DECL, or an equivalent declaration that should be used
2797 instead if all goes well. Issues an error message if something is
2798 amiss. Returns error_mark_node if the error is not easily
2799 recoverable.
2800
2801 FLAGS is a bitmask consisting of the following flags:
2802
2803 2: The function has a definition.
2804 4: The function is a friend.
2805
2806 The TEMPLATE_COUNT is the number of references to qualifying
2807 template classes that appeared in the name of the function. For
2808 example, in
2809
2810 template <class T> struct S { void f(); };
2811 void S<int>::f();
2812
2813 the TEMPLATE_COUNT would be 1. However, explicitly specialized
2814 classes are not counted in the TEMPLATE_COUNT, so that in
2815
2816 template <class T> struct S {};
2817 template <> struct S<int> { void f(); }
2818 template <> void S<int>::f();
2819
2820 the TEMPLATE_COUNT would be 0. (Note that this declaration is
2821 invalid; there should be no template <>.)
2822
2823 If the function is a specialization, it is marked as such via
2824 DECL_TEMPLATE_SPECIALIZATION. Furthermore, its DECL_TEMPLATE_INFO
2825 is set up correctly, and it is added to the list of specializations
2826 for that template. */
2827
2828tree
2829check_explicit_specialization (tree declarator,
2830 tree decl,
2831 int template_count,
2832 int flags,
2833 tree attrlist)
2834{
2835 int have_def = flags & 2;
2836 int is_friend = flags & 4;
2837 bool is_concept = flags & 8;
2838 int specialization = 0;
2839 int explicit_instantiation = 0;
2840 int member_specialization = 0;
2841 tree ctype = DECL_CLASS_CONTEXT (decl)((((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2841, __FUNCTION__))->decl_minimal.context) && (
tree_code_type[(int) (((enum tree_code) (((contains_struct_check
((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2841, __FUNCTION__))->decl_minimal.context))->base.code
))] == tcc_type)) ? ((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2841, __FUNCTION__))->decl_minimal.context) : (tree) __null
)
;
2842 tree dname = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2842, __FUNCTION__))->decl_minimal.name)
;
2843 tmpl_spec_kind tsk;
2844
2845 if (is_friend)
2846 {
2847 if (!processing_specializationscope_chain->x_processing_specialization)
2848 tsk = tsk_none;
2849 else
2850 tsk = tsk_excessive_parms;
2851 }
2852 else
2853 tsk = current_tmpl_spec_kind (template_count);
2854
2855 switch (tsk)
2856 {
2857 case tsk_none:
2858 if (processing_specializationscope_chain->x_processing_specialization && !VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
2859 {
2860 specialization = 1;
2861 SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2861, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
2862 }
2863 else if (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR)
2864 {
2865 if (is_friend)
2866 /* This could be something like:
2867
2868 template <class T> void f(T);
2869 class S { friend void f<>(int); } */
2870 specialization = 1;
2871 else
2872 {
2873 /* This case handles bogus declarations like template <>
2874 template <class T> void f<int>(); */
2875
2876 error_at (cp_expr_loc_or_input_loc (declarator),
2877 "template-id %qE in declaration of primary template",
2878 declarator);
2879 return decl;
2880 }
2881 }
2882 break;
2883
2884 case tsk_invalid_member_spec:
2885 /* The error has already been reported in
2886 check_specialization_scope. */
2887 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
2888
2889 case tsk_invalid_expl_inst:
2890 error ("template parameter list used in explicit instantiation");
2891
2892 /* Fall through. */
2893
2894 case tsk_expl_inst:
2895 if (have_def)
2896 error ("definition provided for explicit instantiation");
2897
2898 explicit_instantiation = 1;
2899 break;
2900
2901 case tsk_excessive_parms:
2902 case tsk_insufficient_parms:
2903 if (tsk == tsk_excessive_parms)
2904 error ("too many template parameter lists in declaration of %qD",
2905 decl);
2906 else if (template_header_count)
2907 error("too few template parameter lists in declaration of %qD", decl);
2908 else
2909 error("explicit specialization of %qD must be introduced by "
2910 "%<template <>%>", decl);
2911
2912 /* Fall through. */
2913 case tsk_expl_spec:
2914 if (is_concept)
2915 error ("explicit specialization declared %<concept%>");
2916
2917 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL) && TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) != TEMPLATE_ID_EXPR)
2918 /* In cases like template<> constexpr bool v = true;
2919 We'll give an error in check_template_variable. */
2920 break;
2921
2922 SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2922, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
2923 if (ctype)
2924 member_specialization = 1;
2925 else
2926 specialization = 1;
2927 break;
2928
2929 case tsk_template:
2930 if (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR)
2931 {
2932 /* This case handles bogus declarations like template <>
2933 template <class T> void f<int>(); */
2934
2935 if (!uses_template_parms (TREE_OPERAND (declarator, 1)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2935, __FUNCTION__)))))
))
2936 error_at (cp_expr_loc_or_input_loc (declarator),
2937 "template-id %qE in declaration of primary template",
2938 declarator);
2939 else if (variable_template_p (TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2939, __FUNCTION__)))))
))
2940 {
2941 /* Partial specialization of variable template. */
2942 SET_DECL_TEMPLATE_SPECIALIZATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2942, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
2943 specialization = 1;
2944 goto ok;
2945 }
2946 else if (cxx_dialect < cxx14)
2947 error_at (cp_expr_loc_or_input_loc (declarator),
2948 "non-type partial specialization %qE "
2949 "is not allowed", declarator);
2950 else
2951 error_at (cp_expr_loc_or_input_loc (declarator),
2952 "non-class, non-variable partial specialization %qE "
2953 "is not allowed", declarator);
2954 return decl;
2955 ok:;
2956 }
2957
2958 if (ctype && CLASSTYPE_TEMPLATE_INSTANTIATION (ctype)(((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2958, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template) & 1)
)
2959 /* This is a specialization of a member template, without
2960 specialization the containing class. Something like:
2961
2962 template <class T> struct S {
2963 template <class U> void f (U);
2964 };
2965 template <> template <class U> void S<int>::f(U) {}
2966
2967 That's a specialization -- but of the entire template. */
2968 specialization = 1;
2969 break;
2970
2971 default:
2972 gcc_unreachable ()(fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2972, __FUNCTION__))
;
2973 }
2974
2975 if ((specialization || member_specialization)
2976 /* This doesn't apply to variable templates. */
2977 && FUNC_OR_METHOD_TYPE_P (TREE_TYPE (decl))(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2977, __FUNCTION__))->typed.type))->base.code) == FUNCTION_TYPE
|| ((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2977, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
2978 {
2979 tree t = TYPE_ARG_TYPES (TREE_TYPE (decl))((tree_check2 ((((contains_struct_check ((decl), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2979, __FUNCTION__))->typed.type)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2979, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))->type_non_common
.values)
;
2980 for (; t; t = TREE_CHAIN (t)((contains_struct_check ((t), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2980, __FUNCTION__))->common.chain)
)
2981 if (TREE_PURPOSE (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 2981, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
2982 {
2983 permerror (input_location,
2984 "default argument specified in explicit specialization");
2985 break;
2986 }
2987 }
2988
2989 if (specialization || member_specialization || explicit_instantiation)
2990 {
2991 tree tmpl = NULL_TREE(tree) __null;
2992 tree targs = NULL_TREE(tree) __null;
2993 bool was_template_id = (TREE_CODE (declarator)((enum tree_code) (declarator)->base.code) == TEMPLATE_ID_EXPR);
2994 bool found_hidden = false;
2995
2996 /* Make sure that the declarator is a TEMPLATE_ID_EXPR. */
2997 if (!was_template_id)
2998 {
2999 tree fns;
3000
3001 gcc_assert (identifier_p (declarator))((void)(!(identifier_p (declarator)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3001, __FUNCTION__), 0 : 0))
;
3002 if (ctype)
3003 fns = dname;
3004 else
3005 {
3006 /* If there is no class context, the explicit instantiation
3007 must be at namespace scope. */
3008 gcc_assert (DECL_NAMESPACE_SCOPE_P (decl))((void)(!((!(((contains_struct_check ((decl), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3008, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3008, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3008, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3008, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)) ? fancy_abort
("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3008, __FUNCTION__), 0 : 0))
;
3009
3010 /* Find the namespace binding, using the declaration
3011 context. */
3012 fns = lookup_qualified_name (CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3012, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3012, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3012, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
, dname,
3013 LOOK_want::NORMAL, true);
3014 if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3015 {
3016 /* If lookup fails, look for a friend declaration so we can
3017 give a better diagnostic. */
3018 fns = (lookup_qualified_name
3019 (CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3019, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3019, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3019, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
, dname,
3020 LOOK_want::NORMAL | LOOK_want::HIDDEN_FRIEND,
3021 /*complain*/true));
3022 found_hidden = true;
3023 }
3024
3025 if (fns == error_mark_nodeglobal_trees[TI_ERROR_MARK] || !is_overloaded_fn (fns))
3026 {
3027 error ("%qD is not a template function", dname);
3028 fns = error_mark_nodeglobal_trees[TI_ERROR_MARK];
3029 }
3030 }
3031
3032 declarator = lookup_template_function (fns, NULL_TREE(tree) __null);
3033 }
3034
3035 if (declarator == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3036 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3037
3038 if (ctype != NULL_TREE(tree) __null && TYPE_BEING_DEFINED (ctype)((((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3038, __FUNCTION__))->type_with_lang_specific.lang_specific
))->being_defined)
)
3039 {
3040 if (!explicit_instantiation)
3041 /* A specialization in class scope. This is invalid,
3042 but the error will already have been flagged by
3043 check_specialization_scope. */
3044 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3045 else
3046 {
3047 /* It's not valid to write an explicit instantiation in
3048 class scope, e.g.:
3049
3050 class C { template void f(); }
3051
3052 This case is caught by the parser. However, on
3053 something like:
3054
3055 template class C { void f(); };
3056
3057 (which is invalid) we can get here. The error will be
3058 issued later. */
3059 ;
3060 }
3061
3062 return decl;
3063 }
3064 else if (ctype != NULL_TREE(tree) __null
3065 && (identifier_p (TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3065, __FUNCTION__)))))
)))
3066 {
3067 // We'll match variable templates in start_decl.
3068 if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
3069 return decl;
3070
3071 /* Find the list of functions in ctype that have the same
3072 name as the declared function. */
3073 tree name = TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3073, __FUNCTION__)))))
;
3074
3075 if (constructor_name_p (name, ctype))
3076 {
3077 if (DECL_CONSTRUCTOR_P (decl)((tree_check (((((enum tree_code) (decl)->base.code) == TEMPLATE_DECL
? ((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3077, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3077, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
)
3078 ? !TYPE_HAS_USER_CONSTRUCTOR (ctype)(((tree_class_check ((ctype), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3078, __FUNCTION__))->type_common.lang_flag_1))
3079 : !CLASSTYPE_DESTRUCTOR (ctype)(get_class_binding_direct (ctype, cp_global_trees[CPTI_DTOR_IDENTIFIER
]))
)
3080 {
3081 /* From [temp.expl.spec]:
3082
3083 If such an explicit specialization for the member
3084 of a class template names an implicitly-declared
3085 special member function (clause _special_), the
3086 program is ill-formed.
3087
3088 Similar language is found in [temp.explicit]. */
3089 error ("specialization of implicitly-declared special member function");
3090 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3091 }
3092
3093 name = DECL_NAME (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3093, __FUNCTION__))->decl_minimal.name)
;
3094 }
3095
3096 /* For a type-conversion operator, We might be looking for
3097 `operator int' which will be a specialization of
3098 `operator T'. Grab all the conversion operators, and
3099 then select from them. */
3100 tree fns = get_class_binding (ctype, IDENTIFIER_CONV_OP_P (name)((((tree_not_check2 (((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3100, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3100, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((name),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3100, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3100, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1) & (!((tree_not_check2 (((tree_check ((name)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3100, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3100, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
3101 ? conv_op_identifiercp_global_trees[CPTI_CONV_OP_IDENTIFIER] : name);
3102
3103 if (fns == NULL_TREE(tree) __null)
3104 {
3105 error ("no member function %qD declared in %qT", name, ctype);
3106 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3107 }
3108 else
3109 TREE_OPERAND (declarator, 0)(*((const_cast<tree*> (tree_operand_check ((declarator)
, (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3109, __FUNCTION__)))))
= fns;
3110 }
3111
3112 /* Figure out what exactly is being specialized at this point.
3113 Note that for an explicit instantiation, even one for a
3114 member function, we cannot tell a priori whether the
3115 instantiation is for a member template, or just a member
3116 function of a template class. Even if a member template is
3117 being instantiated, the member template arguments may be
3118 elided if they can be deduced from the rest of the
3119 declaration. */
3120 tmpl = determine_specialization (declarator, decl,
3121 &targs,
3122 member_specialization,
3123 template_count,
3124 tsk);
3125
3126 if (!tmpl || tmpl == error_mark_nodeglobal_trees[TI_ERROR_MARK])
3127 /* We couldn't figure out what this declaration was
3128 specializing. */
3129 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3130 else
3131 {
3132 if (found_hidden && TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
3133 {
3134 auto_diagnostic_group d;
3135 if (pedwarn (DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3135, __FUNCTION__))->decl_minimal.locus)
, 0,
3136 "friend declaration %qD is not visible to "
3137 "explicit specialization", tmpl))
3138 inform (DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3138, __FUNCTION__))->decl_minimal.locus)
,
3139 "friend declaration here");
3140 }
3141
3142 if (!ctype && !is_friend
3143 && CP_DECL_CONTEXT (decl)(!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3143, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3143, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3143, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL])
== current_namespacescope_chain->old_namespace)
3144 check_unqualified_spec_or_inst (tmpl, DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3144, __FUNCTION__))->decl_minimal.locus)
);
3145
3146 tree gen_tmpl = most_general_template (tmpl);
3147
3148 if (explicit_instantiation)
3149 {
3150 /* We don't set DECL_EXPLICIT_INSTANTIATION here; that
3151 is done by do_decl_instantiation later. */
3152
3153 int arg_depth = TMPL_ARGS_DEPTH (targs)((targs && ((tree_check ((targs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3153, __FUNCTION__, (TREE_VEC)))->base.u.length) &&
(*((const_cast<tree *> (tree_vec_elt_check ((targs), (
0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3153, __FUNCTION__))))) && ((enum tree_code) ((*((const_cast
<tree *> (tree_vec_elt_check ((targs), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3153, __FUNCTION__))))))->base.code) == TREE_VEC) ? ((tree_check
((targs), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3153, __FUNCTION__, (TREE_VEC)))->base.u.length) : 1)
;
3154 int parm_depth = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))((long) ((unsigned long) (*tree_int_cst_elt_check ((((tree_check
((((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3154, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3154, __FUNCTION__, (TREE_LIST)))->list.purpose)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3154, __FUNCTION__))))
;
3155
3156 if (arg_depth > parm_depth)
3157 {
3158 /* If TMPL is not the most general template (for
3159 example, if TMPL is a friend template that is
3160 injected into namespace scope), then there will
3161 be too many levels of TARGS. Remove some of them
3162 here. */
3163 int i;
3164 tree new_targs;
3165
3166 new_targs = make_tree_vec (parm_depth);
3167 for (i = arg_depth - parm_depth; i < arg_depth; ++i)
3168 TREE_VEC_ELT (new_targs, i - (arg_depth - parm_depth))(*((const_cast<tree *> (tree_vec_elt_check ((new_targs)
, (i - (arg_depth - parm_depth)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3168, __FUNCTION__)))))
3169 = TREE_VEC_ELT (targs, i)(*((const_cast<tree *> (tree_vec_elt_check ((targs), (i
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3169, __FUNCTION__)))))
;
3170 targs = new_targs;
3171 }
3172
3173 return instantiate_template (tmpl, targs, tf_error);
3174 }
3175
3176 /* If we thought that the DECL was a member function, but it
3177 turns out to be specializing a static member function,
3178 make DECL a static member function as well. */
3179 if (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3179, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3179, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
3180 && DECL_STATIC_FUNCTION_P (tmpl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
(((((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL ?
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3180, __FUNCTION__, (TEMPLATE_DECL))))))))->result : tmpl
)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3180, __FUNCTION__))->decl_common.lang_specific); if (!(
((enum tree_code) (tmpl)->base.code) == FUNCTION_DECL || (
((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3180, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3180, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)) || lt->u.base.selector != lds_fn
) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3180, __FUNCTION__); &lt->u.fn; })->static_function
)
3181 && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)(((enum tree_code) (((contains_struct_check ((decl), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3181, __FUNCTION__))->typed.type))->base.code) == METHOD_TYPE
)
)
3182 revert_static_member_fn (decl);
3183
3184 /* If this is a specialization of a member template of a
3185 template class, we want to return the TEMPLATE_DECL, not
3186 the specialization of it. */
3187 if (tsk == tsk_template && !was_template_id)
3188 {
3189 tree result = DECL_TEMPLATE_RESULT (tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3189, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
3190 SET_DECL_TEMPLATE_SPECIALIZATION (tmpl)((((contains_struct_check ((tmpl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3190, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 2)
;
3191 DECL_INITIAL (result)((contains_struct_check ((result), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3191, __FUNCTION__))->decl_common.initial)
= NULL_TREE(tree) __null;
3192 if (have_def)
3193 {
3194 tree parm;
3195 DECL_SOURCE_LOCATION (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3195, __FUNCTION__))->decl_minimal.locus)
= DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3195, __FUNCTION__))->decl_minimal.locus)
;
3196 DECL_SOURCE_LOCATION (result)((contains_struct_check ((result), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3196, __FUNCTION__))->decl_minimal.locus)
3197 = DECL_SOURCE_LOCATION (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3197, __FUNCTION__))->decl_minimal.locus)
;
3198 /* We want to use the argument list specified in the
3199 definition, not in the original declaration. */
3200 DECL_ARGUMENTS (result)((tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3200, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
= DECL_ARGUMENTS (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3200, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
;
3201 for (parm = DECL_ARGUMENTS (result)((tree_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3201, __FUNCTION__, (FUNCTION_DECL)))->function_decl.arguments
)
; parm;
3202 parm = DECL_CHAIN (parm)(((contains_struct_check (((contains_struct_check ((parm), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3202, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3202, __FUNCTION__))->common.chain))
)
3203 DECL_CONTEXT (parm)((contains_struct_check ((parm), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3203, __FUNCTION__))->decl_minimal.context)
= result;
3204 }
3205 return register_specialization (tmpl, gen_tmpl, targs,
3206 is_friend, 0);
3207 }
3208
3209 /* Set up the DECL_TEMPLATE_INFO for DECL. */
3210 DECL_TEMPLATE_INFO (decl)(((contains_struct_check ((template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3210, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3210, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
= build_template_info (tmpl, targs);
3211
3212 if (was_template_id)
3213 TINFO_USED_TEMPLATE_ID (DECL_TEMPLATE_INFO (decl))(((tree_not_check2 (((tree_check (((((contains_struct_check (
(template_info_decl_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3213, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3213, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3213, __FUNCTION__, (TEMPLATE_INFO)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3213, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1))
= true;
3214
3215 /* Inherit default function arguments from the template
3216 DECL is specializing. */
3217 if (DECL_FUNCTION_TEMPLATE_P (tmpl)(((enum tree_code) (tmpl)->base.code) == TEMPLATE_DECL &&
((struct tree_template_decl *)(const_cast<union tree_node
*> ((((tree_check ((tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3217, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3217, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
)
3218 copy_default_args_to_explicit_spec (decl);
3219
3220 /* This specialization has the same protection as the
3221 template it specializes. */
3222 TREE_PRIVATE (decl)((decl)->base.private_flag) = TREE_PRIVATE (gen_tmpl)((gen_tmpl)->base.private_flag);
3223 TREE_PROTECTED (decl)((decl)->base.protected_flag) = TREE_PROTECTED (gen_tmpl)((gen_tmpl)->base.protected_flag);
3224
3225 /* 7.1.1-1 [dcl.stc]
3226
3227 A storage-class-specifier shall not be specified in an
3228 explicit specialization...
3229
3230 The parser rejects these, so unless action is taken here,
3231 explicit function specializations will always appear with
3232 global linkage.
3233
3234 The action recommended by the C++ CWG in response to C++
3235 defect report 605 is to make the storage class and linkage
3236 of the explicit specialization match the templated function:
3237
3238 http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#605
3239 */
3240 if (tsk == tsk_expl_spec && DECL_FUNCTION_TEMPLATE_P (gen_tmpl)(((enum tree_code) (gen_tmpl)->base.code) == TEMPLATE_DECL
&& ((struct tree_template_decl *)(const_cast<union
tree_node *> ((((tree_check ((gen_tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3240, __FUNCTION__, (TEMPLATE_DECL))))))))->result != (tree
) __null && ((enum tree_code) (((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((gen_tmpl
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3240, __FUNCTION__, (TEMPLATE_DECL))))))))->result)->
base.code) == FUNCTION_DECL)
)
3241 {
3242 tree tmpl_func = DECL_TEMPLATE_RESULT (gen_tmpl)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((gen_tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3242, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
3243 gcc_assert (TREE_CODE (tmpl_func) == FUNCTION_DECL)((void)(!(((enum tree_code) (tmpl_func)->base.code) == FUNCTION_DECL
) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3243, __FUNCTION__), 0 : 0))
;
3244
3245 /* A concept cannot be specialized. */
3246 if (DECL_DECLARED_CONCEPT_P (tmpl_func)(((contains_struct_check ((tmpl_func), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3246, __FUNCTION__))->decl_common.lang_specific)->u.base
.concept_p)
)
3247 {
3248 error ("explicit specialization of function concept %qD",
3249 gen_tmpl);
3250 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3251 }
3252
3253 /* This specialization has the same linkage and visibility as
3254 the function template it specializes. */
3255 TREE_PUBLIC (decl)((decl)->base.public_flag) = TREE_PUBLIC (tmpl_func)((tmpl_func)->base.public_flag);
3256 if (! TREE_PUBLIC (decl)((decl)->base.public_flag))
3257 {
3258 DECL_INTERFACE_KNOWN (decl)((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3258, __FUNCTION__))->decl_common.lang_flag_5)
= 1;
3259 DECL_NOT_REALLY_EXTERN (decl)(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3259, __FUNCTION__))->decl_common.lang_specific)->u.base
.not_really_extern)
= 1;
3260 }
3261 DECL_THIS_STATIC (decl)((contains_struct_check (((tree_check3 ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3261, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL
)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3261, __FUNCTION__))->decl_common.lang_flag_6)
= DECL_THIS_STATIC (tmpl_func)((contains_struct_check (((tree_check3 ((tmpl_func), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3261, __FUNCTION__, (VAR_DECL), (FUNCTION_DECL), (PARM_DECL
)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3261, __FUNCTION__))->decl_common.lang_flag_6)
;
3262 if (DECL_VISIBILITY_SPECIFIED (tmpl_func)((contains_struct_check ((tmpl_func), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3262, __FUNCTION__))->decl_with_vis.visibility_specified
)
)
3263 {
3264 DECL_VISIBILITY_SPECIFIED (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3264, __FUNCTION__))->decl_with_vis.visibility_specified
)
= 1;
3265 DECL_VISIBILITY (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3265, __FUNCTION__))->decl_with_vis.visibility)
= DECL_VISIBILITY (tmpl_func)((contains_struct_check ((tmpl_func), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3265, __FUNCTION__))->decl_with_vis.visibility)
;
3266 }
3267 }
3268
3269 /* If DECL is a friend declaration, declared using an
3270 unqualified name, the namespace associated with DECL may
3271 have been set incorrectly. For example, in:
3272
3273 template <typename T> void f(T);
3274 namespace N {
3275 struct S { friend void f<int>(int); }
3276 }
3277
3278 we will have set the DECL_CONTEXT for the friend
3279 declaration to N, rather than to the global namespace. */
3280 if (DECL_NAMESPACE_SCOPE_P (decl)(!(((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3280, __FUNCTION__))->decl_common.lang_flag_0) &&
(((enum tree_code) (decl)->base.code) == CONST_DECL || ((
enum tree_code) (decl)->base.code) == PARM_DECL || ((enum tree_code
) (decl)->base.code) == TYPE_DECL || ((enum tree_code) (decl
)->base.code) == TEMPLATE_DECL)) && ((enum tree_code
) ((!(! (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3280, __FUNCTION__))->decl_minimal.context)) || ((enum tree_code
) (((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3280, __FUNCTION__))->decl_minimal.context))->base.code
) == TRANSLATION_UNIT_DECL) ? ((contains_struct_check ((decl)
, (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3280, __FUNCTION__))->decl_minimal.context) : cp_global_trees
[CPTI_GLOBAL]))->base.code) == NAMESPACE_DECL)
)
3281 DECL_CONTEXT (decl)((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3281, __FUNCTION__))->decl_minimal.context)
= DECL_CONTEXT (tmpl)((contains_struct_check ((tmpl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3281, __FUNCTION__))->decl_minimal.context)
;
3282
3283 if (is_friend && !have_def)
3284 /* This is not really a declaration of a specialization.
3285 It's just the name of an instantiation. But, it's not
3286 a request for an instantiation, either. */
3287 SET_DECL_IMPLICIT_INSTANTIATION (decl)((((contains_struct_check ((decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3287, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template) = 1)
;
3288 else if (TREE_CODE (decl)((enum tree_code) (decl)->base.code) == FUNCTION_DECL)
3289 /* A specialization is not necessarily COMDAT. */
3290 DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3290, __FUNCTION__))->decl_with_vis.comdat_flag)
= (TREE_PUBLIC (decl)((decl)->base.public_flag)
3291 && DECL_DECLARED_INLINE_P (decl)((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3291, __FUNCTION__, (FUNCTION_DECL)))->function_decl.declared_inline_flag
)
);
3292 else if (VAR_P (decl)(((enum tree_code) (decl)->base.code) == VAR_DECL))
3293 DECL_COMDAT (decl)((contains_struct_check ((decl), (TS_DECL_WITH_VIS), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3293, __FUNCTION__))->decl_with_vis.comdat_flag)
= false;
3294
3295 /* If this is a full specialization, register it so that we can find
3296 it again. Partial specializations will be registered in
3297 process_partial_specialization. */
3298 if (!processing_template_declscope_chain->x_processing_template_decl)
3299 {
3300 warn_spec_missing_attributes (gen_tmpl, decl, attrlist);
3301
3302 decl = register_specialization (decl, gen_tmpl, targs,
3303 is_friend, 0);
3304 }
3305
3306
3307 /* A 'structor should already have clones. */
3308 gcc_assert (decl == error_mark_node((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p
(tmpl) || !(((tree_check (((((enum tree_code) (decl)->base
.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) || ((tree_check (((((enum tree_code) (decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
(((((contains_struct_check (((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__), 0 : 0))
3309 || variable_template_p (tmpl)((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p
(tmpl) || !(((tree_check (((((enum tree_code) (decl)->base
.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) || ((tree_check (((((enum tree_code) (decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
(((((contains_struct_check (((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__), 0 : 0))
3310 || !(DECL_CONSTRUCTOR_P (decl)((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p
(tmpl) || !(((tree_check (((((enum tree_code) (decl)->base
.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) || ((tree_check (((((enum tree_code) (decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
(((((contains_struct_check (((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__), 0 : 0))
3311 || DECL_DESTRUCTOR_P (decl))((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p
(tmpl) || !(((tree_check (((((enum tree_code) (decl)->base
.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) || ((tree_check (((((enum tree_code) (decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
(((((contains_struct_check (((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__), 0 : 0))
3312 || DECL_CLONED_FUNCTION_P (DECL_CHAIN (decl)))((void)(!(decl == global_trees[TI_ERROR_MARK] || variable_template_p
(tmpl) || !(((tree_check (((((enum tree_code) (decl)->base
.code) == TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast
<union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3310, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_constructor
) || ((tree_check (((((enum tree_code) (decl)->base.code) ==
TEMPLATE_DECL ? ((struct tree_template_decl *)(const_cast<
union tree_node *> ((((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (TEMPLATE_DECL))))))))->result : decl
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3311, __FUNCTION__, (FUNCTION_DECL)))->decl_with_vis.cxx_destructor
)) || (((contains_struct_check (((((contains_struct_check (((
contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) && ((!(
(tree_not_check2 (((tree_check ((((contains_struct_check ((((
(contains_struct_check (((contains_struct_check ((decl), (TS_DECL_MINIMAL
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_2)) & ((tree_not_check2 (((tree_check ((((contains_struct_check
(((((contains_struct_check (((contains_struct_check ((decl),
(TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (IDENTIFIER_NODE)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_1)) && !((((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_CTOR_IDENTIFIER]) || (((contains_struct_check (((((contains_struct_check
(((contains_struct_check ((decl), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->common.chain))), (TS_DECL_MINIMAL)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__))->decl_minimal.name) == cp_global_trees
[CPTI_DTOR_IDENTIFIER])))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3312, __FUNCTION__), 0 : 0))
;
3313 }
3314 }
3315
3316 return decl;
3317}
3318
3319/* Returns 1 iff PARMS1 and PARMS2 are identical sets of template
3320 parameters. These are represented in the same format used for
3321 DECL_TEMPLATE_PARMS. */
3322
3323int
3324comp_template_parms (const_tree parms1, const_tree parms2)
3325{
3326 const_tree p1;
3327 const_tree p2;
3328
3329 if (parms1 == parms2)
3330 return 1;
3331
3332 for (p1 = parms1, p2 = parms2;
3333 p1 != NULL_TREE(tree) __null && p2 != NULL_TREE(tree) __null;
3334 p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3334, __FUNCTION__))->common.chain)
, p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3334, __FUNCTION__))->common.chain)
)
3335 {
3336 tree t1 = TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3336, __FUNCTION__, (TREE_LIST)))->list.value)
;
3337 tree t2 = TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3337, __FUNCTION__, (TREE_LIST)))->list.value)
;
3338 int i;
3339
3340 gcc_assert (TREE_CODE (t1) == TREE_VEC)((void)(!(((enum tree_code) (t1)->base.code) == TREE_VEC) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3340, __FUNCTION__), 0 : 0))
;
3341 gcc_assert (TREE_CODE (t2) == TREE_VEC)((void)(!(((enum tree_code) (t2)->base.code) == TREE_VEC) ?
fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3341, __FUNCTION__), 0 : 0))
;
3342
3343 if (TREE_VEC_LENGTH (t1)((tree_check ((t1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3343, __FUNCTION__, (TREE_VEC)))->base.u.length)
!= TREE_VEC_LENGTH (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3343, __FUNCTION__, (TREE_VEC)))->base.u.length)
)
3344 return 0;
3345
3346 for (i = 0; i < TREE_VEC_LENGTH (t2)((tree_check ((t2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3346, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
3347 {
3348 tree parm1 = TREE_VALUE (TREE_VEC_ELT (t1, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
((t1), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3348, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3348, __FUNCTION__, (TREE_LIST)))->list.value)
;
3349 tree parm2 = TREE_VALUE (TREE_VEC_ELT (t2, i))((tree_check (((*((const_cast<tree *> (tree_vec_elt_check
((t2), (i), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3349, __FUNCTION__)))))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3349, __FUNCTION__, (TREE_LIST)))->list.value)
;
3350
3351 /* If either of the template parameters are invalid, assume
3352 they match for the sake of error recovery. */
3353 if (error_operand_p (parm1) || error_operand_p (parm2))
3354 return 1;
3355
3356 if (TREE_CODE (parm1)((enum tree_code) (parm1)->base.code) != TREE_CODE (parm2)((enum tree_code) (parm2)->base.code))
3357 return 0;
3358
3359 if (TREE_CODE (parm1)((enum tree_code) (parm1)->base.code) == TEMPLATE_TYPE_PARM
3360 && (TEMPLATE_TYPE_PARAMETER_PACK (parm1)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((parm1)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3360, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3360, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3360, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3360, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
3361 == TEMPLATE_TYPE_PARAMETER_PACK (parm2)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((parm2)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3361, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3361, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3361, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3361, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
))
3362 continue;
3363 else if (!same_type_p (TREE_TYPE (parm1), TREE_TYPE (parm2))comptypes ((((contains_struct_check ((parm1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3363, __FUNCTION__))->typed.type)), (((contains_struct_check
((parm2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3363, __FUNCTION__))->typed.type)), 0)
)
3364 return 0;
3365 }
3366 }
3367
3368 if ((p1 != NULL_TREE(tree) __null) != (p2 != NULL_TREE(tree) __null))
3369 /* One set of parameters has more parameters lists than the
3370 other. */
3371 return 0;
3372
3373 return 1;
3374}
3375
3376/* Returns true if two template parameters are declared with
3377 equivalent constraints. */
3378
3379static bool
3380template_parameter_constraints_equivalent_p (const_tree parm1, const_tree parm2)
3381{
3382 tree req1 = TREE_TYPE (parm1)((contains_struct_check ((parm1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3382, __FUNCTION__))->typed.type)
;
3383 tree req2 = TREE_TYPE (parm2)((contains_struct_check ((parm2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3383, __FUNCTION__))->typed.type)
;
3384 if (!req1 != !req2)
3385 return false;
3386 if (req1)
3387 return cp_tree_equal (req1, req2);
3388 return true;
3389}
3390
3391/* Returns true when two template parameters are equivalent. */
3392
3393static bool
3394template_parameters_equivalent_p (const_tree parm1, const_tree parm2)
3395{
3396 tree decl1 = TREE_VALUE (parm1)((tree_check ((parm1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3396, __FUNCTION__, (TREE_LIST)))->list.value)
;
3397 tree decl2 = TREE_VALUE (parm2)((tree_check ((parm2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3397, __FUNCTION__, (TREE_LIST)))->list.value)
;
3398
3399 /* If either of the template parameters are invalid, assume
3400 they match for the sake of error recovery. */
3401 if (error_operand_p (decl1) || error_operand_p (decl2))
3402 return true;
3403
3404 /* ... they declare parameters of the same kind. */
3405 if (TREE_CODE (decl1)((enum tree_code) (decl1)->base.code) != TREE_CODE (decl2)((enum tree_code) (decl2)->base.code))
3406 return false;
3407
3408 /* ... one parameter was introduced by a parameter declaration, then
3409 both are. This case arises as a result of eagerly rewriting declarations
3410 during parsing. */
3411 if (DECL_VIRTUAL_P (decl1)((contains_struct_check ((decl1), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3411, __FUNCTION__))->decl_common.virtual_flag)
!= DECL_VIRTUAL_P (decl2)((contains_struct_check ((decl2), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3411, __FUNCTION__))->decl_common.virtual_flag)
)
3412 return false;
3413
3414 /* ... if either declares a pack, they both do. */
3415 if (template_parameter_pack_p (decl1) != template_parameter_pack_p (decl2))
3416 return false;
3417
3418 if (TREE_CODE (decl1)((enum tree_code) (decl1)->base.code) == PARM_DECL)
3419 {
3420 /* ... if they declare non-type parameters, the types are equivalent. */
3421 if (!same_type_p (TREE_TYPE (decl1), TREE_TYPE (decl2))comptypes ((((contains_struct_check ((decl1), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3421, __FUNCTION__))->typed.type)), (((contains_struct_check
((decl2), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3421, __FUNCTION__))->typed.type)), 0)
)
3422 return false;
3423 }
3424 else if (TREE_CODE (decl2)((enum tree_code) (decl2)->base.code) == TEMPLATE_DECL)
3425 {
3426 /* ... if they declare template template parameters, their template
3427 parameter lists are equivalent. */
3428 if (!template_heads_equivalent_p (decl1, decl2))
3429 return false;
3430 }
3431
3432 /* ... if they are declared with a qualified-concept name, they both
3433 are, and those names are equivalent. */
3434 return template_parameter_constraints_equivalent_p (parm1, parm2);
3435}
3436
3437/* Returns true if two template parameters lists are equivalent.
3438 Two template parameter lists are equivalent if they have the
3439 same length and their corresponding parameters are equivalent.
3440
3441 PARMS1 and PARMS2 are TREE_LISTs containing TREE_VECs: the
3442 data structure returned by DECL_TEMPLATE_PARMS.
3443
3444 This is generally the same implementation as comp_template_parms
3445 except that it also the concept names and arguments used to
3446 introduce parameters. */
3447
3448static bool
3449template_parameter_lists_equivalent_p (const_tree parms1, const_tree parms2)
3450{
3451 if (parms1 == parms2)
3452 return true;
3453
3454 const_tree p1 = parms1;
3455 const_tree p2 = parms2;
3456 while (p1 != NULL_TREE(tree) __null && p2 != NULL_TREE(tree) __null)
3457 {
3458 tree list1 = TREE_VALUE (p1)((tree_check ((p1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3458, __FUNCTION__, (TREE_LIST)))->list.value)
;
3459 tree list2 = TREE_VALUE (p2)((tree_check ((p2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3459, __FUNCTION__, (TREE_LIST)))->list.value)
;
3460
3461 if (TREE_VEC_LENGTH (list1)((tree_check ((list1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3461, __FUNCTION__, (TREE_VEC)))->base.u.length)
!= TREE_VEC_LENGTH (list2)((tree_check ((list2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3461, __FUNCTION__, (TREE_VEC)))->base.u.length)
)
3462 return 0;
3463
3464 for (int i = 0; i < TREE_VEC_LENGTH (list2)((tree_check ((list2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3464, __FUNCTION__, (TREE_VEC)))->base.u.length)
; ++i)
3465 {
3466 tree parm1 = TREE_VEC_ELT (list1, i)(*((const_cast<tree *> (tree_vec_elt_check ((list1), (i
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3466, __FUNCTION__)))))
;
3467 tree parm2 = TREE_VEC_ELT (list2, i)(*((const_cast<tree *> (tree_vec_elt_check ((list2), (i
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3467, __FUNCTION__)))))
;
3468 if (!template_parameters_equivalent_p (parm1, parm2))
3469 return false;
3470 }
3471
3472 p1 = TREE_CHAIN (p1)((contains_struct_check ((p1), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3472, __FUNCTION__))->common.chain)
;
3473 p2 = TREE_CHAIN (p2)((contains_struct_check ((p2), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3473, __FUNCTION__))->common.chain)
;
3474 }
3475
3476 if ((p1 != NULL_TREE(tree) __null) != (p2 != NULL_TREE(tree) __null))
3477 return false;
3478
3479 return true;
3480}
3481
3482/* Return true if the requires-clause of the template parameter lists are
3483 equivalent and false otherwise. */
3484static bool
3485template_requirements_equivalent_p (const_tree parms1, const_tree parms2)
3486{
3487 tree req1 = TEMPLATE_PARMS_CONSTRAINTS (parms1)((contains_struct_check (((tree_check ((parms1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3487, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3487, __FUNCTION__))->typed.type)
;
3488 tree req2 = TEMPLATE_PARMS_CONSTRAINTS (parms2)((contains_struct_check (((tree_check ((parms2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3488, __FUNCTION__, (TREE_LIST)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3488, __FUNCTION__))->typed.type)
;
3489 if ((req1 != NULL_TREE(tree) __null) != (req2 != NULL_TREE(tree) __null))
3490 return false;
3491 if (!cp_tree_equal (req1, req2))
3492 return false;
3493 return true;
3494}
3495
3496/* Returns true if two template heads are equivalent. 17.6.6.1p6:
3497 Two template heads are equivalent if their template parameter
3498 lists are equivalent and their requires clauses are equivalent.
3499
3500 In pre-C++20, this is equivalent to calling comp_template_parms
3501 for the template parameters of TMPL1 and TMPL2. */
3502
3503bool
3504template_heads_equivalent_p (const_tree tmpl1, const_tree tmpl2)
3505{
3506 tree parms1 = DECL_TEMPLATE_PARMS (tmpl1)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3506, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
;
3507 tree parms2 = DECL_TEMPLATE_PARMS (tmpl2)((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((tmpl2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3507, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments
;
3508
3509 /* Don't change the matching rules for pre-C++20. */
3510 if (cxx_dialect < cxx20)
3511 return comp_template_parms (parms1, parms2);
3512
3513 /* ... have the same number of template parameters, and their
3514 corresponding parameters are equivalent. */
3515 if (!template_parameter_lists_equivalent_p (parms1, parms2))
3516 return false;
3517
3518 /* ... if either has a requires-clause, they both do and their
3519 corresponding constraint-expressions are equivalent. */
3520 return template_requirements_equivalent_p (parms1, parms2);
3521}
3522
3523/* Determine whether PARM is a parameter pack. */
3524
3525bool
3526template_parameter_pack_p (const_tree parm)
3527{
3528 /* Determine if we have a non-type template parameter pack. */
3529 if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == PARM_DECL)
3530 return (DECL_TEMPLATE_PARM_P (parm)(((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3530, __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))
3531 && TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm))(((tree_not_check2 (((tree_check ((((contains_struct_check ((
parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3531, __FUNCTION__))->decl_common.initial)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3531, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3531, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
);
3532 if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_PARM_INDEX)
3533 return TEMPLATE_PARM_PARAMETER_PACK (parm)(((tree_not_check2 (((tree_check ((parm), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3533, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3533, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
;
3534
3535 /* If this is a list of template parameters, we could get a
3536 TYPE_DECL or a TEMPLATE_DECL. */
3537 if (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TYPE_DECL || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_DECL)
3538 parm = TREE_TYPE (parm)((contains_struct_check ((parm), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3538, __FUNCTION__))->typed.type)
;
3539
3540 /* Otherwise it must be a type template parameter. */
3541 return ((TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_TYPE_PARM
3542 || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_TEMPLATE_PARM)
3543 && TEMPLATE_TYPE_PARAMETER_PACK (parm)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((parm)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3543, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3543, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3543, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3543, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
);
3544}
3545
3546/* Determine if T is a function parameter pack. */
3547
3548bool
3549function_parameter_pack_p (const_tree t)
3550{
3551 if (t && TREE_CODE (t)((enum tree_code) (t)->base.code) == PARM_DECL)
3552 return DECL_PACK_P (t)((tree_code_type[(int) (((enum tree_code) (t)->base.code))
] == tcc_declaration) && (((enum tree_code) (((contains_struct_check
((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3552, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3552, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION
))
;
3553 return false;
3554}
3555
3556/* Return the function template declaration of PRIMARY_FUNC_TMPL_INST.
3557 PRIMARY_FUNC_TMPL_INST is a primary function template instantiation. */
3558
3559tree
3560get_function_template_decl (const_tree primary_func_tmpl_inst)
3561{
3562 if (! primary_func_tmpl_inst
3563 || TREE_CODE (primary_func_tmpl_inst)((enum tree_code) (primary_func_tmpl_inst)->base.code) != FUNCTION_DECL
3564 || ! primary_template_specialization_p (primary_func_tmpl_inst))
3565 return NULL__null;
3566
3567 return DECL_TEMPLATE_RESULT (DECL_TI_TEMPLATE (primary_func_tmpl_inst))((struct tree_template_decl *)(const_cast<union tree_node *
> ((((tree_check ((((struct tree_template_info*)(tree_check
(((((contains_struct_check ((template_info_decl_check ((primary_func_tmpl_inst
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3567, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3567, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3567, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3567, __FUNCTION__, (TEMPLATE_DECL))))))))->result
;
3568}
3569
3570/* Return true iff the function parameter PARAM_DECL was expanded
3571 from the function parameter pack PACK. */
3572
3573bool
3574function_parameter_expanded_from_pack_p (tree param_decl, tree pack)
3575{
3576 if (DECL_ARTIFICIAL (param_decl)((contains_struct_check ((param_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3576, __FUNCTION__))->decl_common.artificial_flag)
3577 || !function_parameter_pack_p (pack))
3578 return false;
3579
3580 /* The parameter pack and its pack arguments have the same
3581 DECL_PARM_INDEX. */
3582 return DECL_PARM_INDEX (pack)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((pack), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3582, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (pack)->base.code) != PARM_DECL || lt->
u.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3582, __FUNCTION__); &lt->u.parm; })->index)
== DECL_PARM_INDEX (param_decl)(__extension__ ({ struct lang_decl *lt = ((contains_struct_check
((param_decl), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3582, __FUNCTION__))->decl_common.lang_specific); if (((
enum tree_code) (param_decl)->base.code) != PARM_DECL || lt
->u.base.selector != lds_parm) lang_check_failed ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3582, __FUNCTION__); &lt->u.parm; })->index)
;
3583}
3584
3585/* Determine whether ARGS describes a variadic template args list,
3586 i.e., one that is terminated by a template argument pack. */
3587
3588static bool
3589template_args_variadic_p (tree args)
3590{
3591 int nargs;
3592 tree last_parm;
3593
3594 if (args == NULL_TREE(tree) __null)
3595 return false;
3596
3597 args = INNERMOST_TEMPLATE_ARGS (args)(get_innermost_template_args ((args), 1));
3598 nargs = TREE_VEC_LENGTH (args)((tree_check ((args), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3598, __FUNCTION__, (TREE_VEC)))->base.u.length)
;
3599
3600 if (nargs == 0)
3601 return false;
3602
3603 last_parm = TREE_VEC_ELT (args, nargs - 1)(*((const_cast<tree *> (tree_vec_elt_check ((args), (nargs
- 1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3603, __FUNCTION__)))))
;
3604
3605 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
)
;
3606}
3607
3608/* Generate a new name for the parameter pack name NAME (an
3609 IDENTIFIER_NODE) that incorporates its */
3610
3611static tree
3612make_ith_pack_parameter_name (tree name, int i)
3613{
3614 /* Munge the name to include the parameter index. */
3615#define NUMBUF_LEN128 128
3616 char numbuf[NUMBUF_LEN128];
3617 char* newname;
3618 int newname_len;
3619
3620 if (name == NULL_TREE(tree) __null)
3621 return name;
3622 snprintf (numbuf, NUMBUF_LEN128, "%i", i);
3623 newname_len = IDENTIFIER_LENGTH (name)((tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3623, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.len
)
3624 + strlen (numbuf) + 2;
3625 newname = (char*)alloca (newname_len)__builtin_alloca(newname_len);
3626 snprintf (newname, newname_len,
3627 "%s#%i", IDENTIFIER_POINTER (name)((const char *) (tree_check ((name), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3627, __FUNCTION__, (IDENTIFIER_NODE)))->identifier.id.str
)
, i);
3628 return get_identifier (newname)(__builtin_constant_p (newname) ? get_identifier_with_length (
(newname), strlen (newname)) : get_identifier (newname))
;
3629}
3630
3631/* Return true if T is a primary function, class or alias template
3632 specialization, not including the template pattern. */
3633
3634bool
3635primary_template_specialization_p (const_tree t)
3636{
3637 if (!t)
3638 return false;
3639
3640 if (VAR_OR_FUNCTION_DECL_P (t)(((enum tree_code) (t)->base.code) == VAR_DECL || ((enum tree_code
) (t)->base.code) == FUNCTION_DECL)
)
3641 return (DECL_LANG_SPECIFIC (t)((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3641, __FUNCTION__))->decl_common.lang_specific)
3642 && DECL_USE_TEMPLATE (t)(((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3642, __FUNCTION__))->decl_common.lang_specific)->u.base
.use_template)
3643 && DECL_TEMPLATE_INFO (t)(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3643, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3643, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)
3644 && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((contains_struct_check (
(template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((contains_struct_check ((template_info_decl_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3644, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
);
3645 else if (CLASS_TYPE_P (t)(((((enum tree_code) (t)->base.code)) == RECORD_TYPE || ((
(enum tree_code) (t)->base.code)) == UNION_TYPE) &&
((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3645, __FUNCTION__))->type_common.lang_flag_5))
&& !TYPE_DECL_ALIAS_P (TYPE_NAME (t))((contains_struct_check (((tree_check ((((tree_class_check ((
t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3645, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3645, __FUNCTION__, (TYPE_DECL)))), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3645, __FUNCTION__))->decl_common.lang_flag_6)
)
3646 return (CLASSTYPE_TEMPLATE_INFO (t)(((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3646, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3646, __FUNCTION__))->type_non_common.lang_1))
3647 && CLASSTYPE_USE_TEMPLATE (t)((((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3647, __FUNCTION__))->type_with_lang_specific.lang_specific
))->use_template)
3648 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t))(((((contains_struct_check ((((tree_check ((((struct tree_template_decl
*)(const_cast<union tree_node *> ((((tree_check ((((struct
tree_template_info*)(tree_check (((((tree_class_check (((tree_check3
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__))->typed.type))) == (((struct tree_template_info
*)(tree_check (((((tree_class_check (((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__))->type_non_common.lang_1))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3648, __FUNCTION__, (TEMPLATE_INFO))))->tmpl))
);
3649 else if (alias_template_specialization_p (t, nt_transparent))
3650 return true;
3651 return false;
3652}
3653
3654/* Return true if PARM is a template template parameter. */
3655
3656bool
3657template_template_parameter_p (const_tree parm)
3658{
3659 return DECL_TEMPLATE_TEMPLATE_PARM_P (parm)(((enum tree_code) (parm)->base.code) == TEMPLATE_DECL &&
(((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3659, __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)))
;
3660}
3661
3662/* Return true iff PARM is a DECL representing a type template
3663 parameter. */
3664
3665bool
3666template_type_parameter_p (const_tree parm)
3667{
3668 return (parm
3669 && (TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TYPE_DECL
3670 || TREE_CODE (parm)((enum tree_code) (parm)->base.code) == TEMPLATE_DECL)
3671 && DECL_TEMPLATE_PARM_P (parm)(((contains_struct_check ((parm), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3671, __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))
);
3672}
3673
3674/* Return the template parameters of T if T is a
3675 primary template instantiation, NULL otherwise. */
3676
3677tree
3678get_primary_template_innermost_parameters (const_tree t)
3679{
3680 tree parms = NULL__null, template_info = NULL__null;
3681
3682 if ((template_info = get_template_info (t))
3683 && primary_template_specialization_p (t))
3684 parms = INNERMOST_TEMPLATE_PARMS((tree_check ((((struct tree_template_decl *)(const_cast<union
tree_node *> ((((tree_check ((((struct tree_template_info
*)(tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3685, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3685, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3685, __FUNCTION__, (TREE_LIST)))->list.value)
3685 (DECL_TEMPLATE_PARMS (TI_TEMPLATE (template_info)))((tree_check ((((struct tree_template_decl *)(const_cast<union
tree_node *> ((((tree_check ((((struct tree_template_info
*)(tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3685, __FUNCTION__, (TEMPLATE_INFO))))->tmpl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3685, __FUNCTION__, (TEMPLATE_DECL))))))))->arguments), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3685, __FUNCTION__, (TREE_LIST)))->list.value)
;
3686
3687 return parms;
3688}
3689
3690/* Returns the template arguments of T if T is a template instantiation,
3691 NULL otherwise. */
3692
3693tree
3694get_template_innermost_arguments (const_tree t)
3695{
3696 tree args = NULL__null, template_info = NULL__null;
3697
3698 if ((template_info = get_template_info (t))
3699 && TI_ARGS (template_info)((struct tree_template_info*)(tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3699, __FUNCTION__, (TEMPLATE_INFO))))->args
)
3700 args = INNERMOST_TEMPLATE_ARGS (TI_ARGS (template_info))(get_innermost_template_args ((((struct tree_template_info*)(
tree_check ((template_info), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3700, __FUNCTION__, (TEMPLATE_INFO))))->args), 1))
;
3701
3702 return args;
3703}
3704
3705/* Return the argument pack elements of T if T is a template argument pack,
3706 NULL otherwise. */
3707
3708tree
3709get_template_argument_pack_elems (const_tree t)
3710{
3711 if (TREE_CODE (t)((enum tree_code) (t)->base.code) != TYPE_ARGUMENT_PACK
3712 && TREE_CODE (t)((enum tree_code) (t)->base.code) != NONTYPE_ARGUMENT_PACK)
3713 return NULL__null;
3714
3715 return ARGUMENT_PACK_ARGS (t)(((enum tree_code) (t)->base.code) == TYPE_ARGUMENT_PACK? (
(contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3715, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((t), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3715, __FUNCTION__))))))
;
3716}
3717
3718/* In an ARGUMENT_PACK_SELECT, the actual underlying argument that the
3719 ARGUMENT_PACK_SELECT represents. */
3720
3721static tree
3722argument_pack_select_arg (tree t)
3723{
3724 tree args = ARGUMENT_PACK_ARGS (ARGUMENT_PACK_SELECT_FROM_PACK (t))(((enum tree_code) ((((struct tree_argument_pack_select *)(tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3724, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack
))->base.code) == TYPE_ARGUMENT_PACK? ((contains_struct_check
(((((struct tree_argument_pack_select *)(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3724, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack
)), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3724, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check (((((struct tree_argument_pack_select
*)(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3724, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->argument_pack
)), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3724, __FUNCTION__))))))
;
3725 tree arg = TREE_VEC_ELT (args, ARGUMENT_PACK_SELECT_INDEX (t))(*((const_cast<tree *> (tree_vec_elt_check ((args), (((
(struct tree_argument_pack_select *)(tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3725, __FUNCTION__, (ARGUMENT_PACK_SELECT))))->index)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3725, __FUNCTION__)))))
;
3726
3727 /* If the selected argument is an expansion E, that most likely means we were
3728 called from gen_elem_of_pack_expansion_instantiation during the
3729 substituting of an argument pack (of which the Ith element is a pack
3730 expansion, where I is ARGUMENT_PACK_SELECT_INDEX) into a pack expansion.
3731 In this case, the Ith element resulting from this substituting is going to
3732 be a pack expansion, which pattern is the pattern of E. Let's return the
3733 pattern of E, and gen_elem_of_pack_expansion_instantiation will build the
3734 resulting pack expansion from it. */
3735 if (PACK_EXPANSION_P (arg)(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (arg)->base.code) == EXPR_PACK_EXPANSION
)
)
3736 {
3737 /* Make sure we aren't throwing away arg info. */
3738 gcc_assert (!PACK_EXPANSION_EXTRA_ARGS (arg))((void)(!(!*(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION
? &((tree_class_check ((arg), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3738, __FUNCTION__))->type_non_common.maxval) : &(*(
(const_cast<tree*> (tree_operand_check (((arg)), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3738, __FUNCTION__))))))) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3738, __FUNCTION__), 0 : 0))
;
3739 arg = PACK_EXPANSION_PATTERN (arg)(((enum tree_code) (arg)->base.code) == TYPE_PACK_EXPANSION
? ((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3739, __FUNCTION__))->typed.type) : (*((const_cast<tree
*> (tree_operand_check ((arg), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3739, __FUNCTION__))))))
;
3740 }
3741
3742 return arg;
3743}
3744
3745
3746/* True iff FN is a function representing a built-in variadic parameter
3747 pack. */
3748
3749bool
3750builtin_pack_fn_p (tree fn)
3751{
3752 if (!fn
3753 || TREE_CODE (fn)((enum tree_code) (fn)->base.code) != FUNCTION_DECL
3754 || !DECL_IS_UNDECLARED_BUILTIN (fn)(((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3754, __FUNCTION__))->decl_minimal.locus) <= ((location_t
) 1))
)
3755 return false;
3756
3757 if (id_equal (DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3757, __FUNCTION__))->decl_minimal.name)
, "__integer_pack"))
3758 return true;
3759
3760 return false;
3761}
3762
3763/* True iff CALL is a call to a function representing a built-in variadic
3764 parameter pack. */
3765
3766static bool
3767builtin_pack_call_p (tree call)
3768{
3769 if (TREE_CODE (call)((enum tree_code) (call)->base.code) != CALL_EXPR)
3770 return false;
3771 return builtin_pack_fn_p (CALL_EXPR_FN (call)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3771, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3771, __FUNCTION__)))))
);
3772}
3773
3774/* Return a TREE_VEC for the expansion of __integer_pack(HI). */
3775
3776static tree
3777expand_integer_pack (tree call, tree args, tsubst_flags_t complain,
3778 tree in_decl)
3779{
3780 tree ohi = CALL_EXPR_ARG (call, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3780, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3780, __FUNCTION__)))))
;
3781 tree hi = tsubst_copy_and_build (ohi, args, complain, in_decl,
3782 false/*fn*/, true/*int_cst*/);
3783
3784 if (value_dependent_expression_p (hi))
3785 {
3786 if (hi != ohi)
3787 {
3788 call = copy_node (call);
3789 CALL_EXPR_ARG (call, 0)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3789, __FUNCTION__, (CALL_EXPR)))), ((0) + 3), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3789, __FUNCTION__)))))
= hi;
3790 }
3791 tree ex = make_pack_expansion (call, complain);
3792 tree vec = make_tree_vec (1);
3793 TREE_VEC_ELT (vec, 0)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (0),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3793, __FUNCTION__)))))
= ex;
3794 return vec;
3795 }
3796 else
3797 {
3798 hi = cxx_constant_value (hi);
3799 int len = valid_constant_size_p (hi) ? tree_to_shwi (hi) : -1;
3800
3801 /* Calculate the largest value of len that won't make the size of the vec
3802 overflow an int. The compiler will exceed resource limits long before
3803 this, but it seems a decent place to diagnose. */
3804 int max = ((INT_MAX2147483647 - sizeof (tree_vec)) / sizeof (tree)) + 1;
3805
3806 if (len < 0 || len > max)
3807 {
3808 if ((complain & tf_error)
3809 && hi != error_mark_nodeglobal_trees[TI_ERROR_MARK])
3810 error ("argument to %<__integer_pack%> must be between 0 and %d",
3811 max);
3812 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
3813 }
3814
3815 tree vec = make_tree_vec (len);
3816
3817 for (int i = 0; i < len; ++i)
3818 TREE_VEC_ELT (vec, i)(*((const_cast<tree *> (tree_vec_elt_check ((vec), (i),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3818, __FUNCTION__)))))
= size_int (i)size_int_kind (i, stk_sizetype);
3819
3820 return vec;
3821 }
3822}
3823
3824/* Return a TREE_VEC for the expansion of built-in template parameter pack
3825 CALL. */
3826
3827static tree
3828expand_builtin_pack_call (tree call, tree args, tsubst_flags_t complain,
3829 tree in_decl)
3830{
3831 if (!builtin_pack_call_p (call))
3832 return NULL_TREE(tree) __null;
3833
3834 tree fn = CALL_EXPR_FN (call)(*((const_cast<tree*> (tree_operand_check (((tree_check
((call), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3834, __FUNCTION__, (CALL_EXPR)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3834, __FUNCTION__)))))
;
3835
3836 if (id_equal (DECL_NAME (fn)((contains_struct_check ((fn), (TS_DECL_MINIMAL), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3836, __FUNCTION__))->decl_minimal.name)
, "__integer_pack"))
3837 return expand_integer_pack (call, args, complain, in_decl);
3838
3839 return NULL_TREE(tree) __null;
3840}
3841
3842/* Return true if the tree T has the extra args mechanism for
3843 avoiding partial instantiation. */
3844
3845static bool
3846has_extra_args_mechanism_p (const_tree t)
3847{
3848 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 */
3849 || TREE_CODE (t)((enum tree_code) (t)->base.code) == REQUIRES_EXPR /* REQUIRES_EXPR_EXTRA_ARGS */
3850 || (TREE_CODE (t)((enum tree_code) (t)->base.code) == IF_STMT
3851 && IF_STMT_CONSTEXPR_P (t)((tree_not_check2 (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3851, __FUNCTION__, (IF_STMT)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3851, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
)); /* IF_STMT_EXTRA_ARGS */
3852}
3853
3854/* Structure used to track the progress of find_parameter_packs_r. */
3855struct find_parameter_pack_data
3856{
3857 /* TREE_LIST that will contain all of the parameter packs found by
3858 the traversal. */
3859 tree* parameter_packs;
3860
3861 /* Set of AST nodes that have been visited by the traversal. */
3862 hash_set<tree> *visited;
3863
3864 /* True iff we're making a type pack expansion. */
3865 bool type_pack_expansion_p;
3866
3867 /* True iff we found a subtree that has the extra args mechanism. */
3868 bool found_extra_args_tree_p = false;
3869};
3870
3871/* Identifies all of the argument packs that occur in a template
3872 argument and appends them to the TREE_LIST inside DATA, which is a
3873 find_parameter_pack_data structure. This is a subroutine of
3874 make_pack_expansion and uses_parameter_packs. */
3875static tree
3876find_parameter_packs_r (tree *tp, int *walk_subtrees, void* data)
3877{
3878 tree t = *tp;
3879 struct find_parameter_pack_data* ppd =
3880 (struct find_parameter_pack_data*)data;
3881 bool parameter_pack_p = false;
3882
3883#define WALK_SUBTREE(NODE)do { for_each_template_parm (NODE, keep_template_parm, data, &
ftpi->visited, true, any_template_parm_r); } while (0)
\
3884 cp_walk_tree (&(NODE), &find_parameter_packs_r, \walk_tree_1 (&(NODE), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
3885 ppd, ppd->visited)walk_tree_1 (&(NODE), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
\
3886
3887 /* Don't look through typedefs; we are interested in whether a
3888 parameter pack is actually written in the expression/type we're
3889 looking at, not the target type. */
3890 if (TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))]
== tcc_type)
&& typedef_variant_p (t))
3891 {
3892 /* But do look at arguments for an alias template. */
3893 if (tree tinfo = TYPE_ALIAS_TEMPLATE_INFO (t)(((contains_struct_check ((((tree_class_check ((t), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3893, __FUNCTION__))->type_common.name)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3893, __FUNCTION__))->decl_common.lang_specific) ? (((contains_struct_check
((template_info_decl_check ((((tree_class_check ((t), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3893, __FUNCTION__))->type_common.name)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3893, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3893, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info) : (tree) __null)
)
3894 cp_walk_tree (&TI_ARGS (tinfo),walk_tree_1 (&((struct tree_template_info*)(tree_check ((
tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3894, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3895 &find_parameter_packs_r,walk_tree_1 (&((struct tree_template_info*)(tree_check ((
tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3894, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3896 ppd, ppd->visited)walk_tree_1 (&((struct tree_template_info*)(tree_check ((
tinfo), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3894, __FUNCTION__, (TEMPLATE_INFO))))->args, &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3897 *walk_subtrees = 0;
3898 return NULL_TREE(tree) __null;
3899 }
3900
3901 /* Identify whether this is a parameter pack or not. */
3902 switch (TREE_CODE (t)((enum tree_code) (t)->base.code))
3903 {
3904 case TEMPLATE_PARM_INDEX:
3905 if (TEMPLATE_PARM_PARAMETER_PACK (t)(((tree_not_check2 (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3905, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3905, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0))
)
3906 parameter_pack_p = true;
3907 break;
3908
3909 case TEMPLATE_TYPE_PARM:
3910 t = TYPE_MAIN_VARIANT (t)((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3910, __FUNCTION__))->type_common.main_variant)
;
3911 /* FALLTHRU */
3912 case TEMPLATE_TEMPLATE_PARM:
3913 /* If the placeholder appears in the decl-specifier-seq of a function
3914 parameter pack (14.6.3), or the type-specifier-seq of a type-id that
3915 is a pack expansion, the invented template parameter is a template
3916 parameter pack. */
3917 if (ppd->type_pack_expansion_p && is_auto (t))
3918 TEMPLATE_TYPE_PARAMETER_PACK (t)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3918, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3918, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3918, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3918, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
= true;
3919 if (TEMPLATE_TYPE_PARAMETER_PACK (t)((((tree_not_check2 (((tree_check (((((tree_class_check (((tree_check3
(((t)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3919, __FUNCTION__, (TEMPLATE_TYPE_PARM), (TEMPLATE_TEMPLATE_PARM
), (BOUND_TEMPLATE_TEMPLATE_PARM)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3919, __FUNCTION__))->type_non_common.values))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3919, __FUNCTION__, (TEMPLATE_PARM_INDEX)))), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3919, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)))
)
3920 parameter_pack_p = true;
3921 break;
3922
3923 case FIELD_DECL:
3924 case PARM_DECL:
3925 if (DECL_PACK_P (t)((tree_code_type[(int) (((enum tree_code) (t)->base.code))
] == tcc_declaration) && (((enum tree_code) (((contains_struct_check
((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3925, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3925, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION
))
)
3926 {
3927 /* We don't want to walk into the type of a PARM_DECL,
3928 because we don't want to see the type parameter pack. */
3929 *walk_subtrees = 0;
3930 parameter_pack_p = true;
3931 }
3932 break;
3933
3934 case VAR_DECL:
3935 if (DECL_PACK_P (t)((tree_code_type[(int) (((enum tree_code) (t)->base.code))
] == tcc_declaration) && (((enum tree_code) (((contains_struct_check
((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3935, __FUNCTION__))->typed.type))->base.code) == TYPE_PACK_EXPANSION
|| ((enum tree_code) (((contains_struct_check ((t), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3935, __FUNCTION__))->typed.type))->base.code) == EXPR_PACK_EXPANSION
))
)
3936 {
3937 /* We don't want to walk into the type of a variadic capture proxy,
3938 because we don't want to see the type parameter pack. */
3939 *walk_subtrees = 0;
3940 parameter_pack_p = true;
3941 }
3942 else if (variable_template_specialization_p (t))
3943 {
3944 cp_walk_tree (&DECL_TI_ARGS (t),walk_tree_1 (&((struct tree_template_info*)(tree_check ((
(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3945 find_parameter_packs_r,walk_tree_1 (&((struct tree_template_info*)(tree_check ((
(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3946 ppd, ppd->visited)walk_tree_1 (&((struct tree_template_info*)(tree_check ((
(((contains_struct_check ((template_info_decl_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__)), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__))->decl_common.lang_specific) ->u.
min.template_info)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3944, __FUNCTION__, (TEMPLATE_INFO))))->args, find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3947 *walk_subtrees = 0;
3948 }
3949 break;
3950
3951 case CALL_EXPR:
3952 if (builtin_pack_call_p (t))
3953 parameter_pack_p = true;
3954 break;
3955
3956 case BASES:
3957 parameter_pack_p = true;
3958 break;
3959 default:
3960 /* Not a parameter pack. */
3961 break;
3962 }
3963
3964 if (parameter_pack_p)
3965 {
3966 /* Add this parameter pack to the list. */
3967 *ppd->parameter_packs = tree_cons (NULL_TREE(tree) __null, t, *ppd->parameter_packs);
3968 }
3969
3970 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)
)
3971 ppd->found_extra_args_tree_p = true;
3972
3973 if (TYPE_P (t)(tree_code_type[(int) (((enum tree_code) (t)->base.code))]
== tcc_type)
)
3974 cp_walk_tree (&TYPE_CONTEXT (t),walk_tree_1 (&((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3974, __FUNCTION__))->type_common.context), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3975 &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3974, __FUNCTION__))->type_common.context), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3976
3977 /* This switch statement will return immediately if we don't find a
3978 parameter pack. ??? Should some of these be in cp_walk_subtrees? */
3979 switch (TREE_CODE (t)((enum tree_code) (t)->base.code))
3980 {
3981 case BOUND_TEMPLATE_TEMPLATE_PARM:
3982 /* Check the template itself. */
3983 cp_walk_tree (&TREE_TYPE (TYPE_TI_TEMPLATE (t)),walk_tree_1 (&((contains_struct_check (((((struct tree_template_info
*)(tree_check (((((enum tree_code) (t)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (t)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| (((enum tree_code) (t)->base.code) == RECORD_TYPE || (
(enum tree_code) (t)->base.code) == UNION_TYPE || ((enum tree_code
) (t)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check
((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3983, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3983, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3983, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
3984 &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((contains_struct_check (((((struct tree_template_info
*)(tree_check (((((enum tree_code) (t)->base.code) == ENUMERAL_TYPE
|| ((enum tree_code) (t)->base.code) == BOUND_TEMPLATE_TEMPLATE_PARM
|| (((enum tree_code) (t)->base.code) == RECORD_TYPE || (
(enum tree_code) (t)->base.code) == UNION_TYPE || ((enum tree_code
) (t)->base.code) == QUAL_UNION_TYPE) ? ((tree_class_check
((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3983, __FUNCTION__))->type_non_common.lang_1) : (tree) __null
)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3983, __FUNCTION__, (TEMPLATE_INFO))))->tmpl)), (TS_TYPED
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3983, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
3985 return NULL_TREE(tree) __null;
3986
3987 case DECL_EXPR:
3988 {
3989 tree decl = DECL_EXPR_DECL (t)(*((const_cast<tree*> (tree_operand_check (((tree_check
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3989, __FUNCTION__, (DECL_EXPR)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3989, __FUNCTION__)))))
;
3990 /* Ignore the declaration of a capture proxy for a parameter pack. */
3991 if (is_capture_proxy (decl))
3992 *walk_subtrees = 0;
3993 if (is_typedef_decl (decl))
3994 /* Since we stop at typedefs above, we need to look through them at
3995 the point of the DECL_EXPR. */
3996 cp_walk_tree (&DECL_ORIGINAL_TYPE (decl),walk_tree_1 (&((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3996, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
3997 &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((tree_check ((decl), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 3996, __FUNCTION__, (TYPE_DECL)))->decl_non_common.result
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
;
3998 return NULL_TREE(tree) __null;
3999 }
4000
4001 case TEMPLATE_DECL:
4002 if (!DECL_TEMPLATE_TEMPLATE_PARM_P (t)(((enum tree_code) (t)->base.code) == TEMPLATE_DECL &&
(((contains_struct_check ((t), (TS_DECL_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4002, __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)))
)
4003 return NULL_TREE(tree) __null;
4004 cp_walk_tree (&TREE_TYPE (t),walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4004, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4005 &find_parameter_packs_r, ppd, ppd->visited)walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4004, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4006 return NULL_TREE(tree) __null;
4007
4008 case TYPE_PACK_EXPANSION:
4009 case EXPR_PACK_EXPANSION:
4010 *walk_subtrees = 0;
4011 return NULL_TREE(tree) __null;
4012
4013 case INTEGER_TYPE:
4014 cp_walk_tree (&TYPE_MAX_VALUE (t), &find_parameter_packs_r,walk_tree_1 (&((tree_check5 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4014, __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
)
4015 ppd, ppd->visited)walk_tree_1 (&((tree_check5 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4014, __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
)
;
4016 *walk_subtrees = 0;
4017 return NULL_TREE(tree) __null;
4018
4019 case IDENTIFIER_NODE:
4020 cp_walk_tree (&TREE_TYPE (t), &find_parameter_packs_r, ppd,walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4020, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4021 ppd->visited)walk_tree_1 (&((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4020, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4022 *walk_subtrees = 0;
4023 return NULL_TREE(tree) __null;
4024
4025 case LAMBDA_EXPR:
4026 {
4027 /* Since we defer implicit capture, look in the parms and body. */
4028 tree fn = lambda_function (t);
4029 cp_walk_tree (&TREE_TYPE (fn), &find_parameter_packs_r, ppd,walk_tree_1 (&((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4029, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4030 ppd->visited)walk_tree_1 (&((contains_struct_check ((fn), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4029, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4031 cp_walk_tree (&DECL_SAVED_TREE (fn), &find_parameter_packs_r, ppd,walk_tree_1 (&((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4031, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
4032 ppd->visited)walk_tree_1 (&((tree_check ((fn), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4031, __FUNCTION__, (FUNCTION_DECL)))->function_decl.saved_tree
), &find_parameter_packs_r, ppd, ppd->visited, cp_walk_subtrees
)
;
4033 return NULL_TREE(tree) __null;
4034 }
4035
4036 case DECLTYPE_TYPE:
4037 {
4038 /* When traversing a DECLTYPE_TYPE_EXPR, we need to set
4039 type_pack_expansion_p to false so that any placeholders
4040 within the expression don't get marked as parameter packs. */
4041 bool type_pack_expansion_p = ppd->type_pack_expansion_p;
4042 ppd->type_pack_expansion_p = false;
4043 cp_walk_tree (&DECLTYPE_TYPE_EXPR (t), &find_parameter_packs_r,walk_tree_1 (&(((tree_class_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4043, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4043, __FUNCTION__))->type_non_common.values)), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4044 ppd, ppd->visited)walk_tree_1 (&(((tree_class_check (((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4043, __FUNCTION__, (DECLTYPE_TYPE)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4043, __FUNCTION__))->type_non_common.values)), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4045 ppd->type_pack_expansion_p = type_pack_expansion_p;
4046 *walk_subtrees = 0;
4047 return NULL_TREE(tree) __null;
4048 }
4049
4050 case IF_STMT:
4051 cp_walk_tree (&IF_COND (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4051, __FUNCTION__, (IF_STMT)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4051, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
4052 ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4051, __FUNCTION__, (IF_STMT)))), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4051, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
;
4053 cp_walk_tree (&THEN_CLAUSE (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4053, __FUNCTION__, (IF_STMT)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4053, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
4054 ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4053, __FUNCTION__, (IF_STMT)))), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4053, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
;
4055 cp_walk_tree (&ELSE_CLAUSE (t), &find_parameter_packs_r,walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4055, __FUNCTION__, (IF_STMT)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4055, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
4056 ppd, ppd->visited)walk_tree_1 (&(*((const_cast<tree*> (tree_operand_check
(((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4055, __FUNCTION__, (IF_STMT)))), (2), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4055, __FUNCTION__))))), &find_parameter_packs_r, ppd, ppd
->visited, cp_walk_subtrees)
;
4057 /* Don't walk into IF_STMT_EXTRA_ARGS. */
4058 *walk_subtrees = 0;
4059 return NULL_TREE(tree) __null;
4060
4061 case TAG_DEFN:
4062 t = TREE_TYPE (t)((contains_struct_check ((t), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4062, __FUNCTION__))->typed.type)
;
4063 if (CLASS_TYPE_P (t)(((((enum tree_code) (t)->base.code)) == RECORD_TYPE || ((
(enum tree_code) (t)->base.code)) == UNION_TYPE) &&
((tree_class_check ((t), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4063, __FUNCTION__))->type_common.lang_flag_5))
)
4064 /* Local class, need to look through the whole definition. */
4065 for (tree bb : BINFO_BASE_BINFOS (TYPE_BINFO (t))(&(tree_check ((((tree_check3 ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4065, __FUNCTION__, (RECORD_TYPE), (UNION_TYPE), (QUAL_UNION_TYPE
)))->type_non_common.maxval)), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4065, __FUNCTION__, (TREE_BINFO)))->binfo.base_binfos)
)
4066 cp_walk_tree (&BINFO_TYPE (bb), &find_parameter_packs_r,walk_tree_1 (&((contains_struct_check (((tree_check ((bb)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4066, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4066, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4067 ppd, ppd->visited)walk_tree_1 (&((contains_struct_check (((tree_check ((bb)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4066, __FUNCTION__, (TREE_BINFO)))), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4066, __FUNCTION__))->typed.type), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4068 else
4069 /* Enum, look at the values. */
4070 for (tree l = TYPE_VALUES (t)((tree_check ((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4070, __FUNCTION__, (ENUMERAL_TYPE)))->type_non_common.values
)
; l; l = TREE_CHAIN (l)((contains_struct_check ((l), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4070, __FUNCTION__))->common.chain)
)
4071 cp_walk_tree (&DECL_INITIAL (TREE_VALUE (l)),walk_tree_1 (&((contains_struct_check ((((tree_check ((l)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4071, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4071, __FUNCTION__))->decl_common.initial), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4072 &find_parameter_packs_r,walk_tree_1 (&((contains_struct_check ((((tree_check ((l)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4071, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4071, __FUNCTION__))->decl_common.initial), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
4073 ppd, ppd->visited)walk_tree_1 (&((contains_struct_check ((((tree_check ((l)
, "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4071, __FUNCTION__, (TREE_LIST)))->list.value)), (TS_DECL_COMMON
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4071, __FUNCTION__))->decl_common.initial), &find_parameter_packs_r
, ppd, ppd->visited, cp_walk_subtrees)
;
4074 return NULL_TREE(tree) __null;
4075
4076 case FUNCTION_TYPE:
4077 case METHOD_TYPE:
4078 WALK_SUBTREE (TYPE_RAISES_EXCEPTIONS (t))do { for_each_template_parm (((tree_class_check (((tree_check2
((t), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4078, __FUNCTION__, (FUNCTION_TYPE), (METHOD_TYPE)))), (tcc_type
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4078, __FUNCTION__))->type_non_common.lang_1), keep_template_parm
, data, &ftpi->visited, true, any_template_parm_r); } while
(0)
;
4079 break;
4080
4081 default:
4082 return NULL_TREE(tree) __null;
4083 }
4084
4085#undef WALK_SUBTREE
4086
4087 return NULL_TREE(tree) __null;
4088}
4089
4090/* Determines if the expression or type T uses any parameter packs. */
4091tree
4092uses_parameter_packs (tree t)
4093{
4094 tree parameter_packs = NULL_TREE(tree) __null;
4095 struct find_parameter_pack_data ppd;
4096 ppd.parameter_packs = &parameter_packs;
4097 ppd.visited = new hash_set<tree>;
4098 ppd.type_pack_expansion_p = false;
4099 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)
;
4100 delete ppd.visited;
4101 return parameter_packs;
4102}
4103
4104/* Turn ARG, which may be an expression, type, or a TREE_LIST
4105 representation a base-class initializer into a parameter pack
4106 expansion. If all goes well, the resulting node will be an
4107 EXPR_PACK_EXPANSION, TYPE_PACK_EXPANSION, or TREE_LIST,
4108 respectively. */
4109tree
4110make_pack_expansion (tree arg, tsubst_flags_t complain)
4111{
4112 tree result;
4113 tree parameter_packs = NULL_TREE(tree) __null;
4114 bool for_types = false;
4115 struct find_parameter_pack_data ppd;
4116
4117 if (!arg || arg == error_mark_nodeglobal_trees[TI_ERROR_MARK])
4118 return arg;
4119
4120 if (TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TREE_LIST && TREE_PURPOSE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4120, __FUNCTION__, (TREE_LIST)))->list.purpose)
)
4121 {
4122 /* A TREE_LIST with a non-null TREE_PURPOSE is for a base
4123 class initializer. In this case, the TREE_PURPOSE will be a
4124 _TYPE node (representing the base class expansion we're
4125 initializing) and the TREE_VALUE will be a TREE_LIST
4126 containing the initialization arguments.
4127
4128 The resulting expansion looks somewhat different from most
4129 expansions. Rather than returning just one _EXPANSION, we
4130 return a TREE_LIST whose TREE_PURPOSE is a
4131 TYPE_PACK_EXPANSION containing the bases that will be
4132 initialized. The TREE_VALUE will be identical to the
4133 original TREE_VALUE, which is a list of arguments that will
4134 be passed to each base. We do not introduce any new pack
4135 expansion nodes into the TREE_VALUE (although it is possible
4136 that some already exist), because the TREE_PURPOSE and
4137 TREE_VALUE all need to be expanded together with the same
4138 _EXPANSION node. Note that the TYPE_PACK_EXPANSION in the
4139 resulting TREE_PURPOSE will mention the parameter packs in
4140 both the bases and the arguments to the bases. */
4141 tree purpose;
4142 tree value;
4143 tree parameter_packs = NULL_TREE(tree) __null;
4144
4145 /* Determine which parameter packs will be used by the base
4146 class expansion. */
4147 ppd.visited = new hash_set<tree>;
4148 ppd.parameter_packs = &parameter_packs;
4149 ppd.type_pack_expansion_p = false;
4150 gcc_assert (TYPE_P (TREE_PURPOSE (arg)))((void)(!((tree_code_type[(int) (((enum tree_code) (((tree_check
((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4150, __FUNCTION__, (TREE_LIST)))->list.purpose))->base
.code))] == tcc_type)) ? fancy_abort ("/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4150, __FUNCTION__), 0 : 0))
;
4151 cp_walk_tree (&TREE_PURPOSE (arg), &find_parameter_packs_r,walk_tree_1 (&((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4151, __FUNCTION__, (TREE_LIST)))->list.purpose), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
4152 &ppd, ppd.visited)walk_tree_1 (&((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4151, __FUNCTION__, (TREE_LIST)))->list.purpose), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
;
4153
4154 if (parameter_packs == NULL_TREE(tree) __null)
4155 {
4156 if (complain & tf_error)
4157 error ("base initializer expansion %qT contains no parameter packs",
4158 arg);
4159 delete ppd.visited;
4160 return error_mark_nodeglobal_trees[TI_ERROR_MARK];
4161 }
4162
4163 if (TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4163, __FUNCTION__, (TREE_LIST)))->list.value)
!= void_type_nodeglobal_trees[TI_VOID_TYPE])
4164 {
4165 /* Collect the sets of parameter packs used in each of the
4166 initialization arguments. */
4167 for (value = TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4167, __FUNCTION__, (TREE_LIST)))->list.value)
; value; value = TREE_CHAIN (value)((contains_struct_check ((value), (TS_COMMON), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4167, __FUNCTION__))->common.chain)
)
4168 {
4169 /* Determine which parameter packs will be expanded in this
4170 argument. */
4171 cp_walk_tree (&TREE_VALUE (value), &find_parameter_packs_r,walk_tree_1 (&((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4171, __FUNCTION__, (TREE_LIST)))->list.value), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
4172 &ppd, ppd.visited)walk_tree_1 (&((tree_check ((value), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4171, __FUNCTION__, (TREE_LIST)))->list.value), &find_parameter_packs_r
, &ppd, ppd.visited, cp_walk_subtrees)
;
4173 }
4174 }
4175
4176 delete ppd.visited;
4177
4178 /* Create the pack expansion type for the base type. */
4179 purpose = cxx_make_type (TYPE_PACK_EXPANSION);
4180 SET_PACK_EXPANSION_PATTERN (purpose, TREE_PURPOSE (arg))if (((enum tree_code) (purpose)->base.code) == TYPE_PACK_EXPANSION
) ((contains_struct_check ((purpose), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4180, __FUNCTION__))->typed.type) = ((tree_check ((arg),
"/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4180, __FUNCTION__, (TREE_LIST)))->list.purpose); else (
*((const_cast<tree*> (tree_operand_check ((purpose), (0
), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4180, __FUNCTION__))))) = ((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4180, __FUNCTION__, (TREE_LIST)))->list.purpose)
;
4181 PACK_EXPANSION_PARAMETER_PACKS (purpose)*(((enum tree_code) (purpose)->base.code) == EXPR_PACK_EXPANSION
? &(*((const_cast<tree*> (tree_operand_check ((purpose
), (1), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4181, __FUNCTION__))))) : &((tree_class_check (((tree_check
((purpose), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4181, __FUNCTION__, (TYPE_PACK_EXPANSION)))), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4181, __FUNCTION__))->type_non_common.minval))
= parameter_packs;
4182 PACK_EXPANSION_LOCAL_P (purpose)((tree_not_check2 ((purpose), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4182, __FUNCTION__, (TREE_VEC), (SSA_NAME)))->base.u.bits
.lang_flag_0)
= at_function_scope_p ();
4183
4184 /* Just use structural equality for these TYPE_PACK_EXPANSIONS;
4185 they will rarely be compared to anything. */
4186 SET_TYPE_STRUCTURAL_EQUALITY (purpose)(((tree_class_check ((purpose), (tcc_type), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4186, __FUNCTION__))->type_common.canonical) = (tree) __null
)
;
4187
4188 return tree_cons (purpose, TREE_VALUE (arg)((tree_check ((arg), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4188, __FUNCTION__, (TREE_LIST)))->list.value)
, NULL_TREE(tree) __null);
4189 }
4190
4191 if (TYPE_P (arg)(tree_code_type[(int) (((enum tree_code) (arg)->base.code)
)] == tcc_type)
|| TREE_CODE (arg)((enum tree_code) (arg)->base.code) == TEMPLATE_DECL)
4192 for_types = true;
4193
4194 /* Build the PACK_EXPANSION_* node. */
4195 result = for_types
4196 ? cxx_make_type (TYPE_PACK_EXPANSION)
4197 : make_node (EXPR_PACK_EXPANSION);
4198 SET_PACK_EXPANSION_PATTERN (result, arg)if (((enum tree_code) (result)->base.code) == TYPE_PACK_EXPANSION
) ((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4198, __FUNCTION__))->typed.type) = arg; else (*((const_cast
<tree*> (tree_operand_check ((result), (0), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4198, __FUNCTION__))))) = arg
;
4199 if (TREE_CODE (result)((enum tree_code) (result)->base.code) == EXPR_PACK_EXPANSION)
4200 {
4201 /* Propagate type and const-expression information. */
4202 TREE_TYPE (result)((contains_struct_check ((result), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4202, __FUNCTION__))->typed.type)
= TREE_TYPE (arg)((contains_struct_check ((arg), (TS_TYPED), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang-static-analyzer/build/gcc/cp/pt.c"
, 4202, __FUNCTION__))->typed.type)
;
4203 TREE_CONSTANT (result)((non_type_check ((result), "/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang