Lines Matching defs:tmpl

107   tree tmpl;
216 static void perform_typedefs_access_check (tree tmpl, tree targs);
223 static bool complex_alias_template_p (const_tree tmpl);
295 tree tmpl = CLASSTYPE_TI_TEMPLATE (type);
296 check_member_template (tmpl);
297 return tmpl;
417 tree tmpl = TI_TEMPLATE (tinfo);
418 if (PRIMARY_TEMPLATE_P (tmpl))
421 if (!DECL_TEMPLATE_SPECIALIZATION (tmpl))
428 tree ctxt = DECL_CONTEXT (tmpl);
814 check_specialization_namespace (tree tmpl)
816 tree tpl_ns = decl_namespace_context (tmpl);
818 /* [tmpl.expl.spec]
825 if (current_scope() != DECL_CONTEXT (tmpl)
828 error ("specialization of %qD must appear at namespace scope", tmpl);
839 "specialization of %qD in different namespace", tmpl))
840 inform (DECL_SOURCE_LOCATION (tmpl),
841 " from definition of %q#D", tmpl);
902 tree tmpl = CLASSTYPE_TI_TEMPLATE (type);
918 if (type == TREE_TYPE (tmpl))
920 tree main_constr = get_constraints (tmpl);
927 tree specs = DECL_TEMPLATE_SPECIALIZATIONS (tmpl);
943 SET_TYPE_TEMPLATE_INFO (t, build_template_info (tmpl, args));
951 tree d = create_implicit_typedef (DECL_NAME (tmpl), t);
1067 tree tmpl = CLASSTYPE_TI_TEMPLATE (type);
1070 != decl_namespace_context (tmpl))
1075 inform (DECL_SOURCE_LOCATION (tmpl),
1076 "from definition of %q#D", tmpl);
1084 for (t = DECL_TEMPLATE_INSTANTIATIONS (tmpl);
1098 elt.tmpl = most_general_template (tmpl);
1104 elt.tmpl = tmpl;
1152 optimize_specialization_lookup_p (tree tmpl)
1154 return (DECL_FUNCTION_TEMPLATE_P (tmpl)
1155 && DECL_CLASS_SCOPE_P (tmpl)
1158 && CLASS_TYPE_P (DECL_CONTEXT (tmpl))
1164 && !CLASSTYPE_TEMPLATE_SPECIALIZATION (DECL_CONTEXT (tmpl))
1165 && !DECL_MEMBER_TEMPLATE_P (tmpl)
1166 && !DECL_CONV_FN_P (tmpl)
1177 && !DECL_FRIEND_P (DECL_TEMPLATE_RESULT (tmpl)));
1227 retrieve_specialization (tree tmpl, tree args, hashval_t hash)
1229 if (tmpl == NULL_TREE)
1235 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL
1236 || TREE_CODE (tmpl) == FIELD_DECL);
1241 == (TREE_CODE (tmpl) == TEMPLATE_DECL
1242 ? TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl))
1243 : template_class_depth (DECL_CONTEXT (tmpl))));
1250 if (lambda_fn_in_template_p (tmpl))
1253 if (optimize_specialization_lookup_p (tmpl))
1258 tree class_template = CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (tmpl));
1265 tree fns = get_class_binding (class_specialization, DECL_NAME (tmpl));
1270 if (TI_TEMPLATE (ti) == tmpl
1272 instantiation of tmpl as a member of a different
1273 instantiation of tmpl's class. We don't want those
1286 elt.tmpl = tmpl;
1290 if (DECL_CLASS_TEMPLATE_P (tmpl))
1308 retrieve_local_specialization (tree tmpl)
1313 tree *slot = local_specializations->get (tmpl);
1320 is_specialization_of (tree decl, tree tmpl)
1329 if (t == tmpl)
1340 if (same_type_ignoring_top_level_qualifiers_p (t, TREE_TYPE (tmpl)))
1540 register_specialization (tree spec, tree tmpl, tree args, bool is_friend,
1547 gcc_assert ((TREE_CODE (tmpl) == TEMPLATE_DECL && DECL_P (spec))
1548 || (TREE_CODE (tmpl) == FIELD_DECL
1566 if (optimize_specialization_lookup_p (tmpl))
1569 fn = retrieve_specialization (tmpl, args, 0);
1572 elt.tmpl = tmpl;
1652 check_specialization_namespace (tmpl);
1679 && !check_specialization_namespace (tmpl))
1680 DECL_CONTEXT (spec) = DECL_CONTEXT (tmpl);
1682 if (slot != NULL /* !optimize_specialization_lookup_p (tmpl) */)
1685 gcc_assert (tmpl && args && spec);
1689 && PRIMARY_TEMPLATE_P (tmpl)
1690 && DECL_SAVED_TREE (DECL_TEMPLATE_RESULT (tmpl)) == NULL_TREE)
1691 || variable_template_p (tmpl))
1699 DECL_TEMPLATE_INSTANTIATIONS (tmpl)
1700 = tree_cons (args, spec, DECL_TEMPLATE_INSTANTIATIONS (tmpl));
1716 equal = (e1->tmpl == e2->tmpl
1719 /* tmpl could be a FIELD_DECL for a capture pack. */
1720 && TREE_CODE (e1->tmpl) == TEMPLATE_DECL
1721 && VAR_P (DECL_TEMPLATE_RESULT (e1->tmpl))
1738 hash_tmpl_and_args (tree tmpl, tree args)
1740 hashval_t val = iterative_hash_object (DECL_UID (tmpl), 0);
1750 return hash_tmpl_and_args (e->tmpl, e->args);
1969 elt.tmpl = most_general_template (TI_TEMPLATE (tinfo));
1989 register_local_specialization (tree spec, tree tmpl)
1991 gcc_assert (tmpl != spec);
1992 local_specializations->put (tmpl, spec);
2426 tree tmpl = most_specialized_instantiation (templates);
2427 if (tmpl != error_mark_node)
2429 templates = tmpl;
2544 tree tmpl;
2556 tmpl = DECL_TI_TEMPLATE (decl);
2557 tmpl_types = TYPE_ARG_TYPES (TREE_TYPE (DECL_TEMPLATE_RESULT (tmpl)));
2704 tree tmpl = most_general_template (t);
2705 if (DECL_NAMESPACE_SCOPE_P (tmpl)
2707 CP_DECL_CONTEXT (tmpl), true))
2711 "namespace must use a nested-name-specifier", tmpl);
2717 "specifier", tmpl);
2727 warn_spec_missing_attributes (tree tmpl, tree spec, tree attrlist)
2729 if (DECL_FUNCTION_TEMPLATE_P (tmpl))
2730 tmpl = DECL_TEMPLATE_RESULT (tmpl);
2743 unsigned nattrs = decls_mismatched_attributes (tmpl, spec, attrlist,
2753 inform (DECL_SOURCE_LOCATION (tmpl),
2960 tree tmpl = NULL_TREE;
3084 tmpl = determine_specialization (declarator, decl,
3090 if (!tmpl || tmpl == error_mark_node)
3097 && DECL_HIDDEN_FRIEND_P (tmpl))
3102 "explicit specialization", tmpl))
3103 inform (DECL_SOURCE_LOCATION (tmpl),
3108 check_unqualified_spec_or_inst (tmpl, DECL_SOURCE_LOCATION (decl));
3110 tree gen_tmpl = most_general_template (tmpl);
3118 int parm_depth = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl));
3137 return instantiate_template (tmpl, targs, tf_error);
3143 if (DECL_FUNCTION_TEMPLATE_P (tmpl)
3144 && DECL_STATIC_FUNCTION_P (tmpl)
3153 tree result = DECL_TEMPLATE_RESULT (tmpl);
3154 SET_DECL_TEMPLATE_SPECIALIZATION (tmpl);
3159 DECL_SOURCE_LOCATION (tmpl) = DECL_SOURCE_LOCATION (decl);
3169 return register_specialization (tmpl, gen_tmpl, targs,
3174 DECL_TEMPLATE_INFO (decl) = build_template_info (tmpl, targs);
3181 if (DECL_FUNCTION_TEMPLATE_P (tmpl))
3245 DECL_CONTEXT (decl) = DECL_CONTEXT (tmpl);
3273 || variable_template_p (tmpl)
4821 generic_targs_for (tree tmpl)
4823 if (tmpl == NULL_TREE)
4825 if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl)
4826 || DECL_TEMPLATE_SPECIALIZATION (tmpl))
4831 else if (tree result = DECL_TEMPLATE_RESULT (tmpl))
4834 return template_parms_to_args (DECL_TEMPLATE_PARMS (tmpl));
4895 tree tmpl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (decl), NULL_TREE);
4896 SET_DECL_LANGUAGE (tmpl, DECL_LANGUAGE (decl));
4897 DECL_TEMPLATE_PARMS (tmpl) = parms;
4898 DECL_CONTEXT (tmpl) = DECL_CONTEXT (decl);
4899 DECL_SOURCE_LOCATION (tmpl) = DECL_SOURCE_LOCATION (decl);
4900 DECL_MEMBER_TEMPLATE_P (tmpl) = member_template_p;
4902 return tmpl;
5246 tree tmpl = build_template_decl (decl, current_template_parms,
5248 TREE_TYPE (tmpl) = type;
5249 DECL_TEMPLATE_RESULT (tmpl) = decl;
5250 SET_DECL_TEMPLATE_SPECIALIZATION (tmpl);
5251 DECL_TEMPLATE_INFO (tmpl) = build_template_info (maintmpl, specargs);
5252 DECL_PRIMARY_TEMPLATE (tmpl) = maintmpl;
5260 DECL_CONTEXT (parm) = tmpl;
5271 = tree_cons (specargs, tmpl,
5293 else if (TREE_VALUE (spec) == tmpl)
5659 tree tmpl;
5859 tmpl = DECL_TI_TEMPLATE (decl);
5875 tmpl = TYPE_TI_TEMPLATE (TREE_TYPE (decl));
5879 tmpl = build_template_decl (decl, current_template_parms,
5888 SET_DECL_TEMPLATE_SPECIALIZATION (tmpl);
5889 DECL_TEMPLATE_INFO (tmpl) = DECL_TEMPLATE_INFO (decl);
5906 tmpl = TI_TEMPLATE (tinfo);
5908 if (DECL_FUNCTION_TEMPLATE_P (tmpl)
5911 && DECL_MEMBER_TEMPLATE_P (tmpl))
5930 = build_template_info (tmpl, args);
5933 most_general_template (tmpl),
5941 parms = DECL_TEMPLATE_PARMS (tmpl);
5983 TI_ARGS (get_template_info (DECL_TEMPLATE_RESULT (tmpl)))))
5986 "template %qD", decl, DECL_TEMPLATE_RESULT (tmpl));
5996 DECL_TEMPLATE_RESULT (tmpl) = decl;
5997 TREE_TYPE (tmpl) = TREE_TYPE (decl);
6006 tmpl = pushdecl_namespace_level (tmpl, is_friend);
6007 if (tmpl == error_mark_node)
6013 DECL_ANTICIPATED (tmpl) = 1;
6014 DECL_FRIEND_P (tmpl) = 1;
6020 tree parms = DECL_TEMPLATE_PARMS (tmpl);
6022 DECL_PRIMARY_TEMPLATE (tmpl) = tmpl;
6031 DECL_CONTEXT (parm) = tmpl;
6038 = TEMPLATE_PARMS_CONSTRAINTS (DECL_TEMPLATE_PARMS (tmpl)))
6044 if (complex_alias_template_p (tmpl))
6045 TEMPLATE_DECL_COMPLEX_ALIAS_P (tmpl) = true;
6053 if (DECL_TEMPLATE_INFO (tmpl))
6054 args = add_outermost_template_args (DECL_TI_ARGS (tmpl), args);
6056 info = build_template_info (tmpl, args);
6059 SET_TYPE_TEMPLATE_INFO (TREE_TYPE (tmpl), info);
6077 return DECL_TEMPLATE_RESULT (tmpl);
6099 tree tmpl = build_template_decl (fn, parms, /*member*/true);
6101 DECL_TEMPLATE_INFO (fn) = build_template_info (tmpl, args);
6102 TREE_TYPE (tmpl) = TREE_TYPE (fn);
6103 DECL_TEMPLATE_RESULT (tmpl) = fn;
6104 DECL_ARTIFICIAL (tmpl) = true;
6105 DECL_PRIMARY_TEMPLATE (tmpl) = tmpl;
6106 return tmpl;
6118 tree tmpl;
6128 tmpl = TYPE_TI_TEMPLATE (type);
6129 if (!PRIMARY_TEMPLATE_P (tmpl))
6138 tmpl);
6143 tmpl_parms = DECL_INNERMOST_TEMPLATE_PARMS (tmpl);
6151 inform_n (DECL_SOURCE_LOCATION (tmpl), TREE_VEC_LENGTH (tmpl_parms),
6154 tmpl, TREE_VEC_LENGTH (tmpl_parms));
6236 DECL_CONTEXT (parm) = tmpl;
6243 tree ci = get_constraints (tmpl);
6252 "constraints", tmpl);
6253 inform (DECL_SOURCE_LOCATION (tmpl),
6338 tree tmpl = DECL_TI_TEMPLATE (t);
6339 return variable_template_p (tmpl);
6434 complex_alias_template_p (const_tree tmpl)
6437 if (get_underlying_template (CONST_CAST_TREE (tmpl)) != tmpl)
6441 if (get_constraints (tmpl))
6445 tree pat = DECL_ORIGINAL_TYPE (DECL_TEMPLATE_RESULT (tmpl));
6446 tree parms = DECL_TEMPLATE_PARMS (tmpl);
6491 num_innermost_template_parms (const_tree tmpl)
6493 tree parms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (tmpl));
6502 get_underlying_template (tree tmpl)
6504 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
6505 while (DECL_ALIAS_TEMPLATE_P (tmpl))
6508 tree orig_type = DECL_ORIGINAL_TYPE (DECL_TEMPLATE_RESULT (tmpl));
6518 || (num_innermost_template_parms (tmpl)
6523 if (TYPE_QUALS (TREE_TYPE (underlying)) != TYPE_QUALS (TREE_TYPE (tmpl)))
6526 tree alias_args = INNERMOST_TEMPLATE_ARGS (generic_targs_for (tmpl));
6532 if (!at_least_as_constrained (underlying, tmpl))
6536 tmpl = underlying;
6539 return tmpl;
9564 tree t, tmpl = NULL_TREE;
9568 if (!tmpl)
9569 tmpl = elt;
9570 else if (tmpl != elt)
9573 if (tmpl && t == NULL_TREE)
9574 return tmpl;
9792 elt.tmpl = gen_tmpl;
10090 elt.tmpl = found;
10820 push_tinst_level (tree tmpl, tree args)
10822 return push_tinst_level_loc (tmpl, args, input_location);
10914 tree tmpl;
10930 tmpl = determine_specialization (template_id, new_friend,
10935 return instantiate_template (tmpl, new_args, tf_error);
11104 elt.tmpl = old_decl;
11180 tree tmpl;
11184 tmpl = tsubst (TREE_TYPE (friend_tmpl), args, tf_none, NULL_TREE);
11185 return TREE_TYPE (tmpl);
11197 tmpl = lookup_name_real (DECL_NAME (friend_tmpl), /*prefer_type=*/false,
11201 if (tmpl && DECL_CLASS_TEMPLATE_P (tmpl))
11216 tree cons = get_constraints (tmpl);
11217 redeclare_class_template (TREE_TYPE (tmpl), parms, cons);
11226 tmpl = tsubst (friend_tmpl, args, tf_warning_or_error, NULL_TREE);
11228 if (tmpl != error_mark_node)
11234 DECL_USE_TEMPLATE (tmpl) = 0;
11235 DECL_TEMPLATE_INFO (tmpl) = NULL_TREE;
11236 CLASSTYPE_USE_TEMPLATE (TREE_TYPE (tmpl)) = 0;
11237 CLASSTYPE_TI_ARGS (TREE_TYPE (tmpl))
11238 = INNERMOST_TEMPLATE_ARGS (CLASSTYPE_TI_ARGS (TREE_TYPE (tmpl)));
11241 retrofit_lang_decl (DECL_TEMPLATE_RESULT (tmpl));
11242 DECL_ANTICIPATED (tmpl)
11243 = DECL_ANTICIPATED (DECL_TEMPLATE_RESULT (tmpl)) = true;
11252 set_constraints (tmpl, ci);
11256 tmpl = pushdecl_namespace_level (tmpl, true);
11265 return TREE_TYPE (tmpl);
11553 perform_typedefs_access_check (tree tmpl, tree targs)
11558 if (!tmpl
11559 || (!CLASS_TYPE_P (tmpl)
11560 && TREE_CODE (tmpl) != FUNCTION_DECL))
11563 FOR_EACH_VEC_SAFE_ELT (get_types_needing_access_check (tmpl), i, iter)
13162 get_pattern_parm (tree parm, tree tmpl)
13164 tree pattern = DECL_TEMPLATE_RESULT (tmpl);
13177 patparm = FUNCTION_FIRST_USER_PARM (DECL_TEMPLATE_RESULT (tmpl));
14560 tree tmpl = NULL_TREE;
14621 tmpl = DECL_TI_TEMPLATE (t);
14622 gen_tmpl = most_general_template (tmpl);
14793 DECL_TEMPLATE_INFO (r) = build_template_info (tmpl, argvec);
15232 tree tmpl = most_general_template (DECL_TI_TEMPLATE (decl));
15234 r = instantiate_alias_template (tmpl, gen_args, complain);
15240 tree tmpl = most_general_template (DECL_TI_TEMPLATE (decl));
15242 r = retrieve_specialization (tmpl, gen_args, 0);
15563 tree tmpl = tsubst (TI_TEMPLATE (tinfo), args,
15565 if (tmpl == error_mark_node)
15573 = build_template_info (tmpl, argvec);
19216 tree fn, tmpl;
19219 tmpl = tsubst_template_decl (oldtmpl, args, complain, fntype);
19220 if (tmpl == error_mark_node)
19225 fn = DECL_TEMPLATE_RESULT (tmpl);
19226 finish_member_declaration (tmpl);
19230 tmpl = NULL_TREE;
20253 tree tmpl = TREE_OPERAND (id, 0);
20258 gcc_assert (function_concept_p (tmpl));
20261 ret = build_concept_check (tmpl, args, tf_warning_or_error);
20478 tree tmpl = TREE_OPERAND (TREE_OPERAND (member, 1), 0);
20480 member = lookup_qualified_name (scope, tmpl,
20494 qualified_name_lookup_error (scope, tmpl, member,
20796 check_instantiated_arg (tree tmpl, tree t, tsubst_flags_t complain)
20808 if (check_instantiated_arg (tmpl, TREE_VEC_ELT (vec, i), complain))
20834 tmpl, t);
20865 check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
20867 int ix, len = DECL_NTPARMS (tmpl);
20872 if (check_instantiated_arg (tmpl, TREE_VEC_ELT (args, ix), complain))
20876 error (" trying to instantiate %qD", tmpl);
20884 recheck_decl_substitution (tree d, tree tmpl, tree args)
20886 tree pattern = DECL_TEMPLATE_RESULT (tmpl);
20903 instantiate_template_1 (tree tmpl, tree orig_args, tsubst_flags_t complain)
20911 if (tmpl == error_mark_node)
20914 gcc_assert (TREE_CODE (tmpl) == TEMPLATE_DECL);
20917 if (DECL_CLONED_FUNCTION_P (tmpl))
20924 spec = instantiate_template (DECL_ABSTRACT_ORIGIN (tmpl),
20931 if (DECL_NAME (clone) == DECL_NAME (tmpl))
20942 gen_tmpl = most_general_template (tmpl);
20946 from tmpl, which could be either a partial instantiation or gen_tmpl (in
20949 (DECL_TI_ARGS (DECL_TEMPLATE_RESULT (tmpl)),
20956 gcc_assert (tmpl == gen_tmpl
20957 || ((fndecl = retrieve_specialization (tmpl, orig_args, 0))
21033 DECL_TI_TEMPLATE (fndecl) = tmpl;
21073 instantiate_template (tree tmpl, tree orig_args, tsubst_flags_t complain)
21077 ret = instantiate_template_1 (tmpl, orig_args, complain);
21088 instantiate_alias_template (tree tmpl, tree args, tsubst_flags_t complain)
21090 if (tmpl == error_mark_node || args == error_mark_node)
21094 coerce_innermost_template_parms (DECL_TEMPLATE_PARMS (tmpl),
21095 args, tmpl, complain,
21102 && !constraints_satisfied_p (tmpl, args))
21107 error ("template constraint failure for %qD", tmpl);
21108 diagnose_constraints (input_location, tmpl, args);
21113 if (!push_tinst_level (tmpl, args))
21115 tree r = instantiate_template (tmpl, args, complain);
24443 more_specialized_partial_spec (tree tmpl, tree pat1, tree pat2)
24459 targs = get_partial_spec_bindings (tmpl, tmpl1, specargs2);
24466 targs = get_partial_spec_bindings (tmpl, tmpl2, specargs1);
24563 get_partial_spec_bindings (tree tmpl, tree spec_tmpl, tree args)
24626 spec_args = coerce_template_parms (DECL_INNERMOST_TEMPLATE_PARMS (tmpl),
24628 tmpl, tf_none, false, false);
24808 tree tmpl, args;
24813 tmpl = TI_TEMPLATE (tinfo);
24818 tmpl = TREE_OPERAND (target, 0);
24824 tmpl = TI_TEMPLATE (tinfo);
24830 tree main_tmpl = most_general_template (tmpl);
24862 tree spec_args = get_partial_spec_bindings (tmpl, spec_tmpl, args);
24888 fate = more_specialized_partial_spec (tmpl, champ, t);
24909 fate = more_specialized_partial_spec (tmpl, champ, t);
25120 tree tmpl =
25122 if (tmpl)
25123 error ("explicit instantiation of non-class template %qD", tmpl);
25263 regenerate_decl_from_template (tree decl, tree tmpl, tree args)
25269 code_pattern = DECL_TEMPLATE_RESULT (tmpl);
25284 parms_depth = TMPL_PARMS_DEPTH (DECL_TEMPLATE_PARMS (tmpl));
25391 tree tmpl = DECL_TI_TEMPLATE (decl);
25405 DECL_TEMPLATE_INSTANTIATION (tmpl)
25425 && DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (tmpl)
25426 && !DECL_INITIAL (DECL_TEMPLATE_RESULT (tmpl))))
25435 tmpl = DECL_TI_TEMPLATE (tmpl);
25438 return tmpl;
25649 tree tmpl = DECL_TI_TEMPLATE (d);
25706 gen_tmpl = most_general_template (tmpl);
25709 if (tmpl != gen_tmpl)
25993 tf_warning_or_error, tmpl);
25997 tf_warning_or_error, tmpl,
27620 dependent_template_p (tree tmpl)
27622 if (TREE_CODE (tmpl) == OVERLOAD)
27624 for (lkp_iterator iter (tmpl); iter; ++iter)
27631 if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl)
27632 || TREE_CODE (tmpl) == TEMPLATE_TEMPLATE_PARM)
27635 if (TREE_CODE (tmpl) == SCOPE_REF || identifier_p (tmpl))
27643 dependent_template_id_p (tree tmpl, tree args)
27645 return (dependent_template_p (tmpl)
27818 tree tmpl = TREE_OPERAND (fullname, 0);
27819 if (TREE_CODE (tmpl) == IDENTIFIER_NODE)
27830 tmpl = decl;
27834 result = lookup_template_class (tmpl, args, NULL_TREE, NULL_TREE,
28014 make_template_placeholder (tree tmpl)
28017 CLASS_PLACEHOLDER_TEMPLATE (t) = tmpl;
28042 tree tmpl = DECL_TI_TEMPLATE (con);
28043 tree expr = tmpl;
28045 expr = ovl_make (tmpl);
28251 dguide_name (tree tmpl)
28253 tree type = (TYPE_P (tmpl) ? tmpl : TREE_TYPE (tmpl));
28308 tree tmpl = DECL_TI_TEMPLATE (fn);
28309 if (tree org = DECL_ABSTRACT_ORIGIN (tmpl))
28651 is_spec_or_derived (tree etype, tree tmpl)
28656 tree type = TREE_TYPE (tmpl);
28658 (DECL_TEMPLATE_PARMS (tmpl)));
28670 maybe_aggr_guide (tree tmpl, tree init, vec<tree,va_gc> *args)
28678 tree type = TREE_TYPE (tmpl);
28686 if (is_spec_or_derived (tmpl, TREE_TYPE (val)))
28735 alias_ctad_tweaks (tree tmpl, tree uguides)
28789 tree atype = TREE_TYPE (tmpl);
28791 tree atparms = INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (tmpl));
28793 tree utype = DECL_ORIGINAL_TYPE (DECL_TEMPLATE_RESULT (tmpl));
28901 ctor_deduction_guides_for (tree tmpl, tsubst_flags_t complain)
28903 tree type = TREE_TYPE (tmpl);
28905 if (DECL_CLASS_SCOPE_P (tmpl)
28906 && CLASSTYPE_TEMPLATE_INSTANTIATION (DECL_CONTEXT (tmpl)))
28908 outer_args = CLASSTYPE_TI_ARGS (DECL_CONTEXT (tmpl));
28909 type = TREE_TYPE (most_general_template (tmpl));
28951 deduction_guides_for (tree tmpl, bool &any_dguides_p, tsubst_flags_t complain)
28954 if (DECL_ALIAS_TEMPLATE_P (tmpl))
28956 tree under = DECL_ORIGINAL_TYPE (DECL_TEMPLATE_RESULT (tmpl));
28963 guides = lookup_qualified_name (CP_DECL_CONTEXT (tmpl),
28964 dguide_name (tmpl),
28977 = hash_map_safe_get_or_insert<hm_ggc> (dguide_cache, tmpl))
28990 if (DECL_ALIAS_TEMPLATE_P (tmpl))
28991 cands = alias_ctad_tweaks (tmpl, guides);
28994 cands = ctor_deduction_guides_for (tmpl, complain);
29006 ctad_template_p (tree tmpl)
29016 if (DECL_CLASS_TEMPLATE_P (tmpl)
29017 || DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl))
29019 if (!DECL_ALIAS_TEMPLATE_P (tmpl))
29021 tree orig = DECL_ORIGINAL_TYPE (DECL_TEMPLATE_RESULT (tmpl));
29032 do_class_deduction (tree ptype, tree tmpl, tree init,
29036 if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl))
29042 && CLASS_PLACEHOLDER_TEMPLATE (TREE_TYPE (init)) == tmpl)
29046 tmpl = get_underlying_template (tmpl);
29047 if (!ctad_template_p (tmpl))
29050 error ("non-deducible template %qT used without template arguments", tmpl);
29053 else if (cxx_dialect < cxx2a && DECL_ALIAS_TEMPLATE_P (tmpl))
29061 tree type = TREE_TYPE (tmpl);
29080 if (is_spec_or_derived (TREE_TYPE (elt), tmpl))
29099 tree cands = deduction_guides_for (tmpl, any_dguides_p, complain);
29124 if (tree guide = maybe_aggr_guide (tmpl, init, args))
29227 if (tree tmpl = CLASS_PLACEHOLDER_TEMPLATE (auto_node))
29229 return do_class_deduction (type, tmpl, init, flags, complain);
29482 check_auto_in_tmpl_args (tree tmpl, tree args)
29494 && (identifier_p (tmpl)
29495 || (DECL_P (tmpl)
29496 && (DECL_TYPE_TEMPLATE_P (tmpl)
29497 || DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl)))))