[Bug c++/47022] [4.6 Regression] ICE: in tsubst_copy, at cp/pt.c:11682

silver24k at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Dec 28 02:45:00 GMT 2010


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47022

--- Comment #2 from Yu Simin <silver24k at gmail dot com> 2010-12-28 02:45:16 UTC ---
I found this code ICEs:
#include <stdarg.h>

template<typename _T>
void foo(_T *p, va_list argptr)
{
  *p = va_arg(argptr, long double); //float/double
}

void bar(va_list ap)
{
  long double argdata = 0;
  foo<long double>(&argdata, ap);
}
Changing long double to double or float also causes the ICE
but this is OK:
#include <stdarg.h>

template<typename _T>
void foo(_T *p, va_list argptr)
{
  *p = va_arg(argptr, _T);
}

void bar(va_list ap)
{
  long double argdata = 0;
  foo<long double>(&argdata, ap);
}



More information about the Gcc-bugs mailing list