Commit f3417723 by Jason Merrill Committed by Jason Merrill

re PR c++/60182 (g++ segfault within template expansion using "using" aliasing)

	PR c++/60182
	* pt.c (unify): Ignore alias templates when deducing a template
	template parameter.

From-SVN: r208177
parent 1bd3ed56
2014-02-26 Jason Merrill <jason@redhat.com>
PR c++/60182
* pt.c (unify): Ignore alias templates when deducing a template
template parameter.
PR c++/60345
Revert:
DR 1571
......
......@@ -17390,9 +17390,11 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
if (TREE_CODE (arg) != BOUND_TEMPLATE_TEMPLATE_PARM
&& !CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P (arg))
return unify_template_deduction_failure (explain_p, parm, arg);
{
tree parmvec = TYPE_TI_ARGS (parm);
/* An alias template name is never deduced. */
if (TYPE_ALIAS_P (arg))
arg = strip_typedefs (arg);
tree argvec = INNERMOST_TEMPLATE_ARGS (TYPE_TI_ARGS (arg));
tree full_argvec = add_to_template_args (targs, argvec);
tree parm_parms
......
// PR c++/60182
// { dg-require-effective-target c++11 }
class B {};
template <typename> using __allocator_base = B;
template <typename> class F : __allocator_base<int> {};
class C {};
template <typename, typename = F<int> > class G : C {};
template <typename> class D;
class A {
using Container = G<D<char>>;
A();
A(D<char> const &);
Container m_elements;
};
template <template <class, class> class C, class A = F<D<int>>>
void doSomething(C<D<char>, A> &);
A::A(D<char> const &) : A() { doSomething(m_elements); }
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