[PATCH] Fix PR c++/33207: ICE redeclaring namespace as struct

Simon Martin simartin@users.sourceforge.net
Mon Sep 24 21:29:00 GMT 2007


Hi Mark.

>> PS: I've also tried to create the implicit typedef after all the checks
>> have been done on the type declaration. The regression tests were fine,
>> but I'm not sure changing that the order is safe. In particular, the
>> comment for set_identifier_type_value_with_scope states that ID should
>> not be already defined, and I think that changing the order might break
>> this "constraint"...
> 
> I don't fully understand the comment in the code to which you refer, but
> I think the sequence you're suggesting is the right one: work out that
> it's OK to have "struct S" first, and, then, and only then, create the
> implicit "typedef struct S S;" typedef.
Here's a patch that does that.

I've successfully regtested it on i386-apple-darwin8.10.1. Moreover,
I've successfully built Boost HEAD with this patch, as a double check.
Is it OK for mainline?

Best regards,
Simon

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_33207_6
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070924/6b12ddb4/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr33207_6.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070924/6b12ddb4/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_33207_testsuite
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070924/6b12ddb4/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: crash38.C
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070924/6b12ddb4/attachment-0003.ksh>


More information about the Gcc-patches mailing list