Lines Matching defs:tree

34 #include "tree.h"
38 #include "cp-tree.h"
40 #include "tree-inline.h"
47 #include "tree-iterator.h"
50 /* The type of functions taking a tree, and some additional data, and
52 typedef int (*tree_fn_t) (tree, void*);
60 static GTY(()) tree pending_templates;
61 static GTY(()) tree last_pending_template;
66 static GTY(()) tree saved_trees;
69 static GTY(()) tree current_tinst_level;
71 static GTY(()) tree saved_access_scope;
76 static tree cur_stmt_expr;
92 static void push_access_scope (tree);
93 static void pop_access_scope (tree);
94 static bool resolve_overloaded_unification (tree, tree, tree, tree,
96 static int try_one_overload (tree, tree, tree, tree, tree,
98 static int unify (tree, tree, tree, tree, int);
99 static void add_pending_template (tree);
100 static int push_tinst_level (tree);
102 static void reopen_tinst_level (tree);
103 static tree classtype_mangled_name (tree);
104 static char* mangle_class_name_for_template (const char *, tree, tree);
105 static tree tsubst_initializer_list (tree, tree);
106 static tree get_class_bindings (tree, tree, tree);
107 static tree coerce_template_parms (tree, tree, tree, tsubst_flags_t,
109 static void tsubst_enum (tree, tree, tree);
110 static tree add_to_template_args (tree, tree);
111 static tree add_outermost_template_args (tree, tree);
112 static bool check_instantiated_args (tree, tree, tsubst_flags_t);
113 static int maybe_adjust_types_for_deduction (unification_kind_t, tree*, tree*);
114 static int type_unification_real (tree, tree, tree, tree,
117 static tree convert_nontype_argument_function (tree, tree);
118 static tree convert_nontype_argument (tree, tree);
119 static tree convert_template_argument (tree, tree, tree,
120 tsubst_flags_t, int, tree);
121 static int for_each_template_parm (tree, tree_fn_t, void*,
123 static tree build_template_parm_index (int, int, int, tree, tree);
124 static int inline_needs_template_parms (tree);
125 static void push_inline_template_parms_recursive (tree, int);
126 static tree retrieve_local_specialization (tree);
127 static void register_local_specialization (tree, tree);
128 static tree reduce_template_parm_level (tree, tree, int);
129 static int mark_template_parm (tree, void *);
130 static int template_parm_this_level_p (tree, void *);
131 static tree tsubst_friend_function (tree, tree);
132 static tree tsubst_friend_class (tree, tree);
133 static int can_complete_type_without_circularity (tree);
134 static tree get_bindings (tree, tree, tree, bool);
135 static int template_decl_level (tree);
136 static int check_cv_quals_for_unify (int, tree, tree);
137 static tree tsubst_template_arg (tree, tree, tsubst_flags_t, tree);
138 static tree tsubst_template_args (tree, tree, tsubst_flags_t, tree);
139 static tree tsubst_template_parms (tree, tree, tsubst_flags_t);
140 static void regenerate_decl_from_template (tree, tree);
141 static tree most_specialized_class (tree, tree);
142 static tree tsubst_aggr_type (tree, tree, tsubst_flags_t, tree, int);
143 static tree tsubst_arg_types (tree, tree, tsubst_flags_t, tree);
144 static tree tsubst_function_type (tree, tree, tsubst_flags_t, tree);
146 static tree process_partial_specialization (tree);
147 static void set_current_access_from_decl (tree);
148 static void check_default_tmpl_args (tree, tree, int, int);
149 static tree get_template_base (tree, tree, tree, tree);
150 static tree try_class_unification (tree, tree, tree, tree);
151 static int coerce_template_template_parms (tree, tree, tsubst_flags_t,
152 tree, tree);
153 static int template_args_equal (tree, tree);
154 static void tsubst_default_arguments (tree);
155 static tree for_each_template_parm_r (tree *, int *, void *);
156 static tree copy_default_args_to_explicit_spec_1 (tree, tree);
157 static void copy_default_args_to_explicit_spec (tree);
158 static int invalid_nontype_parm_type_p (tree, tsubst_flags_t);
160 static bool dependent_type_p_r (tree);
161 static tree tsubst (tree, tree, tsubst_flags_t, tree);
162 static tree tsubst_expr (tree, tree, tsubst_flags_t, tree, bool);
163 static tree tsubst_copy (tree, tree, tsubst_flags_t, tree);
171 push_access_scope (tree t)
195 pop_access_scope (tree t)
214 tree
215 finish_member_template_decl (tree decl)
224 tree type;
231 tree tmpl = CLASSTYPE_TI_TEMPLATE (type);
274 template_class_depth (tree type)
306 inline_needs_template_parms (tree decl)
321 push_inline_template_parms_recursive (tree parmlist, int levels)
323 tree parms = TREE_VALUE (parmlist);
339 tree parm = TREE_VALUE (TREE_VEC_ELT (parms, i));
359 tree decl = build_decl (CONST_DECL, DECL_NAME (parm),
381 maybe_begin_member_template_processing (tree decl)
383 tree parms;
428 static tree
429 add_to_template_args (tree args, tree extra_args)
431 tree new_args;
455 static tree
456 add_outermost_template_args (tree args, tree extra_args)
458 tree new_args;
482 tree
483 get_innermost_template_args (tree args, int n)
485 tree new_args;
544 tree scope = current_scope ();
641 check_specialization_namespace (tree tmpl)
643 tree tpl_ns = decl_namespace_context (tmpl);
669 check_explicit_instantiation_namespace (tree spec)
671 tree ns;
685 tree
686 maybe_process_partial_specialization (tree type)
688 tree context;
751 tree t;
796 optimize_specialization_lookup_p (tree tmpl)
835 static tree
836 retrieve_specialization (tree tmpl, tree args,
851 tree class_template;
852 tree class_specialization;
853 VEC(tree,gc) *methods;
854 tree fns;
874 for (fns = VEC_index (tree, methods, idx); fns; fns = OVL_NEXT (fns))
876 tree fn = OVL_CURRENT (fns);
884 tree *sp;
885 tree *head;
899 tree spec = *sp;
922 static tree
923 retrieve_local_specialization (tree tmpl)
925 tree spec = (tree) htab_find_with_hash (local_specializations, tmpl,
933 is_specialization_of (tree decl, tree tmpl)
935 tree t;
964 is_specialization_of_friend (tree decl, tree friend)
1036 tree context = DECL_CONTEXT (decl);
1037 tree args = NULL_TREE;
1056 tree friend_type;
1057 tree decl_type;
1058 tree friend_args_type;
1059 tree decl_args_type;
1070 tree friend_parms
1107 tree decl_type = TREE_TYPE (decl);
1119 tree friend_parms;
1147 static tree
1148 register_specialization (tree spec, tree tmpl, tree args, bool is_friend)
1150 tree fn;
1191 tree clone;
1269 reregister_specialization (tree spec, tree tmpl, tree new_spec)
1271 tree* s;
1295 return TREE_VALUE ((tree) p1) == (tree) p2;
1303 return htab_hash_pointer (TREE_VALUE ((tree) p1));
1310 register_local_specialization (tree spec, tree tmpl)
1323 explicit_class_specialization_p (tree type)
1333 print_candidates (tree fns)
1335 tree fn;
1341 tree f;
1373 static tree
1374 determine_specialization (tree template_id,
1375 tree decl,
1376 tree* targs_out,
1381 tree fns;
1382 tree targs;
1383 tree explicit_targs;
1384 tree candidates = NULL_TREE;
1390 tree templates = NULL_TREE;
1425 tree fn = OVL_CURRENT (fns);
1429 tree decl_arg_types;
1430 tree fn_arg_types;
1541 tree decl_arg_types;
1610 tree tmpl = most_specialized_instantiation (templates);
1638 tree fn = TREE_VALUE (candidates);
1666 static tree
1667 copy_default_args_to_explicit_spec_1 (tree spec_types,
1668 tree tmpl_types)
1670 tree new_spec_types;
1701 copy_default_args_to_explicit_spec (tree decl)
1703 tree tmpl;
1704 tree spec_types;
1705 tree tmpl_types;
1706 tree new_spec_types;
1707 tree old_type;
1708 tree new_type;
1709 tree t;
1710 tree object_type = NULL_TREE;
1711 tree in_charge = NULL_TREE;
1712 tree vtt = NULL_TREE;
1817 tree
1818 check_explicit_specialization (tree declarator,
1819 tree decl,
1828 tree ctype = DECL_CLASS_CONTEXT (decl);
1829 tree dname = DECL_NAME (decl);
1941 tree t = TYPE_ARG_TYPES (TREE_TYPE (decl));
1953 tree tmpl = NULL_TREE;
1954 tree targs = NULL_TREE;
1959 tree fns;
1981 tree fn = OVL_CURRENT (fns);
2027 tree name = TREE_OPERAND (declarator, 0);
2028 tree fns = NULL_TREE;
2057 fns = VEC_index (tree, CLASSTYPE_METHOD_VEC (ctype), idx);
2061 VEC(tree,gc) *methods;
2062 tree ovl;
2074 VEC_iterate (tree, methods, idx, ovl);
2117 tree gen_tmpl = most_general_template (tmpl);
2135 tree new_targs;
2225 comp_template_parms (tree parms1, tree parms2)
2227 tree p1;
2228 tree p2;
2237 tree t1 = TREE_VALUE (p1);
2238 tree t2 = TREE_VALUE (p2);
2249 tree parm1 = TREE_VALUE (TREE_VEC_ELT (t1, i));
2250 tree parm2 = TREE_VALUE (TREE_VEC_ELT (t2, i));
2281 check_template_shadow (tree decl)
2283 tree olddecl;
2321 static tree
2325 tree decl,
2326 tree type)
2328 tree t = make_node (TEMPLATE_PARM_INDEX);
2346 static tree
2347 reduce_template_parm_level (tree index, tree type, int levels)
2353 tree orig_decl = TEMPLATE_PARM_DECL (index);
2354 tree decl, t;
2382 tree
2383 process_template_parm (tree list, tree parm, bool is_non_type)
2385 tree decl = 0;
2386 tree defval;
2387 tree err_parm_list;
2395 tree p = tree_last (list);
2453 tree t;
2488 tree list into a parameter vector, converting each parameter into a more
2492 tree
2493 end_template_parm_list (tree parms)
2496 tree parm, next;
2497 tree saved_parmlist = make_tree_vec (list_length (parms));
2535 static tree
2538 tree header;
2539 tree args = NULL_TREE;
2551 tree a = copy_node (TREE_VALUE (header));
2557 tree t = TREE_VEC_ELT (a, i);
2592 static tree
2593 build_template_decl (tree decl, tree parms, bool member_template_p)
2595 tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);
2642 mark_template_parm (tree t, void* data)
2666 traversal of the tree; we want to mark *every* template parm. */
2672 static tree
2673 process_partial_specialization (tree decl)
2675 tree type = TREE_TYPE (decl);
2676 tree maintmpl = CLASSTYPE_TI_TEMPLATE (type);
2677 tree specargs = CLASSTYPE_TI_ARGS (type);
2678 tree inner_args = INNERMOST_TEMPLATE_ARGS (specargs);
2679 tree inner_parms = INNERMOST_TEMPLATE_PARMS (current_template_parms);
2680 tree main_inner_parms = DECL_INNERMOST_TEMPLATE_PARMS (maintmpl);
2769 tree arg = TREE_VEC_ELT (inner_args, i);
2785 tree type =
2852 check_default_tmpl_args (tree decl, tree parms, int is_primary, int is_partial)
2856 tree parm_level;
2898 tree inner_parms = TREE_VALUE (parm_level);
2905 tree parm = TREE_VEC_ELT (inner_parms, i);
2968 tree inner_parms = TREE_VALUE (parm_level);
3005 template_parm_this_level_p (tree t, void* data)
3024 tree
3025 push_template_decl_real (tree decl, bool is_friend)
3027 tree tmpl;
3028 tree args;
3029 tree info;
3030 tree ctx;
3175 tree a, t, current, parms;
3204 tree new_tmpl;
3329 tree
3330 push_template_decl (tree decl)
3342 redeclare_class_template (tree type, tree parms)
3344 tree tmpl;
3345 tree tmpl_parms;
3382 tree tmpl_parm;
3383 tree parm;
3384 tree tmpl_default;
3385 tree parm_default;
3435 tree
3436 fold_non_dependent_expr (tree expr)
3476 static tree
3477 fold_decl_constant_value (tree expr)
3479 tree const_expr = expr;
3495 static tree
3496 convert_nontype_argument_function (tree type, tree expr)
3498 tree fns = expr;
3499 tree fn, fn_no_ptr;
3548 static tree
3549 convert_nontype_argument (tree type, tree expr)
3551 tree expr_type;
3580 which is the tree that we built on the first call (see
3593 tree addr = TREE_OPERAND (expr, 0);
3693 tree decl;
3874 coerce_template_template_parms (tree parm_parms,
3875 tree arg_parms,
3877 tree in_decl,
3878 tree outer_args)
3881 tree parm, arg;
3918 tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
3919 tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg);
3956 static tree
3957 convert_template_argument (tree parm,
3958 tree arg,
3959 tree args,
3962 tree in_decl)
3964 tree val;
4053 tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
4054 tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg);
4095 tree t = tsubst (TREE_TYPE (parm), args, complain, in_decl);
4136 static tree
4137 coerce_template_parms (tree parms,
4138 tree args,
4139 tree in_decl,
4145 tree inner_args;
4146 tree new_args;
4147 tree new_inner_args;
4181 tree arg;
4182 tree parm;
4229 template_args_equal (tree ot, tree nt)
4249 comp_template_args (tree oldargs, tree newargs)
4258 tree nt = TREE_VEC_ELT (newargs, i);
4259 tree ot = TREE_VEC_ELT (oldargs, i);
4271 mangle_class_name_for_template (const char* name, tree parms, tree arglist)
4293 tree parm;
4294 tree arg;
4316 tree context = DECL_CONTEXT (arg);
4357 static tree
4358 classtype_mangled_name (tree t)
4365 tree tmpl = most_general_template (CLASSTYPE_TI_TEMPLATE (t));
4371 tree name = DECL_NAME (tmpl);
4376 tree id = get_identifier (mangled_name);
4386 add_pending_template (tree d)
4388 tree ti = (TYPE_P (d)
4391 tree pt;
4421 ARGLIST. Valid choices for FNS are given in the cp-tree.def
4424 tree
4425 lookup_template_function (tree fns, tree arglist)
4427 tree type;
4459 tree
4460 maybe_get_template_decl_from_type_decl (tree decl)
4494 tree
4495 lookup_template_class (tree d1,
4496 tree arglist,
4497 tree in_decl,
4498 tree context,
4502 tree template = NULL_TREE, parmlist;
4503 tree t;
4509 tree value = innermost_non_namespace_value (d1);
4526 tree type = TREE_TYPE (d1);
4583 tree parm;
4584 tree arglist2;
4621 tree template_type = TREE_TYPE (template);
4622 tree gen_tmpl;
4623 tree type_decl;
4624 tree found = NULL_TREE;
4670 tree bound_args = make_tree_vec (parm_depth);
4677 tree a = coerce_template_parms (TREE_VALUE (t),
4733 tree ctx;
4858 tree tmpl = CLASSTYPE_TI_TEMPLATE (TREE_VALUE (found));
4948 static tree
4949 for_each_template_parm_r (tree *tp, int *walk_subtrees, void *d)
4951 tree t = *tp;
4996 tree parm;
5125 for_each_template_parm (tree t, tree_fn_t fn, void* data,
5135 /* Walk the tree. (Conceptually, we would like to walk without
5162 uses_template_parms (tree t)
5202 uses_template_parms_level (tree t, int level)
5219 push_tinst_level (tree d)
5221 tree new;
5264 tree old = current_tinst_level;
5280 reopen_tinst_level (tree level)
5282 tree t;
5295 tree
5306 static tree
5307 tsubst_friend_function (tree decl, tree args)
5309 tree new_friend;
5323 tree template_id, arglist, fns;
5324 tree new_args;
5325 tree tmpl;
5326 tree ns = decl_namespace_context (TYPE_MAIN_DECL (current_class_type));
5384 tree old_decl;
5385 tree new_friend_template_info;
5386 tree new_friend_result_template_info;
5387 tree ns;
5479 tree t;
5480 tree new_friend_args;
5490 tree spec = TREE_VALUE (t);
5518 tree context = DECL_CONTEXT (new_friend);
5542 tree fn = check_classfn (context,
5559 static tree
5560 tsubst_friend_class (tree friend_tmpl, tree args)
5562 tree friend_type;
5563 tree tmpl;
5564 tree context;
5620 tree parms;
5666 can_complete_type_without_circularity (tree type)
5681 tree
5682 instantiate_class_template (tree type)
5684 tree template, args, pattern, t, member;
5685 tree typedecl;
5686 tree pbinfo;
5687 tree base_list;
5792 tree pbase_binfo;
5793 tree context = TYPE_CONTEXT (type);
5794 tree pushed_scope;
5806 tree base;
5807 tree access = BINFO_BASE_ACCESS (pbinfo, i);
5841 tree t = TREE_VALUE (member);
5849 tree newtag;
5871 tree name = TYPE_IDENTIFIER (t);
5900 tree r;
5916 tree r;
5957 tree rtype = TREE_TYPE (r);
5988 tree friend_type = t;
6034 tree ns = decl_namespace_context (TYPE_MAIN_DECL (friend_type));
6075 tree r;
6137 static tree
6138 tsubst_template_arg (tree t, tree args, tsubst_flags_t complain, tree in_decl)
6140 tree r;
6157 static tree
6158 tsubst_template_args (tree t, tree args, tsubst_flags_t complain, tree in_decl)
6162 tree *elts = (tree *) alloca (len * sizeof (tree));
6166 tree orig_arg = TREE_VEC_ELT (t, i);
6167 tree new_arg;
6199 static tree
6200 tsubst_template_parms (tree parms, tree args, tsubst_flags_t complain)
6202 tree r = NULL_TREE;
6203 tree* new_parms;
6216 tree new_vec =
6222 tree tuple;
6223 tree default_value;
6224 tree parm_decl;
6265 static tree
6266 tsubst_aggr_type (tree t,
6267 tree args,
6269 tree in_decl,
6286 tree argvec;
6287 tree context;
6288 tree r;
6338 tree
6339 tsubst_default_argument (tree fn, tree type, tree arg)
6341 tree saved_class_ptr = NULL_TREE;
6342 tree saved_class_ref = NULL_TREE;
6397 tsubst_default_arguments (tree fn)
6399 tree arg;
6400 tree tmpl_args;
6422 static tree
6423 tsubst_decl (tree t, tree args, tsubst_flags_t complain)
6426 tree r = NULL_TREE;
6427 tree in_decl = t;
6440 tree decl = DECL_TEMPLATE_RESULT (t);
6441 tree spec;
6442 tree tmpl_args;
6443 tree full_args;
6448 tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
6508 tree new_type;
6523 tree new_decl;
6561 tree ctx;
6562 tree argvec = NULL_TREE;
6563 tree *friends;
6564 tree gen_tmpl;
6565 tree type;
6575 tree spec;
6796 tree type;
6828 tree type;
6870 tree argvec = NULL_TREE;
6871 tree gen_tmpl = NULL_TREE;
6872 tree spec;
6873 tree tmpl = NULL_TREE;
6874 tree ctx;
6875 tree type = NULL_TREE;
6991 tree ve = DECL_VALUE_EXPR (t);
7057 static tree
7058 tsubst_arg_types (tree arg_types,
7059 tree args,
7061 tree in_decl)
7063 tree remaining_arg_types;
7064 tree type;
7065 tree default_arg;
7066 tree result = NULL_TREE;
7106 VEC_safe_push (tree, gc, DEFARG_INSTANTIATIONS (default_arg), result);
7131 static tree
7132 tsubst_function_type (tree t,
7133 tree args,
7135 tree in_decl)
7137 tree return_type;
7138 tree arg_types;
7139 tree fntype;
7176 tree r = TREE_TYPE (TREE_VALUE (arg_types));
7205 static tree
7206 tsubst_exception_specification (tree fntype,
7207 tree args,
7209 tree in_decl)
7211 tree specs;
7212 tree new_specs;
7223 tree spec;
7234 /* Take the tree structure T and replace template parameters used
7250 static tree
7251 tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
7253 tree type, r;
7311 tree max, omax = TREE_OPERAND (TYPE_MAX_VALUE (t), 0);
7358 tree arg = NULL_TREE;
7405 tree argvec = tsubst (TYPE_TI_ARGS (t),
7466 tree argvec = tsubst (TYPE_TI_ARGS (t), args,
7490 tree purpose, value, chain;
7628 tree method_type;
7629 tree this_type = cp_build_qualified_type (TYPE_MAIN_VARIANT (r),
7631 tree memptr;
7647 tree fntype;
7648 tree specs;
7664 tree domain = tsubst (TYPE_DOMAIN (t), args, complain, in_decl);
7705 tree e1 = tsubst (TREE_OPERAND (t, 0), args, complain, in_decl);
7706 tree e2 = tsubst (TREE_OPERAND (t, 1), args, complain, in_decl);
7717 tree e = tsubst (TREE_OPERAND (t, 0), args, complain, in_decl);
7726 tree ctx = tsubst_aggr_type (TYPE_CONTEXT (t), args, complain,
7728 tree f = tsubst_copy (TYPENAME_TYPE_FULLNAME (t), args,
7785 tree ctx = tsubst_aggr_type (TYPE_CONTEXT (t), args, complain,
7787 tree name = TYPE_IDENTIFIER (t);
7788 tree parm_list = DECL_TEMPLATE_PARMS (TYPE_NAME (t));
7805 tree e1 = tsubst (TREE_OPERAND (t, 0), args, complain, in_decl);
7806 tree e2 = tsubst_expr (TREE_OPERAND (t, 1), args, complain, in_decl,
7816 tree e1 = tsubst (TREE_OPERAND (t, 0), args, complain, in_decl);
7817 tree e2 = tsubst (TREE_OPERAND (t, 1), args, complain, in_decl);
7827 tree type;
7855 static tree
7856 tsubst_baselink (tree baselink, tree object_type,
7857 tree args, tsubst_flags_t complain, tree in_decl)
7859 tree name;
7860 tree qualifying_scope;
7861 tree fns;
7862 tree optype;
7863 tree template_args = 0;
7921 static tree
7922 tsubst_qualified_id (tree qualified_id, tree args,
7923 tsubst_flags_t complain, tree in_decl,
7926 tree expr;
7927 tree scope;
7928 tree name;
7930 tree template_args;
8037 static tree
8038 tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
8041 tree r;
8058 tree enum_type;
8059 tree v;
8101 tree ctx;
8107 tree r = lookup_field (ctx, DECL_NAME (t), 0, false);
8155 tree context = tsubst (DECL_CONTEXT (t), args, complain, in_decl);
8191 tree object;
8192 tree name;
8205 tree base = tsubst_copy (TREE_OPERAND (name, 0), args,
8323 tree fn = TREE_OPERAND (t, 0);
8324 tree targs = TREE_OPERAND (t, 1);
8335 tree purpose, value, chain;
8379 tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
8411 static tree
8412 tsubst_omp_clauses (tree clauses, tree args, tsubst_flags_t complain,
8413 tree in_decl)
8415 tree new_clauses = NULL, nc, oc;
8453 static tree
8454 tsubst_copy_asm_operands (tree t, tree args, tsubst_flags_t complain,
8455 tree in_decl)
8459 tree purpose, value, chain;
8488 static tree
8489 tsubst_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl,
8496 tree stmt, tmp;
8539 tree decl;
8540 tree init;
8547 tree scope = USING_DECL_SCOPE (decl);
8548 tree name = DECL_NAME (decl);
8549 tree decl;
8715 tree asm_expr = tmp;
8732 tree compound_stmt = NULL_TREE;
8756 tree decl = HANDLER_PARMS (t);
8789 tree clauses, decl, init, cond, incr, body, pre_body;
8847 tree op0, op1;
8869 static tree
8870 tsubst_non_call_postfix_expression (tree t, tree args,
8872 tree in_decl)
8888 tree
8889 tsubst_copy_and_build (tree t,
8890 tree args,
8892 tree in_decl,
8901 tree op1;
8913 tree decl;
8920 tree new_type = tsubst (TREE_TYPE (t), args, complain, in_decl);
8951 tree object;
8952 tree template = RECUR (TREE_OPERAND (t, 0));
8953 tree targs = TREE_OPERAND (t, 1);
8976 tree r = RECUR (TREE_OPERAND (t, 0));
9002 tree type;
9003 tree op;
9147 tree r = build_x_modify_expr
9191 tree function;
9192 tree call_args;
9211 tree op = TREE_OPERAND (function, 1);
9288 tree purpose, value, chain;
9311 tree object;
9312 tree object_type;
9313 tree member;
9347 tree tmpl;
9348 tree args;
9403 tree type = tsubst (TREE_TYPE (t), args, complain, in_decl);
9434 tree operand_0 = RECUR (TREE_OPERAND (t, 0));
9447 tree r = tsubst_copy (t, args, complain, in_decl);
9466 tree old_stmt_expr = cur_stmt_expr;
9467 tree stmt_expr = begin_stmt_expr ();
9492 tree subst
9510 check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
9517 tree t = TREE_VEC_ELT (args, ix);
9526 tree nt = no_linkage_check (t, /*relaxed_p=*/false);
9570 tree
9571 instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
9573 tree fndecl;
9574 tree gen_tmpl;
9575 tree spec;
9586 tree spec;
9587 tree clone;
9703 fn_type_unification (tree fn,
9704 tree explicit_targs,
9705 tree targs,
9706 tree args,
9707 tree return_type,
9711 tree parms;
9712 tree fntype;
9738 tree converted_args;
9814 tree* parm,
9815 tree* arg)
9829 tree* temp = parm;
9897 type_unification_real (tree tparms,
9898 tree targs,
9899 tree xparms,
9900 tree xargs,
9905 tree parm, arg;
9910 tree parms, args;
9961 tree type;
10025 tree tparm;
10054 resolve_overloaded_unification (tree tparms,
10055 tree targs,
10056 tree parm,
10057 tree arg,
10061 tree tempargs = copy_node (targs);
10091 tree expl_subargs = TREE_OPERAND (arg, 1);
10096 tree fn = OVL_CURRENT (arg);
10097 tree subargs, elem;
10154 try_one_overload (tree tparms,
10155 tree orig_targs,
10156 tree targs,
10157 tree parm,
10158 tree arg,
10164 tree tempargs;
10198 tree elt = TREE_VEC_ELT (tempargs, i);
10199 tree oldelt = TREE_VEC_ELT (orig_targs, i);
10214 tree elt = TREE_VEC_ELT (tempargs, i);
10228 static tree
10229 try_class_unification (tree tparms, tree targs, tree parm, tree arg)
10231 tree copy_of_targs;
10285 static tree
10286 get_template_base (tree tparms, tree targs, tree parm, tree arg)
10288 tree rval = NULL_TREE;
10289 tree binfo;
10302 tree r = try_class_unification (tparms, targs, parm, BINFO_TYPE (binfo));
10327 template_decl_level (tree decl)
10349 check_cv_quals_for_unify (int strict, tree arg, tree parm)
10427 unify (tree tparms, tree targs, tree parm, tree arg, int strict)
10430 tree targ;
10431 tree tparm;
10522 tree parmvec = TYPE_TI_ARGS (parm);
10523 tree argvec = INNERMOST_TEMPLATE_ARGS (TYPE_TI_ARGS (arg));
10524 tree argtmplvec
10739 tree parm_max;
10740 tree arg_max;
10860 tree t = NULL_TREE;
10930 tree method_type;
10931 tree fntype;
11012 mark_definable (tree decl)
11014 tree clone;
11024 mark_decl_instantiated (tree result, int extern_p)
11090 more_specialized_fn (tree pat1, tree pat2, int len)
11092 tree decl1 = DECL_TEMPLATE_RESULT (pat1);
11093 tree decl2 = DECL_TEMPLATE_RESULT (pat2);
11094 tree targs1 = make_tree_vec (DECL_NTPARMS (pat1));
11095 tree targs2 = make_tree_vec (DECL_NTPARMS (pat2));
11096 tree tparms1 = DECL_INNERMOST_TEMPLATE_PARMS (pat1);
11097 tree tparms2 = DECL_INNERMOST_TEMPLATE_PARMS (pat2);
11098 tree args1 = TYPE_ARG_TYPES (TREE_TYPE (decl1));
11099 tree args2 = TYPE_ARG_TYPES (TREE_TYPE (decl2));
11142 tree arg1 = TREE_VALUE (args1);
11143 tree arg2 = TREE_VALUE (args2);
11253 more_specialized_class (tree pat1, tree pat2)
11255 tree targs;
11256 tree tmpl1, tmpl2;
11289 static tree
11290 get_bindings (tree fn, tree decl, tree explicit_args, bool check_rettype)
11293 tree targs = make_tree_vec (ntparms);
11294 tree decl_type;
11295 tree decl_arg_types;
11303 tree tmpl;
11304 tree converted_args;
11355 static tree
11356 get_class_bindings (tree tparms, tree spec_args, tree args)
11359 tree deduced_args;
11360 tree innermost_deduced_args;
11417 tree
11418 most_specialized_instantiation (tree templates)
11420 tree fn, champ;
11491 tree
11492 most_general_template (tree decl)
11513 (See cp-tree.h for details.) */
11545 static tree
11546 most_specialized_class (tree type, tree tmpl)
11548 tree list = NULL_TREE;
11549 tree t;
11550 tree champ;
11553 tree args;
11559 tree partial_spec_args;
11560 tree spec_args;
11629 do_decl_instantiation (tree decl, tree storage)
11631 tree result = NULL_TREE;
11735 mark_class_instantiated (tree t, int extern_p)
11753 tree storage = *(tree *) data;
11764 instantiate_class_member (tree decl, int extern_p)
11778 do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
11866 tree tmp;
11922 regenerate_decl_from_template (tree decl, tree tmpl)
11926 tree args;
11927 tree code_pattern;
11938 tree decl_parm;
11939 tree pattern_parm;
11940 tree specs;
11963 tree parm_type;
11964 tree attributes;
12004 tree
12005 template_for_substitution (tree decl)
12007 tree tmpl = DECL_TI_TEMPLATE (decl);
12066 tree
12067 instantiate_decl (tree d, int defer_ok,
12070 tree tmpl = DECL_TI_TEMPLATE (d);
12071 tree gen_args;
12072 tree args;
12073 tree td;
12074 tree code_pattern;
12075 tree spec;
12076 tree gen_tmpl;
12180 tree gen = DECL_TEMPLATE_RESULT (gen_tmpl);
12181 tree type = TREE_TYPE (gen);
12237 tree ns;
12238 tree init;
12313 tree init;
12340 tree subst_decl;
12341 tree tmpl_parm;
12342 tree spec_parm;
12413 tree *t;
12414 tree last = NULL_TREE;
12424 tree decl = TREE_VALUE (pending_templates);
12443 tree instantiation = TREE_VALUE (*t);
12449 tree fn;
12516 static tree
12517 tsubst_initializer_list (tree t, tree argvec)
12519 tree inits = NULL_TREE;
12523 tree decl;
12524 tree init;
12550 set_current_access_from_decl (tree decl)
12565 tsubst_enum (tree tag, tree newtag, tree args)
12567 tree e;
12571 tree value;
12572 tree decl;
12598 tree
12599 get_mostly_instantiated_function_type (tree decl)
12601 tree fn_type;
12602 tree tmpl;
12603 tree targs;
12604 tree tparms;
12624 tree partial_args;
12675 tree
12686 invalid_nontype_parm_type_p (tree type, tsubst_flags_t complain)
12708 dependent_type_p_r (tree type)
12710 tree scope;
12741 tree arg_type;
12808 dependent_type_p (tree type)
12844 dependent_scope_ref_p (tree expression, bool criterion (tree))
12846 tree scope;
12847 tree name;
12880 value_dependent_expression_p (tree expression)
12923 tree type = TREE_TYPE (expression);
13017 type_dependent_expression_p (tree expression)
13054 /* For NEW_EXPR tree nodes created inside a template, either
13057 tree type = TREE_OPERAND (expression, 1);
13132 any_type_dependent_arguments_p (tree args)
13136 tree arg = TREE_VALUE (args);
13149 any_value_dependent_elements_p (tree list)
13161 dependent_template_arg_p (tree arg)
13180 any_dependent_template_arguments_p (tree args)
13192 tree level = TMPL_ARGS_LEVEL (args, i + 1);
13204 dependent_template_p (tree tmpl)
13234 dependent_template_id_p (tree tmpl, tree args)
13247 tree
13248 resolve_typename_type (tree type, bool only_current_p)
13250 tree scope;
13251 tree name;
13252 tree decl;
13254 tree pushed_scope;
13298 tree tmpl;
13299 tree args;
13323 tree
13324 build_non_dependent_expr (tree expr)
13326 tree inner_expr;
13401 tree
13402 build_non_dependent_args (tree args)
13404 tree a;
13405 tree new_args;