complain, in_decl);
if (argvec == error_mark_node)
r = error_mark_node;
- else if (!entering_scope
- && cxx_dialect >= cxx17 && dependent_scope_p (context))
+ else if (!entering_scope && (complain & tf_dguide)
+ && dependent_scope_p (context))
{
/* See maybe_dependent_member_ref. */
tree name = TYPE_IDENTIFIER (t);
name = make_conv_op_name (optype);
/* See maybe_dependent_member_ref. */
- if (dependent_scope_p (qualifying_scope))
+ if ((complain & tf_dguide) && dependent_scope_p (qualifying_scope))
{
if (template_id_p)
name = build2 (TEMPLATE_ID_EXPR, unknown_type_node, name,
maybe_dependent_member_ref (tree t, tree args, tsubst_flags_t complain,
tree in_decl)
{
- if (cxx_dialect < cxx17)
+ if (!(complain & tf_dguide))
return NULL_TREE;
tree ctx = context_for_name_lookup (t);
have to substitute this with one having context `D<int>'. */
tree context = tsubst (DECL_CONTEXT (t), args, complain, in_decl);
- if (dependent_scope_p (context))
+ if ((complain & tf_dguide) && dependent_scope_p (context))
{
/* When rewriting a constructor into a deduction guide, a
non-dependent name can become dependent, so memtmpl<args>
if (tmpl == error_mark_node || args == error_mark_node)
return error_mark_node;
+ /* See maybe_dependent_member_ref. */
+ if (complain & tf_dguide)
+ {
+ tree ctx = tsubst_aggr_type (DECL_CONTEXT (tmpl), args, complain,
+ tmpl, true);
+ if (dependent_scope_p (ctx))
+ {
+ tree name = DECL_NAME (tmpl);
+ tree fullname = build_nt (TEMPLATE_ID_EXPR, name,
+ INNERMOST_TEMPLATE_ARGS (args));
+ tree tname = build_typename_type (ctx, name, fullname, typename_type);
+ return TYPE_NAME (tname);
+ }
+ }
+
args =
coerce_innermost_template_parms (DECL_TEMPLATE_PARMS (tmpl),
args, tmpl, complain,
++processing_template_decl;
bool ok = true;
+ complain |= tf_dguide;
+
fn_tmpl
= (TREE_CODE (ctor) == TEMPLATE_DECL ? ctor
: DECL_TI_TEMPLATE (ctor));