r179035 - <rdar://problem/13540921> Cope with deduced 'auto' in a C++11 for-range loop that is actually an Objective-C fast enumeration loop.

Douglas Gregor dgregor at apple.com
Mon Apr 8 14:20:53 PDT 2013


On Apr 8, 2013, at 2:19 PM, John McCall <rjmccall at apple.com> wrote:

> On Apr 8, 2013, at 12:42 PM, Erik Verbruggen <erik.verbruggen at me.com> wrote:
>> Pardon my ignorance, but why a warning? Or to rephrase it: why could this be problematic at all to fail with -Werror?
> 
> There's no good reason to use "auto" in a situation where it will always infer as "id".  People should either explicitly provide a more specific type, in which case uses of the value will actually be meaningfully type-checked, or they should type "id", which is shorter.


… and it's not an error because this could legitimately happen during template instantiation, where we suppress the warning.

	- Doug

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130408/be57ebe8/attachment.html>


More information about the cfe-commits mailing list