* pt.c (finish_template_variable): Use most_general_template.
From-SVN: r243897
2016-12-22 Jason Merrill <jason@redhat.com>
+ PR c++/78906
+ * pt.c (finish_template_variable): Use most_general_template.
+
PR c++/78898
PR c++/42329
* pt.c (unify): Don't look for a class template from a non-class.
tree tmpl_args = DECL_TI_ARGS (DECL_TEMPLATE_RESULT (templ));
arglist = add_outermost_template_args (tmpl_args, arglist);
+ templ = most_general_template (templ);
tree parms = DECL_TEMPLATE_PARMS (templ);
arglist = coerce_innermost_template_parms (parms, arglist, templ, complain,
/*req_all*/true,
--- /dev/null
+// PR c++/78906
+// { dg-do compile { target c++14 } }
+
+template <typename> struct A { static constexpr int digits = 0; };
+template <typename> struct B {
+ template <int, typename MaskInt = int, int = A<MaskInt>::digits>
+ static constexpr int XBitMask = 0;
+};
+struct C {
+ using ReferenceHost = B<int>;
+ template <int> static decltype(ReferenceHost::XBitMask<0>) XBitMask;
+};
+int main() { C::XBitMask<0>; }