Re: [PATCH] c++: const_cast of null pointer in constant expr [PR99176]

2021-02-24 Thread Jason Merrill via Gcc-patches
On 2/24/21 5:34 PM, Marek Polacek wrote: Here we reject constexpr const int *p = nullptr; constexpr int *q = const_cast(p); with "conversion of 'const int*' null pointer to 'int*' is not a constant expression", which seems bogus. This code has been rejected since r238909 which added the

[PATCH] c++: const_cast of null pointer in constant expr [PR99176]

2021-02-24 Thread Marek Polacek via Gcc-patches
Here we reject constexpr const int *p = nullptr; constexpr int *q = const_cast(p); with "conversion of 'const int*' null pointer to 'int*' is not a constant expression", which seems bogus. This code has been rejected since r238909 which added the can_convert check when converting a null poin