[cfe-commits] r157025 - in /cfe/trunk: lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclObjC.cpp test/SemaObjC/related-result-type-inference.m

Erik Verbruggen erikjv at me.com
Fri Jun 1 03:59:59 PDT 2012


On May 26, 2012, at 5:01, Douglas Gregor wrote:

> 
> On May 24, 2012, at 3:17 AM, Erik Verbruggen <erikjv at me.com> wrote:
> 
>> Quite errr... surprising. I only understood the testcase after reading it like 3 times. I think we should add a warning for this (possibly off by default), because I can see a lot of people falling into this trap.
> 
> I'd be happy to add a warning, if only I could figure out why anyone would ever want to do this. 

Want? Probably never. Then again, if it is allowed, then it might happen. But I was more thinking of the case where somebody "accidentally" changes the signature this way, i.e. when they are new to ObjC. I could very well imagine that people coming from C/C++/Java/C#/etc. add/fix some code in this way, and use the compiler to tell them "thou shan't do this".

-- Erik.



More information about the cfe-commits mailing list