fix clang-12 -Wdeprecated-copy
Summary:
Starting with C++11, implicit generation of the copy constructor is declared as deprecated.
> § D.2 Implicit declaration of copy functions [depr.impldec]
> The implicit definition of a copy constructor as defaulted is deprecated if the class has a user-declared copy assignment operator or a user-declared destructor. The implicit definition of a copy assignment operator as defaulted is deprecated if the class has a user-declared copy constructor or a user-declared destructor (15.4, 15.8). In a future revision of this International Standard, these implicit definitions could become deleted (11.4).
Clang-12 produces diagnostics for these cases, which is turned into errors for folly:
```
folly/test/AtomicHashMapTest.cpp:330:12: error: definition of implicit copy constructor for 'Integer' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
Integer& operator=(const Integer& a) {
^
```
Reviewed By: yfeldblum
Differential Revision: D28239770
fbshipit-source-id: a28d19ec774264944b750aa267e93d4fa6d1744e
Showing
Please register or sign in to comment