Commit bcf77f8a by Jason Merrill Committed by Jason Merrill

PR c++/78906 - ICE with member variable template

	* pt.c (finish_template_variable): Use most_general_template.

From-SVN: r243897
parent 67a5ad7c
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.
......
......@@ -9000,6 +9000,7 @@ finish_template_variable (tree var, tsubst_flags_t complain)
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,
......
// 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>; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment