[cfe-dev] [cfe-commits] r100942 - /cfe/trunk/lib/CodeGen/CGObjC.cpp

David Chisnall csdavec at swan.ac.uk
Sat Apr 10 17:48:13 PDT 2010


On 11 Apr 2010, at 01:30, Sean Hunt wrote:

> I'm going to weigh in here. I checked the spec, and it's clear that 
> super is not allowed except as the receiver in a message send. Whether 
> this should be supported as an extension is another question (and not 
> one that I can answer satisfactorily, seeing as I don't use 
> Objective-C), but even if we do support it as an extension, it should at 
> least give a warning in all cases.

I don't think anyone is arguing that we should support the general case of treating super as an expression equivalent to self.  GCC does, but it leads to code that doesn't do what it looks like it ought to do and is an artefact of how Objective-C is implemented in GCC rather than a design decision for the language.  The only question is whether, in the one context where we do want to allow super, we allow it to be in parentheses, as it may be as a result of macro expansion.  

David



More information about the cfe-dev mailing list