Commit a14e5163 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/47022 (ICE: in tsubst_copy, at cp/pt.c:11682)

	PR c++/47022
	* pt.c (tsubst_copy_and_build): Use tsubst instead of tsubst_copy
	for the second build_x_va_arg argument.

	* g++.dg/template/stdarg1.C: New test.

From-SVN: r168564
parent 4f0d010e
2011-01-07 Jakub Jelinek <jakub@redhat.com>
PR c++/47022
* pt.c (tsubst_copy_and_build): Use tsubst instead of tsubst_copy
for the second build_x_va_arg argument.
2011-01-05 Tom Tromey <tromey@redhat.com>
* typeck.c (cp_build_addr_expr_1): Update call to lvalue_error.
......
......@@ -13239,8 +13239,7 @@ tsubst_copy_and_build (tree t,
case VA_ARG_EXPR:
return build_x_va_arg (RECUR (TREE_OPERAND (t, 0)),
tsubst_copy (TREE_TYPE (t), args, complain,
in_decl));
tsubst (TREE_TYPE (t), args, complain, in_decl));
case OFFSETOF_EXPR:
return finish_offsetof (RECUR (TREE_OPERAND (t, 0)));
......
2011-01-07 Jakub Jelinek <jakub@redhat.com>
PR c++/47022
* g++.dg/template/stdarg1.C: New test.
2011-01-06 Daniel Franke <franke.daniel@gmail.com>
PR fortran/47195
......
// PR c++/47022
// { dg-do compile }
#include <cstdarg>
template <typename T>
void
f1 (T *p, va_list ap)
{
*p = va_arg (ap, long double);
*p += va_arg (ap, double);
}
template <typename T>
void
f2 (T *p, va_list ap)
{
*p = __real__ va_arg (ap, _Complex int);
*p += __imag__ va_arg (ap, _Complex double);
*p += __imag__ va_arg (ap, _Complex long double);
}
template <typename T>
void
f3 (T *p, va_list ap)
{
*p = va_arg (ap, T);
}
void
foo (int x, va_list ap)
{
if (x == 0)
{
long double ld;
f1 (&ld, ap);
}
else if (x == 1)
{
int i;
f2 (&i, ap);
}
else if (x == 2)
{
long double ld;
f3 (&ld, ap);
}
else if (x == 3)
{
_Complex double cd;
f3 (&cd, ap);
}
}
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