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

2021-02-25 Thread Jason Merrill via Gcc-patches
On 2/25/21 4:20 PM, Marek Polacek wrote: On Wed, Feb 24, 2021 at 10:32:59PM -0500, Jason Merrill wrote: 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*' i

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

2021-02-25 Thread Marek Polacek via Gcc-patches
On Wed, Feb 24, 2021 at 10:32:59PM -0500, Jason Merrill wrote: > 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