Commit 502bfcbc by Jason Merrill Committed by Jason Merrill

re PR c++/55724 ([C++11] Default type of a template value is not working)

	PR c++/55724
	* pt.c (type_unification_real): Re-combine post-deduction loops.

From-SVN: r194620
parent a1906e8b
2012-12-19 Jason Merrill <jason@redhat.com>
PR c++/55724
* pt.c (type_unification_real): Re-combine post-deduction loops.
2012-12-14 Jason Merrill <jason@redhat.com>
PR c++/55685
......
......@@ -15333,13 +15333,19 @@ type_unification_real (tree tparms,
? tf_warning_or_error
: tf_none);
/* Check to see if we need another pass before we start clearing
ARGUMENT_PACK_INCOMPLETE_P. */
for (i = 0; i < ntparms; i++)
{
tree targ = TREE_VEC_ELT (targs, i);
tree tparm = TREE_VEC_ELT (tparms, i);
/* Clear the "incomplete" flags on all argument packs now so that
substituting them into later default arguments works. */
if (targ && ARGUMENT_PACK_P (targ))
{
ARGUMENT_PACK_INCOMPLETE_P (targ) = 0;
ARGUMENT_PACK_EXPLICIT_ARGS (targ) = NULL_TREE;
}
if (targ || tparm == error_mark_node)
continue;
tparm = TREE_VALUE (tparm);
......@@ -15352,24 +15358,6 @@ type_unification_real (tree tparms,
&& uses_template_parms (TREE_TYPE (tparm))
&& !saw_undeduced++)
goto again;
}
for (i = 0; i < ntparms; i++)
{
tree targ = TREE_VEC_ELT (targs, i);
tree tparm = TREE_VEC_ELT (tparms, i);
/* Clear the "incomplete" flags on all argument packs now so that
substituting them into later default arguments works. */
if (targ && ARGUMENT_PACK_P (targ))
{
ARGUMENT_PACK_INCOMPLETE_P (targ) = 0;
ARGUMENT_PACK_EXPLICIT_ARGS (targ) = NULL_TREE;
}
if (targ || tparm == error_mark_node)
continue;
tparm = TREE_VALUE (tparm);
/* Core issue #226 (C++0x) [temp.deduct]:
......
// PR c++/55724
// { dg-options -std=c++11 }
template<int N> struct S {};
template<typename T = int, T N> void f(S<N>) {}
int main() { S<1> s; f(s); }
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