Lines Matching defs:tmpl

231 	  tree tmpl = CLASSTYPE_TI_TEMPLATE (type);
232 check_member_template (tmpl);
233 return tmpl;
641 check_specialization_namespace (tree tmpl)
643 tree tpl_ns = decl_namespace_context (tmpl);
645 /* [tmpl.expl.spec]
659 pedwarn ("specialization of %qD in different namespace", tmpl);
660 pedwarn (" from definition of %q+#D", tmpl);
796 optimize_specialization_lookup_p (tree tmpl)
798 return (DECL_FUNCTION_TEMPLATE_P (tmpl)
799 && DECL_CLASS_SCOPE_P (tmpl)
802 && CLASS_TYPE_P (DECL_CONTEXT (tmpl))
808 && !CLASSTYPE_TEMPLATE_SPECIALIZATION (DECL_CONTEXT (tmpl))
809 && !DECL_MEMBER_TEMPLATE_P (tmpl)
810 && !DECL_CONV_FN_P (tmpl)
821 && !DECL_FRIEND_P (DECL_TEMPLATE_RESULT (tmpl)));
836 retrieve_specialization (tree tmpl, tree args,
842 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
847 == TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl)));
849 if (optimize_specialization_lookup_p (tmpl))
860 class_template = CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (tmpl));
868 idx = class_method_index_for_fn (class_specialization, tmpl);
877 if (DECL_TEMPLATE_INFO (fn) && DECL_TI_TEMPLATE (fn) == tmpl)
891 && TREE_CODE (DECL_TEMPLATE_RESULT (tmpl)) == TYPE_DECL)
892 sp = &DECL_TEMPLATE_INSTANTIATIONS (tmpl);
894 sp = &DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
923 retrieve_local_specialization (tree tmpl)
925 tree spec = (tree) htab_find_with_hash (local_specializations, tmpl,
926 htab_hash_pointer (tmpl));
933 is_specialization_of (tree decl, tree tmpl)
942 if (t == tmpl)
953 if (same_type_ignoring_top_level_qualifiers_p (t, TREE_TYPE (tmpl)))
1148 register_specialization (tree spec, tree tmpl, tree args, bool is_friend)
1152 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
1169 fn = retrieve_specialization (tmpl, args,
1254 && !check_specialization_namespace (tmpl))
1255 DECL_CONTEXT (spec) = FROB_CONTEXT (decl_namespace_context (tmpl));
1257 if (!optimize_specialization_lookup_p (tmpl))
1258 DECL_TEMPLATE_SPECIALIZATIONS (tmpl)
1259 = tree_cons (args, spec, DECL_TEMPLATE_SPECIALIZATIONS (tmpl));
1269 reregister_specialization (tree spec, tree tmpl, tree new_spec)
1273 for (s = &DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
1310 register_local_specialization (tree spec, tree tmpl)
1314 slot = htab_find_slot_with_hash (local_specializations, tmpl,
1315 htab_hash_pointer (tmpl), INSERT);
1316 *slot = build_tree_list (spec, tmpl);
1610 tree tmpl = most_specialized_instantiation (templates);
1611 if (tmpl != error_mark_node)
1613 templates = tmpl;
1703 tree tmpl;
1715 tmpl = DECL_TI_TEMPLATE (decl);
1716 tmpl_types = TYPE_ARG_TYPES (TREE_TYPE (DECL_TEMPLATE_RESULT (tmpl)));
1953 tree tmpl = NULL_TREE;
2105 tmpl = determine_specialization (declarator, decl,
2111 if (!tmpl || tmpl == error_mark_node)
2117 tree gen_tmpl = most_general_template (tmpl);
2125 int parm_depth = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl));
2144 return instantiate_template (tmpl, targs, tf_error);
2150 if (DECL_STATIC_FUNCTION_P (tmpl)
2159 SET_DECL_TEMPLATE_SPECIALIZATION (tmpl);
2160 DECL_INITIAL (DECL_TEMPLATE_RESULT (tmpl)) = NULL_TREE;
2163 DECL_SOURCE_LOCATION (tmpl) = DECL_SOURCE_LOCATION (decl);
2164 DECL_SOURCE_LOCATION (DECL_TEMPLATE_RESULT (tmpl))
2168 DECL_ARGUMENTS (DECL_TEMPLATE_RESULT (tmpl))
2171 return tmpl;
2175 DECL_TEMPLATE_INFO (decl) = tree_cons (tmpl, targs, NULL_TREE);
2198 DECL_CONTEXT (decl) = DECL_CONTEXT (tmpl);
2595 tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);
2596 DECL_TEMPLATE_PARMS (tmpl) = parms;
2597 DECL_CONTEXT (tmpl) = DECL_CONTEXT (decl);
2598 DECL_MEMBER_TEMPLATE_P (tmpl) = member_template_p;
2601 DECL_STATIC_FUNCTION_P (tmpl) = DECL_STATIC_FUNCTION_P (decl);
2602 DECL_CONSTRUCTOR_P (tmpl) = DECL_CONSTRUCTOR_P (decl);
2603 DECL_DESTRUCTOR_P (tmpl) = DECL_DESTRUCTOR_P (decl);
2604 DECL_NONCONVERTING_P (tmpl) = DECL_NONCONVERTING_P (decl);
2605 DECL_ASSIGNMENT_OPERATOR_P (tmpl) = DECL_ASSIGNMENT_OPERATOR_P (decl);
2607 SET_OVERLOADED_OPERATOR_CODE (tmpl,
2611 return tmpl;
3027 tree tmpl;
3139 tmpl = DECL_TI_TEMPLATE (decl);
3154 tmpl = TYPE_TI_TEMPLATE (TREE_TYPE (decl));
3158 tmpl = build_template_decl (decl, current_template_parms,
3167 SET_DECL_TEMPLATE_SPECIALIZATION (tmpl);
3168 DECL_TEMPLATE_INFO (tmpl) = DECL_TEMPLATE_INFO (decl);
3184 tmpl = TYPE_TI_TEMPLATE (TREE_TYPE (decl));
3197 tmpl = DECL_TI_TEMPLATE (decl);
3199 if (DECL_FUNCTION_TEMPLATE_P (tmpl)
3202 && DECL_MEMBER_TEMPLATE_P (tmpl))
3221 = tree_cons (tmpl, args, NULL_TREE);
3224 most_general_template (tmpl),
3232 parms = DECL_TEMPLATE_PARMS (tmpl);
3267 DECL_TEMPLATE_RESULT (tmpl) = decl;
3268 TREE_TYPE (tmpl) = TREE_TYPE (decl);
3277 tmpl = pushdecl_namespace_level (tmpl, is_friend);
3278 if (tmpl == error_mark_node)
3284 DECL_ANTICIPATED (tmpl) = 1;
3285 DECL_FRIEND_P (tmpl) = 1;
3291 DECL_PRIMARY_TEMPLATE (tmpl) = tmpl;
3292 if (DECL_CONV_FN_P (tmpl))
3294 int depth = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl));
3299 if (uses_template_parms_level (TREE_TYPE (TREE_TYPE (tmpl)),
3301 DECL_TEMPLATE_CONV_FN_P (tmpl) = 1;
3309 if (DECL_TEMPLATE_INFO (tmpl))
3310 args = add_outermost_template_args (DECL_TI_ARGS (tmpl), args);
3312 info = tree_cons (tmpl, args, NULL_TREE);
3316 SET_TYPE_TEMPLATE_INFO (TREE_TYPE (tmpl), info);
3326 return DECL_TEMPLATE_RESULT (tmpl);
3344 tree tmpl;
3354 tmpl = TYPE_TI_TEMPLATE (type);
3355 if (!PRIMARY_TEMPLATE_P (tmpl))
3364 tmpl);
3369 tmpl_parms = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
3373 error ("previous declaration %q+D", tmpl);
4365 tree tmpl = most_general_template (CLASSTYPE_TI_TEMPLATE (t));
4369 if (PRIMARY_TEMPLATE_P (tmpl))
4371 tree name = DECL_NAME (tmpl);
4374 DECL_INNERMOST_TEMPLATE_PARMS (tmpl),
4858 tree tmpl = CLASSTYPE_TI_TEMPLATE (TREE_VALUE (found));
4882 found = tmpl;
5325 tree tmpl;
5341 tmpl = determine_specialization (template_id, new_friend,
5346 return instantiate_template (tmpl, new_args, tf_error);
5563 tree tmpl;
5588 tmpl = lookup_name_real (DECL_NAME (friend_tmpl), 0, 0,
5603 if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl))
5605 tmpl = lookup_name_prefer_type (DECL_NAME (friend_tmpl), 1);
5606 tmpl = maybe_get_template_decl_from_type_decl (tmpl);
5609 if (tmpl && DECL_CLASS_TEMPLATE_P (tmpl))
5623 redeclare_class_template (TREE_TYPE (tmpl), parms);
5626 friend_type = TREE_TYPE (tmpl);
5633 tmpl = tsubst (friend_tmpl, args, tf_warning_or_error, NULL_TREE);
5634 if (tmpl == error_mark_node)
5641 DECL_USE_TEMPLATE (tmpl) = 0;
5642 DECL_TEMPLATE_INFO (tmpl) = NULL_TREE;
5643 CLASSTYPE_USE_TEMPLATE (TREE_TYPE (tmpl)) = 0;
5644 CLASSTYPE_TI_ARGS (TREE_TYPE (tmpl))
5645 = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (TREE_TYPE (tmpl)));
5648 friend_type = TREE_TYPE (pushdecl_top_level_maybe_friend (tmpl, true));
6873 tree tmpl = NULL_TREE;
6927 tmpl = DECL_TI_TEMPLATE (t);
6928 gen_tmpl = most_general_template (tmpl);
7034 DECL_TEMPLATE_INFO (r) = tree_cons (tmpl, argvec, NULL_TREE);
9347 tree tmpl;
9352 tmpl = TREE_OPERAND (TREE_OPERAND (member, 1), 0);
9354 member = lookup_qualified_name (TREE_OPERAND (member, 0), tmpl,
9368 qualified_name_lookup_error (object_type, tmpl, member);
9510 check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
9512 int ix, len = DECL_NTPARMS (tmpl);
9538 tmpl, t);
9563 error (" trying to instantiate %qD", tmpl);
9571 instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
9578 if (tmpl == error_mark_node)
9581 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
9584 if (DECL_CLONED_FUNCTION_P (tmpl))
9589 spec = instantiate_template (DECL_CLONED_FUNCTION (tmpl), targ_ptr,
9596 if (DECL_NAME (clone) == DECL_NAME (tmpl))
9604 spec = retrieve_specialization (tmpl, targ_ptr,
9609 gen_tmpl = most_general_template (tmpl);
9610 if (tmpl != gen_tmpl)
9615 targ_ptr = add_outermost_template_args (DECL_TI_ARGS (tmpl),
9660 DECL_TI_TEMPLATE (fndecl) = tmpl;
11303 tree tmpl;
11307 tmpl = DECL_TI_TEMPLATE (decl);
11313 = coerce_template_parms (DECL_INNERMOST_TEMPLATE_PARMS (tmpl),
11546 most_specialized_class (tree type, tree tmpl)
11555 tmpl = most_general_template (tmpl);
11557 for (t = DECL_TEMPLATE_SPECIALIZATIONS (tmpl); t; t = TREE_CHAIN (t))
11922 regenerate_decl_from_template (tree decl, tree tmpl)
11930 code_pattern = DECL_TEMPLATE_RESULT (tmpl);
11945 parms_depth = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl));
12007 tree tmpl = DECL_TI_TEMPLATE (decl);
12021 DECL_TEMPLATE_INSTANTIATION (tmpl)
12041 && DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (tmpl)
12042 && !DECL_INITIAL (DECL_TEMPLATE_RESULT (tmpl))))
12050 || DECL_IN_AGGR_P (DECL_TEMPLATE_RESULT (tmpl)));
12053 tmpl = DECL_TI_TEMPLATE (tmpl);
12056 return tmpl;
12070 tree tmpl = DECL_TI_TEMPLATE (d);
12114 gen_tmpl = most_general_template (tmpl);
12377 tf_warning_or_error, tmpl,
12602 tree tmpl;
12607 tmpl = most_general_template (DECL_TI_TEMPLATE (decl));
12609 tparms = DECL_TEMPLATE_PARMS (tmpl);
12616 fn_type = TREE_TYPE (tmpl);
12634 make_tree_vec (DECL_NTPARMS (tmpl)));
13204 dependent_template_p (tree tmpl)
13206 if (TREE_CODE (tmpl) == OVERLOAD)
13208 while (tmpl)
13210 if (dependent_template_p (OVL_FUNCTION (tmpl)))
13212 tmpl = OVL_CHAIN (tmpl);
13218 if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl)
13219 || TREE_CODE (tmpl) == TEMPLATE_TEMPLATE_PARM)
13222 if (TREE_CODE (tmpl) == SCOPE_REF
13223 || TREE_CODE (tmpl) == IDENTIFIER_NODE)
13226 if (TYPE_P (CP_DECL_CONTEXT (tmpl)))
13227 return dependent_type_p (DECL_CONTEXT (tmpl));
13234 dependent_template_id_p (tree tmpl, tree args)
13236 return (dependent_template_p (tmpl)
13298 tree tmpl;
13301 tmpl = TREE_OPERAND (TYPENAME_TYPE_FULLNAME (type), 0);
13304 type = lookup_template_class (tmpl, args, NULL_TREE, NULL_TREE,