Closed
Conversation
…or. NFC.
/home/travis/build/Quuxplusone/googletest/googlemock/include/gmock/gmock-spec-builders.h:503:3: error:
definition of implicit copy constructor for 'Expectation' is deprecated
because it has a user-declared destructor [-Werror,-Wdeprecated]
~Expectation();
^
/home/travis/build/Quuxplusone/googletest/googlemock/src/gmock-spec-builders.cc:496:14: note:
implicit copy constructor for 'Expectation' first required here
return Expectation(*it);
^
/home/travis/build/Quuxplusone/googletest/googlemock/src/gmock-spec-builders.cc:854:14: error:
definition of implicit copy assignment operator for 'Expectation' is
deprecated because it has a user-declared destructor
[-Werror,-Wdeprecated]
Expectation::~Expectation() {}
^
/home/travis/build/Quuxplusone/googletest/googlemock/src/gmock-spec-builders.cc:863:24: note:
implicit copy assignment operator for 'Expectation' first required here
*last_expectation_ = expectation;
^
/home/travis/build/Quuxplusone/googletest/googletest/test/googletest-port-test.cc:97:11: error:
definition of implicit copy constructor for 'Base' is deprecated because
it has a user-declared destructor [-Werror,-Wdeprecated]
virtual ~Base() {}
^
/home/travis/build/Quuxplusone/googletest/googletest/test/googletest-port-test.cc:116:56: note:
implicit copy constructor for 'Base' first required here
Base base = ::testing::internal::ImplicitCast_<Base>(derived);
^
/home/travis/build/Quuxplusone/googletest/googletest/test/googletest-param-test-test.cc:502:8: error:
definition of implicit copy constructor for
'NonDefaultConstructAssignString' is deprecated because it has a
user-declared copy assignment operator [-Werror,-Wdeprecated]
void operator=(const NonDefaultConstructAssignString&);
^
/home/travis/build/Quuxplusone/googletest/googletest/test/googletest-param-test-test.cc:507:36: note:
implicit copy constructor for 'NonDefaultConstructAssignString' first
required here
Combine(Values(0, 1), Values(NonDefaultConstructAssignString("A"),
^
…assignable. Any class with a data member that's `const` or of reference type has no `operator=` by definition; we don't have to redundantly specify it. Therefore this commit has no functional change. (But the next one will have.)
For the user-facing classes `Test`, `TestSuite`, etc., where there were
explicit C++ comments saying that we delete the special members, I added
the deleted special member declarations by hand.
For `VariadicMatcher`, we actually NEED to cut short the compiler's
deliberations about whether the type is copyable, because if we don't,
it recurses down into the `std::tuple` and triggers Clang's error
"recursive template instantiation exceeded maximum depth of 256".
However, `VariadicMatcher` does need to be copy-constructible, so
we default its copy constructor (to avoid `-Wdeprecated-copy`, see below).
For every other case, where these are internal implementation details
that nobody in their right mind would ever try to do value semantics with,
I just removed the deleted members, following the Rule of Zero.
This commit fixes all Clang trunk's warnings about `-Wdeprecated-copy`,
for example:
/home/travis/build/Quuxplusone/googletest/googlemock/include/gmock/gmock-actions.h:579:3: error:
definition of implicit copy constructor for
'PolymorphicAction<testing::internal::ReturnNullAction>' is deprecated
because it has a user-declared copy assignment operator
[-Werror,-Wdeprecated]
GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
^
/home/travis/build/Quuxplusone/googletest/googletest/include/gtest/internal/gtest-port.h:679:9: note:
expanded from macro 'GTEST_DISALLOW_ASSIGN_'
type& operator=(type const &) = delete
^
/home/travis/build/Quuxplusone/googletest/googlemock/include/gmock/gmock-actions.h:1166:10: note:
implicit copy constructor for
'PolymorphicAction<testing::internal::ReturnNullAction>' first required
here
return MakePolymorphicAction(internal::ReturnNullAction());
^
and:
/home/travis/build/Quuxplusone/googletest/googlemock/test/gmock-spec-builders_test.cc:1883:1: error:
definition of implicit copy constructor for 'DeleteActionP<(anonymous
namespace)::MockA *>' is deprecated because it has a user-declared copy
assignment operator [-Werror,-Wdeprecated]
ACTION_P(Delete, ptr) { delete ptr; }
^
Contributor
Author
|
Oops. I guess I hit "Enter" in the wrong tab. Closing for now. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.