Page MenuHomePhabricator

Fix several -Wdeprecated-copy warnings
ClosedPublic

Authored by Fabien on Nov 23 2021, 09:53.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABCefefb9f9f10b: Fix several -Wdeprecated-copy warnings
Summary

Starting with C++11, implicit copy constructors and implicit copy assignment are deprecated. So compilers implemented warnings in the case they find a use of such an implicit definition, so the user can implicitely define them instead.

It appears that clang 13 is much more aggressive on this warning regarding the copy assignment operator than previous versions. It will warn if a default constructor is explicitely defined (but not if it's missing for some reason) for uses cases coming from the STL, like std::swap or std::vector::resize() that internally call the operator.

This diff attemps to fix the warnings by explicitely defaulting the copy assignment operator at the warning places. I already submitted several diff to fix such warnings in the past, like D5862 and D6276, hopefully this method will remain valid with the next compiler versions.

Test Plan

With clang 10 and 13, and GCC 11

ninja all check

Check there is no warning.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable