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

John McCall rjmccall at apple.com
Mon Apr 8 14:19:08 PDT 2013


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.

John.



More information about the cfe-commits mailing list