[RFA] Patch for PR c++/17395
Dodji Seketeli
dodji@redhat.com
Wed May 6 18:50:00 GMT 2009
Hello,
In the example embedded in the patch g++ gets stuck in an infinite
recursion while tsubst-ing the type of the function template:
template<class T>
void bhar(T a, X<sizeof(a)>);
During tsubst-ing of the argument X<sizeof(a)> we end up tsubst-ing the
PARM_DECL 'a' as part of the sizeof((a) expression. That's in
tusbt_decl, in the PARM_DECL case. At the end of that case, we then
tsubst the next PARM_DECL chained to the a PARM_DECL. And that's
X<sizeof(a)> again ... hence the infinite recursion.
The attached patch breaks that recursion.
It bootstraps and passes regtests on trunk and gcc-4_4-branch. The
patch won't apply to gcc-4_3-branch as that code base is too different
from the newer branches.
OK to commit to trunk and gcc-4_4-branch ?
Thanks.
--
Dodji Seketeli
Red Hat, Inc
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gcc-PR17395.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20090506/f88449b1/attachment.txt>
More information about the Gcc-patches
mailing list