Commit 8f413ae2 by Jason Merrill Committed by Jason Merrill

re PR c++/64520 (ICE with std::initializer_list)

	PR c++/64520
	* pt.c (unify): Don't try to deduce to std::initializer_list<T...>.

From-SVN: r219557
parent 2001028a
2015-01-13 Jason Merrill <jason@redhat.com>
PR c++/64520
* pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
2015-01-12 Jason Merrill <jason@redhat.com> 2015-01-12 Jason Merrill <jason@redhat.com>
PR c++/64547 PR c++/64547
......
...@@ -17854,7 +17854,13 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict, ...@@ -17854,7 +17854,13 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict,
if (TREE_CODE (parm) == ARRAY_TYPE) if (TREE_CODE (parm) == ARRAY_TYPE)
elttype = TREE_TYPE (parm); elttype = TREE_TYPE (parm);
else else
elttype = TREE_VEC_ELT (CLASSTYPE_TI_ARGS (parm), 0); {
elttype = TREE_VEC_ELT (CLASSTYPE_TI_ARGS (parm), 0);
/* Deduction is defined in terms of a single type, so just punt
on the (bizarre) std::initializer_list<T...>. */
if (PACK_EXPANSION_P (elttype))
return unify_success (explain_p);
}
FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (arg), i, elt) FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (arg), i, elt)
{ {
......
// PR c++/64520
// { dg-do compile { target c++11 } }
#include <initializer_list>
struct A {
template <typename... B> A(std::initializer_list<B...>);
};
A a { 0 }; // { dg-error "" }
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