We filed some CD ballot comments which WG14 considered during the ballot comment resolution meetings in Jan and Feb 2023, and this updates our implementation based on the decisions reached. Those decisions were (paraphrased for brevity):
US 9-034 (REJECTED) -- allow (void *)nullptr to be a null pointer constant
US 10-035 (ACCEPTED) -- accept the following code, as in C++: void func(nullptr_t); func(0);
US 22-058 (REJECTED) -- accept the following code, as in C++: nullptr_t val; (void)(1 ? val : 0); (void)(1 ? nullptr : 0);
US 23-062 (REJECTED) -- reject the following code, as in C++: nullptr_t val; bool b1 = val; bool b2 = nullptr;
US 24-061 (ACCEPTED) -- accept the following code, as in C++: nullptr_t val; val = 0;
US 21-068 (ACCEPTED) -- accept the following code, as in C++: (nullptr_t)nullptr;
GB-071 (ACCEPTED) -- accept the following code, as in C++: nullptr_t val; (void)(val == nullptr);
This patch updates the implementation as appropriate, but is primarily focused around US 10-035, US 24-061, and US 23-062 in terms of functional changes.
I'd like to see testcases for: