Closed cpu82 closed 7 years ago
You're right that this seems to have been an intentional compiler change. I think the relevant commit is actually llvm-mirror/libcxx@e577a4c6 which removes operator< from nullptr_t. Seems like this was changed intentionally in the standard, at the same time as the broader comparison change you referenced. My digging found DR 583 which was resolved along with issue 1512 which was resolved by this wording in the standard. At the end, nullptr_t is being specifically redefined to have fewer built-in operators.
That's a bit inconvenient since it breaks the nice symmetry of the use of nullptr_t in JsonValue, but it doesn't affect anything public so it shouldn't be impossible to hack around. I haven't thought about it in detail, but you could likely do it by defining NullValue without using the Value
@cpu82 do you want to take a stab at this an send a PR, or are you looking for someone else to do it?
I like the helper struct idea. It doesn't need to be castable to nullptr_t, just comparable with itself.
It builds fine after replace nullptr_t with the new empty struct.
@j4cbo thanks for the patch.
json11 fails to build with clang 4.0 likely due to llvm-mirror/clang@4b6ad14
Also reported here: https://github.com/PowerDNS/pdns/issues/4913