complain, in_decl);
if (argvec == error_mark_node)
r = error_mark_node;
- else if (cxx_dialect >= cxx17 && dependent_scope_p (context))
+ else if (!entering_scope
+ && cxx_dialect >= cxx17 && dependent_scope_p (context))
{
/* See maybe_dependent_member_ref. */
tree name = TYPE_IDENTIFIER (t);
class_p = true;
inner = TREE_TYPE (inner);
}
- inner = tsubst (inner, args, complain, in_decl);
+ if (class_p)
+ inner = tsubst_aggr_type (inner, args, complain,
+ in_decl, /*entering*/1);
+ else
+ inner = tsubst (inner, args, complain, in_decl);
}
--processing_template_decl;
if (inner == error_mark_node)
--- /dev/null
+// PR c++/96805
+// { dg-do compile { target c++11 } }
+
+template <typename T> class a {
+ template <int N> struct c {
+ template <bool B> using t = int;
+ t<N> m;
+ };
+};