Re: [PATCH] c++: suppress -Waddress warnings with *_cast [PR105569]

2022-05-18 Thread Jason Merrill via Gcc-patches
On 5/16/22 13:06, Marek Polacek wrote: dynamic_cast can legally return nullptr, so I don't think it's helpful for -Waddress to warn for if (dynamic_cast(&ref)) // ... More generally, it's likely not useful to warn for the artificial POINTER_PLUS_EXPRs created by build_base_path. Norma

[PATCH] c++: suppress -Waddress warnings with *_cast [PR105569]

2022-05-16 Thread Marek Polacek via Gcc-patches
dynamic_cast can legally return nullptr, so I don't think it's helpful for -Waddress to warn for if (dynamic_cast(&ref)) // ... More generally, it's likely not useful to warn for the artificial POINTER_PLUS_EXPRs created by build_base_path. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok