[Committed] Fix C++/31165

Andrew_Pinski@PlayStation.Sony.Com Andrew_Pinski@PlayStation.Sony.Com
Thu Mar 15 05:20:00 GMT 2007


Hi,
  The problem here is that after PR 30108, we would create two decls 
representing the same global variable which is incorrect as it causes 
section anchors to define the decl twice.
The issue is that we call copy_node when we only want to unshare the 
expression.

Committed to both the trunk and 4.2 branches as obvious and preapproved by 
Mark in PR 30108 after a bootstrap and test on powerpc64-linux-gnu with no 
regressions.

Thanks,
Andrew Pinski

cp/ChangeLog:

        * call.c  (convert_default_arg): Instead of copying the node, 
unshare it.


testsuite/ChangeLog:

        * g++.dg/other/default7.C: New test.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixpr31165.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070315/fb95d97e/attachment.txt>


More information about the Gcc-patches mailing list