Patch for objc/25965 (Allows duplicate member names in objc subclasses)

Nicola Pero nicola.pero@meta-innovation.com
Sun Sep 19 08:51:00 GMT 2010


In attach a patch that fixes objc/25965. :-)

The apple/trunk branch on the FSF server did have a fix for it; I merged their testcases, but I implemented a different fix, inspired by theirs, but much simpler and easier to maintain. :-)

It passes all testcases, including the new naming-4.m, naming-5.m, naming-1.mm and naming-2.mm that would otherwise fail.

Ok to apply ?

Thanks

PS: I didn't like how they had replaced the entire code checking for duplicated struct members with an ObjC specific version.  And while copying, they had made a number of changes meaning we'd now have two different copies to maintain any time anyone wanted to make a change.  I just didn't want ObjC-specific/modified code dealing with pure C structs.  My fix adds a small hook to the standard C struct stuff and it's easier to understand and maintain.  Fixing the ObjC++ frontend was harder but again I tried to localize the changes.  A small bit of code duplication was hard to avoid there, but much less than Apple had done, and it would be easier to untangle and remove the code duplication in the future since it's very clearly and specifically only used in that point of the code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: application/octet-stream
Size: 10390 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100919/801a0e5e/attachment.obj>


More information about the Gcc-patches mailing list