r187174 - Fix GNU ObjC ABI for a message returning a struct.
js at webkeks.org
Fri Jul 26 15:50:45 PDT 2013
Am 27.07.2013 um 00:44 schrieb John McCall:
> I feel like making your runtime's unit tests more portable across compiler versions isn’t really a compelling reason to expose something like this that’s essentially a fix to an existing language feature. We don’t get to remove __has_feature checks ever, so we’ve generally tried to avoid them for improvements like this, because otherwise the logic produces a plausible argument for basically every change to the compiler to get an independent __has_feature check.
It's not only for the tests, this was just an example. It's basically the only way to check if forwarding for stret is safe. Without a way to check it, the whole feature is useless, because then you can never use it, as you have to expect that it crashes because an old Clang version or GCC could be used.
I'm open for other ways than __has_feature to let the code know that the compiler emits calls to objc_msg_lookup_stret, but there has to be one way to reliably check whether the compiler emits calls to objc_msg_lookup_stret. Otherwise, the feature / fix is useless. And I'm really against something like #if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4)), as that will break with every clang build from after the 3.3 release till now.
More information about the cfe-commits