Open roe85 opened 4 years ago
This behavior was altered beyond recognition by the fix for #44979, so maybe this can be closed. -Wdeprecated
now says:
<source>:6:5: warning: definition of implicit copy constructor for 'A' is deprecated because it has a user-provided destructor [-Wdeprecated-copy-with-user-provided-dtor]
~A();
^
<source>:14:11: note: in implicit copy constructor for 'A' first required here
A b = a;
^
But this warning is still enabled only by -Wdeprecated
, not by -Wall
or -Wextra
. I think it would be nice to enable it under -Wextra
, at least, since it does usually indicate a bug or at least a time bomb.
@llvm/issue-subscribers-c-1
There seems to be some interference between
-Wdeprecated-copy-dtor
and-Wdeprecated-copy
which leads to emitting only the first one. Demo: https://gcc.godbolt.org/z/_8Dx4K This is bad because only the second is governed by-Wextra
, which is likelier to be activated. The code attached is not warned about whith-Wextra
unless the destructor is commented out. GCC warns in either case. I think there is no reason, why both warnings shouldn't be governed with-Wextra
.