[libcxx-commits] [PATCH] D144775: [libc++][test] Add '-Wdeprecated-copy', '-Wdeprecated-copy-dtor' warnings to the test suite

Igor Zhukov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Feb 26 06:05:39 PST 2023


fsb4000 added inline comments.


================
Comment at: libcxx/test/support/counting_predicates.h:24
+    unary_counting_predicate(const unary_counting_predicate&) = default;
+    unary_counting_predicate& operator=(const unary_counting_predicate&) = default;
     ~unary_counting_predicate() {}
----------------
fsb4000 wrote:
> Mordante wrote:
> > Are they used? Copying the `count_` seems wrong.
> > 
> > The same for copies of other stateful parts in the tests.
> I saw the warnings but I will invistigate that.
Yes, they called.
```
C:/Dev/STL/llvm-project/libcxx/test/support\counting_predicates.h:25:5: error: definition of implicit copy constructor for 'unary_counting_predicate<bool (*)(int), int>' is deprecated because it has a user-provided destructor [-Werror,-Wdeprecated-copy-with-user-provided-dtor]
    ~unary_counting_predicate() {}
    ^
C:\Dev\STL\llvm-project\libcxx\test\std\utilities\function.objects\refwrap\refwrap.helpers\ref_2.pass.cpp:60:22: note: in implicit copy constructor for 'unary_counting_predicate<bool (*)(int), int>' first required here
    assert(call_pred(cp));
                     ^
```

https://github.com/llvm/llvm-project/blob/bbaa79470423e63d075abef869ab4d5a203c51d3/libcxx/test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp#L25

https://github.com/llvm/llvm-project/blob/bbaa79470423e63d075abef869ab4d5a203c51d3/libcxx/test/std/utilities/function.objects/refwrap/refwrap.helpers/ref_2.pass.cpp#L60


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

https://reviews.llvm.org/D144775



More information about the libcxx-commits mailing list