Re: [PATCH] c++/96765: warn when casting "this" to Derived* in Base ctor/dtor

2022-03-16 Thread Jason Merrill via Gcc-patches
On 3/14/22 02:36, Zhao Wei Liew via Gcc-patches wrote: This patch adds a warning when casting "this" to Derived* in the Base class constructor and destructor. I've added the warning under the -Wextra flag as I can't find a more appropriate flag for it. It's generally best to add a new warning

[PATCH] c++/96765: warn when casting "this" to Derived* in Base ctor/dtor

2022-03-13 Thread Zhao Wei Liew via Gcc-patches
Hi! This patch adds a warning when casting "this" to Derived* in the Base class constructor and destructor. I've added the warning under the -Wextra flag as I can't find a more appropriate flag for it. The patch has been bootstrapped and regression tested on x86_64-pc-linux-gnu. Appreciate revie