[cfe-dev] Missing deprecated-copy-dtor warning in Clang-10
Dávid Bolvanský via cfe-dev
cfe-dev at lists.llvm.org
Thu Jul 23 11:31:57 PDT 2020
Right.
See https://reviews.llvm.org/D79714
I just need some time to rebase and update it. :( this weekend, hopefully.
Odoslané z iPhonu
> Dňa 23. 7. 2020 o 20:18 užívateľ Dimitry Andric <dimitry at andric.com> napísal:
>
> On 23 Jul 2020, at 09:30, Milan Kříž via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> ...
>> Clang versions 5, 6, 7, 8, 9 (and probably earlier) fire the following warning (when using -Wdeprecated):
>> <source>:6:13: warning: definition of implicit copy constructor for 'ITest' is deprecated because it has a user-declared destructor [-Wdeprecated]
>> virtual ~ITest() = default;
>> ^
>> <source>:10:7: note: in implicit copy constructor for 'ITest' first required here
>> class TestImpl : public ITest
>> ^
>> <source>:19:22: note: in implicit move constructor for 'TestImpl' first required here
>> TestImpl impl2 = std::move(impl1);
>>
>> I understand that in standard the definition of implicit copy constructor is really deprecated and even though I don't like it, I believe that the warning is correct. However starting with clang-10.0.0, the warning disappears. I noticed that there is a new sub-option -Wdeprecated-copy-dtor, but it also doesn't help to get the warning. I even tried to add some members to ITest, but the warning doesn't appear anyway. Is it a bug or desired behavior?
>
> See https://github.com/llvm/llvm-project/commit/9e260c12bce77c80aa4da64ac44874687c684580:
>
> commit 9e260c12bce77c80aa4da64ac44874687c684580
> Author: Dávid Bolvanský <david.bolvansky at gmail.com>
> Date: Sat Nov 23 23:57:17 2019 +0100
>
> [Diagnostics] Make behaviour of Clang's -Wdeprecated-copy same as in GCC
>
> Do not warn for functions that are explicitly marked delete or default, which follows the behavior of the GCC warning.
>
> -Dimitry
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200723/08e561ae/attachment-0001.html>
More information about the cfe-dev
mailing list