[PATCH] D79714: [Diagnostics] Restore -Wdeprecated warning when user-declared copy assignment operator is defined as deleted (PR45634)

Arthur O'Dwyer via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 4 09:49:18 PDT 2021


Quuxplusone added a comment.

In D79714#2735455 <https://reviews.llvm.org/D79714#2735455>, @Abpostelnicu wrote:

> I'm seeing here something very strange, if the user provided copy assignment operator is provided but is = delete and the copy constructor is default this warning will still trigger. Is this something expected?
> I'm referring at this issue from the mozilla <https://searchfox.org/mozilla-central/source/js/public/RootingAPI.h#650> code-base.

Yes, that implicit default is deprecated.
If you want your copy constructor to be defaulted, even in the presence of deleted SMFs, you should explicitly `=default` it. Here's an example: https://godbolt.org/z/GaGn1638E


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79714/new/

https://reviews.llvm.org/D79714



More information about the cfe-commits mailing list