I cannot find this anywhere in the release notes, but I notice that _LIBCPP_HAS_MERGED_TYPEINFO_NAMES_DEFAULT has changed from Xcode 12.1 to Xcode 12.2 (in __config header).
It's changed from 0 to 1.
This changes the behaviour of std::type_info. In particular I'll point out std::type_info::operator==(). With Xcode 12.1 behaviour is (with me inlining some things to simplify):
Whereas in Xcode 12.2 it's now:
It's gone from pointer equality of const char* name() of each type, with a fallback to comparing the strings themselves, to *only* doing the pointer equality check.
So what that means is, if the two objects you're comparing are actually the same type, but they come from different modules, then now they might not compare ==.
This breaks a bunch of our tests (fortunately just tests at the moment) because the test bundle has its own set of strings which are then different to the main app.
I am wondering if this change was on purpose? It's mentioned nowhere in the release notes of Xcode 12.2 (that I can find) and it's a huge change which will subtly break a lot of things I believe.
I've raised a feedback for this as well: FB8894026
It's changed from 0 to 1.
This changes the behaviour of std::type_info. In particular I'll point out std::type_info::operator==(). With Xcode 12.1 behaviour is (with me inlining some things to simplify):
Code Block bool operator==(const type_info& other) const { return name() == other.name() || strcmp(name(), other.name()) == 0; }
Whereas in Xcode 12.2 it's now:
Code Block bool operator==(const type_info& other) const { return name() == other.name(); }
It's gone from pointer equality of const char* name() of each type, with a fallback to comparing the strings themselves, to *only* doing the pointer equality check.
So what that means is, if the two objects you're comparing are actually the same type, but they come from different modules, then now they might not compare ==.
This breaks a bunch of our tests (fortunately just tests at the moment) because the test bundle has its own set of strings which are then different to the main app.
I am wondering if this change was on purpose? It's mentioned nowhere in the release notes of Xcode 12.2 (that I can find) and it's a huge change which will subtly break a lot of things I believe.
I've raised a feedback for this as well: FB8894026