Re: [PATCH] avoid -Wnonnull for COND_EXPR in static_cast (PR 98646)

2021-01-21 Thread Jason Merrill via Gcc-patches
On 1/20/21 7:30 PM, Martin Sebor wrote: Similar to pr96003, bug 98646 reports a spurious instance of -Wnonnull calling a member function on the result of static_cast.  The difference here is that the cast argument is a function call, and, besides casting down an inheritance hierarchy, the cast al

[PATCH] avoid -Wnonnull for COND_EXPR in static_cast (PR 98646)

2021-01-20 Thread Martin Sebor via Gcc-patches
Similar to pr96003, bug 98646 reports a spurious instance of -Wnonnull calling a member function on the result of static_cast. The difference here is that the cast argument is a function call, and, besides casting down an inheritance hierarchy, the cast also adds the const qualifier. GCC sets the