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

Chris Lattner clattner at apple.com
Sat Apr 10 16:52:28 PDT 2010


On Apr 10, 2010, at 4:43 PM, David Chisnall wrote:

> On 11 Apr 2010, at 00:35, Chris Lattner wrote:
> 
>> The point is, super is not an expression, it is a magic keyword that affects messages sends.  It cannot be used in any other places that expressions are allowed, so it should not be part of the expression grammar.
> 
> 
> Which is a side issue.  There are three questions here.  First, should we support super in parentheses in message send expressions?  I say we should because:
> 
> - It is supported by GCC.
> - It is used in existing code.
> - It is required for macros that send messages to their arguments.
> 	- You have not proposed any way for people to work around this
> 
> You say no because is counter to your private sense of aesthetics.

I say no because it doesn't fit with the rest of the compiler, our current implementation of super is a ecological disaster and needs to be fixed, and it is obviously not been used enough to be reported yet.  I would argue that cast of super is much more widely used than parenthesized super. 

> Question two.  Should we do so with the existing infrastructure and the one-line change that I just made?  I say yes because:
> 
> - It is a trivial change.
> - It works now.
> - It allows existing code to be compiled with Clang that was previously requiring GCC.
> 
> You say no because is counter to your private sense of aesthetics.

This encourages broken code.  Continuing to reject it forces people to fix their broken code.  This is exactly what we did with cast of super, and the world is better place because of it.

Whether ObjCSuperExpr is removed or not seems completely unrelated to the user visible issue of whether the code is accepted or rejected.

-Chris



More information about the cfe-dev mailing list