Commit 766ac2e1 authored by Arthur O'Dwyer's avatar Arthur O'Dwyer
Browse files

Remove all uses of GTEST_DISALLOW_{MOVE_,}ASSIGN_.

None of these are strictly needed for correctness.
A large number of them (maybe all of them?) trigger `-Wdeprecated`
warnings on Clang trunk as soon as you try to use the implicitly
defaulted (but deprecated) copy constructor of a class that has
deleted its copy assignment operator.

By declaring a deleted copy assignment operator, the old code
also caused the move constructor and move assignment operator
to be non-declared. This means that the old code never got move
semantics -- "move-construction" would simply call the defaulted
(but deprecated) copy constructor instead. With the new code,
"move-construction" calls the defaulted move constructor, which
I believe is what we want to happen. So this is a runtime
performance optimization.

Unfortunately we can't yet physically remove the definitions
of these macros from gtest-port.h, because they are being used
by other code internally at Google (according to zhangxy988).
But no new uses should be added going forward.
parent 4f002f1e
...@@ -570,13 +570,9 @@ class PolymorphicAction { ...@@ -570,13 +570,9 @@ class PolymorphicAction {
private: private:
Impl impl_; Impl impl_;
GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
}; };
Impl impl_; Impl impl_;
GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
}; };
// Creates an Action from its implementation and returns it. The // Creates an Action from its implementation and returns it. The
...@@ -717,13 +713,9 @@ class ReturnAction { ...@@ -717,13 +713,9 @@ class ReturnAction {
private: private:
bool performed_; bool performed_;
const std::shared_ptr<R> wrapper_; const std::shared_ptr<R> wrapper_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
const std::shared_ptr<R> value_; const std::shared_ptr<R> value_;
GTEST_DISALLOW_ASSIGN_(ReturnAction);
}; };
// Implements the ReturnNull() action. // Implements the ReturnNull() action.
...@@ -784,13 +776,9 @@ class ReturnRefAction { ...@@ -784,13 +776,9 @@ class ReturnRefAction {
private: private:
T& ref_; T& ref_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
T& ref_; T& ref_;
GTEST_DISALLOW_ASSIGN_(ReturnRefAction);
}; };
// Implements the polymorphic ReturnRefOfCopy(x) action, which can be // Implements the polymorphic ReturnRefOfCopy(x) action, which can be
...@@ -831,13 +819,9 @@ class ReturnRefOfCopyAction { ...@@ -831,13 +819,9 @@ class ReturnRefOfCopyAction {
private: private:
T value_; T value_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
const T value_; const T value_;
GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);
}; };
// Implements the polymorphic ReturnRoundRobin(v) action, which can be // Implements the polymorphic ReturnRoundRobin(v) action, which can be
...@@ -894,8 +878,6 @@ class AssignAction { ...@@ -894,8 +878,6 @@ class AssignAction {
private: private:
T1* const ptr_; T1* const ptr_;
const T2 value_; const T2 value_;
GTEST_DISALLOW_ASSIGN_(AssignAction);
}; };
#if !GTEST_OS_WINDOWS_MOBILE #if !GTEST_OS_WINDOWS_MOBILE
...@@ -917,8 +899,6 @@ class SetErrnoAndReturnAction { ...@@ -917,8 +899,6 @@ class SetErrnoAndReturnAction {
private: private:
const int errno_; const int errno_;
const T result_; const T result_;
GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);
}; };
#endif // !GTEST_OS_WINDOWS_MOBILE #endif // !GTEST_OS_WINDOWS_MOBILE
...@@ -1024,13 +1004,9 @@ class IgnoreResultAction { ...@@ -1024,13 +1004,9 @@ class IgnoreResultAction {
OriginalFunction; OriginalFunction;
const Action<OriginalFunction> action_; const Action<OriginalFunction> action_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
const A action_; const A action_;
GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);
}; };
template <typename InnerAction, size_t... I> template <typename InnerAction, size_t... I>
...@@ -1467,13 +1443,7 @@ auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) { ...@@ -1467,13 +1443,7 @@ auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) {
template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \ template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \
GMOCK_ACTION_FIELD_PARAMS_(params) \ GMOCK_ACTION_FIELD_PARAMS_(params) \
\
private: \
GTEST_DISALLOW_ASSIGN_(gmock_Impl); \
}; \ }; \
\
private: \
GTEST_DISALLOW_ASSIGN_(full_name); \
}; \ }; \
template <GMOCK_ACTION_TYPENAME_PARAMS_(params)> \ template <GMOCK_ACTION_TYPENAME_PARAMS_(params)> \
inline full_name<GMOCK_ACTION_TYPE_PARAMS_(params)> name( \ inline full_name<GMOCK_ACTION_TYPE_PARAMS_(params)> name( \
...@@ -1512,13 +1482,7 @@ auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) { ...@@ -1512,13 +1482,7 @@ auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) {
} \ } \
template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \ template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \
\
private: \
GTEST_DISALLOW_ASSIGN_(gmock_Impl); \
}; \ }; \
\
private: \
GTEST_DISALLOW_ASSIGN_(name##Action); \
}; \ }; \
inline name##Action name() { return name##Action(); } \ inline name##Action name() { return name##Action(); } \
template <typename F> \ template <typename F> \
......
...@@ -435,16 +435,12 @@ ...@@ -435,16 +435,12 @@
template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_>\ template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_>\
return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const;\ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const;\
GMOCK_INTERNAL_DEFN_##value_params\ GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
};\ };\
template <typename F> operator ::testing::Action<F>() const {\ template <typename F> operator ::testing::Action<F>() const {\
return ::testing::Action<F>(\ return ::testing::Action<F>(\
new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\ new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
}\ }\
GMOCK_INTERNAL_DEFN_##value_params\ GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
};\ };\
template <GMOCK_INTERNAL_DECL_##template_params\ template <GMOCK_INTERNAL_DECL_##template_params\
GMOCK_INTERNAL_DECL_TYPE_##value_params>\ GMOCK_INTERNAL_DECL_TYPE_##value_params>\
......
...@@ -253,16 +253,12 @@ $range k 0..n-1 ...@@ -253,16 +253,12 @@ $range k 0..n-1
template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_>\ template <GMOCK_ACTION_TEMPLATE_ARGS_NAMES_>\
return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const;\ return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const;\
GMOCK_INTERNAL_DEFN_##value_params\ GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
};\ };\
template <typename F> operator ::testing::Action<F>() const {\ template <typename F> operator ::testing::Action<F>() const {\
return ::testing::Action<F>(\ return ::testing::Action<F>(\
new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\ new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
}\ }\
GMOCK_INTERNAL_DEFN_##value_params\ GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
};\ };\
template <GMOCK_INTERNAL_DECL_##template_params\ template <GMOCK_INTERNAL_DECL_##template_params\
GMOCK_INTERNAL_DECL_TYPE_##value_params>\ GMOCK_INTERNAL_DECL_TYPE_##value_params>\
......
...@@ -444,8 +444,6 @@ class MatcherCastImpl<T, Matcher<U> > { ...@@ -444,8 +444,6 @@ class MatcherCastImpl<T, Matcher<U> > {
private: private:
const Matcher<U> source_matcher_; const Matcher<U> source_matcher_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
}; };
...@@ -861,13 +859,9 @@ class RefMatcher<T&> { ...@@ -861,13 +859,9 @@ class RefMatcher<T&> {
private: private:
const Super& object_; const Super& object_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
T& object_; T& object_;
GTEST_DISALLOW_ASSIGN_(RefMatcher);
}; };
// Polymorphic helper functions for narrow and wide string matchers. // Polymorphic helper functions for narrow and wide string matchers.
...@@ -970,8 +964,6 @@ class StrEqualityMatcher { ...@@ -970,8 +964,6 @@ class StrEqualityMatcher {
const StringType string_; const StringType string_;
const bool expect_eq_; const bool expect_eq_;
const bool case_sensitive_; const bool case_sensitive_;
GTEST_DISALLOW_ASSIGN_(StrEqualityMatcher);
}; };
// Implements the polymorphic HasSubstr(substring) matcher, which // Implements the polymorphic HasSubstr(substring) matcher, which
...@@ -1026,8 +1018,6 @@ class HasSubstrMatcher { ...@@ -1026,8 +1018,6 @@ class HasSubstrMatcher {
private: private:
const StringType substring_; const StringType substring_;
GTEST_DISALLOW_ASSIGN_(HasSubstrMatcher);
}; };
// Implements the polymorphic StartsWith(substring) matcher, which // Implements the polymorphic StartsWith(substring) matcher, which
...@@ -1083,8 +1073,6 @@ class StartsWithMatcher { ...@@ -1083,8 +1073,6 @@ class StartsWithMatcher {
private: private:
const StringType prefix_; const StringType prefix_;
GTEST_DISALLOW_ASSIGN_(StartsWithMatcher);
}; };
// Implements the polymorphic EndsWith(substring) matcher, which // Implements the polymorphic EndsWith(substring) matcher, which
...@@ -1139,8 +1127,6 @@ class EndsWithMatcher { ...@@ -1139,8 +1127,6 @@ class EndsWithMatcher {
private: private:
const StringType suffix_; const StringType suffix_;
GTEST_DISALLOW_ASSIGN_(EndsWithMatcher);
}; };
// Implements a matcher that compares the two fields of a 2-tuple // Implements a matcher that compares the two fields of a 2-tuple
...@@ -1234,8 +1220,6 @@ class NotMatcherImpl : public MatcherInterface<const T&> { ...@@ -1234,8 +1220,6 @@ class NotMatcherImpl : public MatcherInterface<const T&> {
private: private:
const Matcher<T> matcher_; const Matcher<T> matcher_;
GTEST_DISALLOW_ASSIGN_(NotMatcherImpl);
}; };
// Implements the Not(m) matcher, which matches a value that doesn't // Implements the Not(m) matcher, which matches a value that doesn't
...@@ -1254,8 +1238,6 @@ class NotMatcher { ...@@ -1254,8 +1238,6 @@ class NotMatcher {
private: private:
InnerMatcher matcher_; InnerMatcher matcher_;
GTEST_DISALLOW_ASSIGN_(NotMatcher);
}; };
// Implements the AllOf(m1, m2) matcher for a particular argument type // Implements the AllOf(m1, m2) matcher for a particular argument type
...@@ -1317,8 +1299,6 @@ class AllOfMatcherImpl : public MatcherInterface<const T&> { ...@@ -1317,8 +1299,6 @@ class AllOfMatcherImpl : public MatcherInterface<const T&> {
private: private:
const std::vector<Matcher<T> > matchers_; const std::vector<Matcher<T> > matchers_;
GTEST_DISALLOW_ASSIGN_(AllOfMatcherImpl);
}; };
// VariadicMatcher is used for the variadic implementation of // VariadicMatcher is used for the variadic implementation of
...@@ -1424,8 +1404,6 @@ class AnyOfMatcherImpl : public MatcherInterface<const T&> { ...@@ -1424,8 +1404,6 @@ class AnyOfMatcherImpl : public MatcherInterface<const T&> {
private: private:
const std::vector<Matcher<T> > matchers_; const std::vector<Matcher<T> > matchers_;
GTEST_DISALLOW_ASSIGN_(AnyOfMatcherImpl);
}; };
// AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...). // AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...).
...@@ -1453,8 +1431,6 @@ class SomeOfArrayMatcher { ...@@ -1453,8 +1431,6 @@ class SomeOfArrayMatcher {
private: private:
const ::std::vector<T> matchers_; const ::std::vector<T> matchers_;
GTEST_DISALLOW_ASSIGN_(SomeOfArrayMatcher);
}; };
template <typename T> template <typename T>
...@@ -1498,8 +1474,6 @@ class TrulyMatcher { ...@@ -1498,8 +1474,6 @@ class TrulyMatcher {
private: private:
Predicate predicate_; Predicate predicate_;
GTEST_DISALLOW_ASSIGN_(TrulyMatcher);
}; };
// Used for implementing Matches(matcher), which turns a matcher into // Used for implementing Matches(matcher), which turns a matcher into
...@@ -1536,8 +1510,6 @@ class MatcherAsPredicate { ...@@ -1536,8 +1510,6 @@ class MatcherAsPredicate {
private: private:
M matcher_; M matcher_;
GTEST_DISALLOW_ASSIGN_(MatcherAsPredicate);
}; };
// For implementing ASSERT_THAT() and EXPECT_THAT(). The template // For implementing ASSERT_THAT() and EXPECT_THAT(). The template
...@@ -1588,8 +1560,6 @@ class PredicateFormatterFromMatcher { ...@@ -1588,8 +1560,6 @@ class PredicateFormatterFromMatcher {
private: private:
const M matcher_; const M matcher_;
GTEST_DISALLOW_ASSIGN_(PredicateFormatterFromMatcher);
}; };
// A helper function for converting a matcher to a predicate-formatter // A helper function for converting a matcher to a predicate-formatter
...@@ -1741,8 +1711,6 @@ class FloatingEqMatcher { ...@@ -1741,8 +1711,6 @@ class FloatingEqMatcher {
const bool nan_eq_nan_; const bool nan_eq_nan_;
// max_abs_error will be used for value comparison when >= 0. // max_abs_error will be used for value comparison when >= 0.
const FloatType max_abs_error_; const FloatType max_abs_error_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
// The following 3 type conversion operators allow FloatEq(expected) and // The following 3 type conversion operators allow FloatEq(expected) and
...@@ -1771,8 +1739,6 @@ class FloatingEqMatcher { ...@@ -1771,8 +1739,6 @@ class FloatingEqMatcher {
const bool nan_eq_nan_; const bool nan_eq_nan_;
// max_abs_error will be used for value comparison when >= 0. // max_abs_error will be used for value comparison when >= 0.
const FloatType max_abs_error_; const FloatType max_abs_error_;
GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
}; };
// A 2-tuple ("binary") wrapper around FloatingEqMatcher: // A 2-tuple ("binary") wrapper around FloatingEqMatcher:
...@@ -1902,13 +1868,9 @@ class PointeeMatcher { ...@@ -1902,13 +1868,9 @@ class PointeeMatcher {
private: private:
const Matcher<const Pointee&> matcher_; const Matcher<const Pointee&> matcher_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
const InnerMatcher matcher_; const InnerMatcher matcher_;
GTEST_DISALLOW_ASSIGN_(PointeeMatcher);
}; };
#if GTEST_HAS_RTTI #if GTEST_HAS_RTTI
...@@ -1945,8 +1907,6 @@ class WhenDynamicCastToMatcherBase { ...@@ -1945,8 +1907,6 @@ class WhenDynamicCastToMatcherBase {
static void GetCastTypeDescription(::std::ostream* os) { static void GetCastTypeDescription(::std::ostream* os) {
*os << "when dynamic_cast to " << GetToName() << ", "; *os << "when dynamic_cast to " << GetToName() << ", ";
} }
GTEST_DISALLOW_ASSIGN_(WhenDynamicCastToMatcherBase);
}; };
// Primary template. // Primary template.
...@@ -2044,8 +2004,6 @@ class FieldMatcher { ...@@ -2044,8 +2004,6 @@ class FieldMatcher {
// Contains either "whose given field " if the name of the field is unknown // Contains either "whose given field " if the name of the field is unknown
// or "whose field `name_of_field` " if the name is known. // or "whose field `name_of_field` " if the name is known.
const std::string whose_field_; const std::string whose_field_;
GTEST_DISALLOW_ASSIGN_(FieldMatcher);
}; };
// Implements the Property() matcher for matching a property // Implements the Property() matcher for matching a property
...@@ -2114,8 +2072,6 @@ class PropertyMatcher { ...@@ -2114,8 +2072,6 @@ class PropertyMatcher {
// Contains either "whose given property " if the name of the property is // Contains either "whose given property " if the name of the property is
// unknown or "whose property `name_of_property` " if the name is known. // unknown or "whose property `name_of_property` " if the name is known.
const std::string whose_property_; const std::string whose_property_;
GTEST_DISALLOW_ASSIGN_(PropertyMatcher);
}; };
// Type traits specifying various features of different functors for ResultOf. // Type traits specifying various features of different functors for ResultOf.
...@@ -2205,14 +2161,10 @@ class ResultOfMatcher { ...@@ -2205,14 +2161,10 @@ class ResultOfMatcher {
// how many times the callable will be invoked. // how many times the callable will be invoked.
mutable CallableStorageType callable_; mutable CallableStorageType callable_;
const Matcher<ResultType> matcher_; const Matcher<ResultType> matcher_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; // class Impl }; // class Impl
const CallableStorageType callable_; const CallableStorageType callable_;
const InnerMatcher matcher_; const InnerMatcher matcher_;
GTEST_DISALLOW_ASSIGN_(ResultOfMatcher);
}; };
// Implements a matcher that checks the size of an STL-style container. // Implements a matcher that checks the size of an STL-style container.
...@@ -2257,12 +2209,10 @@ class SizeIsMatcher { ...@@ -2257,12 +2209,10 @@ class SizeIsMatcher {
private: private:
const Matcher<SizeType> size_matcher_; const Matcher<SizeType> size_matcher_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
private: private:
const SizeMatcher size_matcher_; const SizeMatcher size_matcher_;
GTEST_DISALLOW_ASSIGN_(SizeIsMatcher);
}; };
// Implements a matcher that checks the begin()..end() distance of an STL-style // Implements a matcher that checks the begin()..end() distance of an STL-style
...@@ -2314,12 +2264,10 @@ class BeginEndDistanceIsMatcher { ...@@ -2314,12 +2264,10 @@ class BeginEndDistanceIsMatcher {
private: private:
const Matcher<DistanceType> distance_matcher_; const Matcher<DistanceType> distance_matcher_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
private: private:
const DistanceMatcher distance_matcher_; const DistanceMatcher distance_matcher_;
GTEST_DISALLOW_ASSIGN_(BeginEndDistanceIsMatcher);
}; };
// Implements an equality matcher for any STL-style container whose elements // Implements an equality matcher for any STL-style container whose elements
...@@ -2412,8 +2360,6 @@ class ContainerEqMatcher { ...@@ -2412,8 +2360,6 @@ class ContainerEqMatcher {
private: private:
const StlContainer expected_; const StlContainer expected_;
GTEST_DISALLOW_ASSIGN_(ContainerEqMatcher);
}; };
// A comparator functor that uses the < operator to compare two values. // A comparator functor that uses the < operator to compare two values.
...@@ -2495,8 +2441,6 @@ class WhenSortedByMatcher { ...@@ -2495,8 +2441,6 @@ class WhenSortedByMatcher {
private: private:
const Comparator comparator_; const Comparator comparator_;
const ContainerMatcher matcher_; const ContainerMatcher matcher_;
GTEST_DISALLOW_ASSIGN_(WhenSortedByMatcher);
}; };
// Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher // Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher
...@@ -2612,15 +2556,11 @@ class PointwiseMatcher { ...@@ -2612,15 +2556,11 @@ class PointwiseMatcher {
private: private:
const Matcher<InnerMatcherArg> mono_tuple_matcher_; const Matcher<InnerMatcherArg> mono_tuple_matcher_;
const RhsStlContainer rhs_; const RhsStlContainer rhs_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
private: private:
const TupleMatcher tuple_matcher_; const TupleMatcher tuple_matcher_;
const RhsStlContainer rhs_; const RhsStlContainer rhs_;
GTEST_DISALLOW_ASSIGN_(PointwiseMatcher);
}; };
// Holds the logic common to ContainsMatcherImpl and EachMatcherImpl. // Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.
...@@ -2663,8 +2603,6 @@ class QuantifierMatcherImpl : public MatcherInterface<Container> { ...@@ -2663,8 +2603,6 @@ class QuantifierMatcherImpl : public MatcherInterface<Container> {
protected: protected:
const Matcher<const Element&> inner_matcher_; const Matcher<const Element&> inner_matcher_;
GTEST_DISALLOW_ASSIGN_(QuantifierMatcherImpl);
}; };
// Implements Contains(element_matcher) for the given argument type Container. // Implements Contains(element_matcher) for the given argument type Container.
...@@ -2691,9 +2629,6 @@ class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> { ...@@ -2691,9 +2629,6 @@ class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
MatchResultListener* listener) const override { MatchResultListener* listener) const override {
return this->MatchAndExplainImpl(false, container, listener); return this->MatchAndExplainImpl(false, container, listener);
} }
private:
GTEST_DISALLOW_ASSIGN_(ContainsMatcherImpl);
}; };
// Implements Each(element_matcher) for the given argument type Container. // Implements Each(element_matcher) for the given argument type Container.
...@@ -2720,9 +2655,6 @@ class EachMatcherImpl : public QuantifierMatcherImpl<Container> { ...@@ -2720,9 +2655,6 @@ class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
MatchResultListener* listener) const override { MatchResultListener* listener) const override {
return this->MatchAndExplainImpl(true, container, listener); return this->MatchAndExplainImpl(true, container, listener);
} }
private:
GTEST_DISALLOW_ASSIGN_(EachMatcherImpl);
}; };
// Implements polymorphic Contains(element_matcher). // Implements polymorphic Contains(element_matcher).
...@@ -2739,8 +2671,6 @@ class ContainsMatcher { ...@@ -2739,8 +2671,6 @@ class ContainsMatcher {
private: private:
const M inner_matcher_; const M inner_matcher_;
GTEST_DISALLOW_ASSIGN_(ContainsMatcher);
}; };
// Implements polymorphic Each(element_matcher). // Implements polymorphic Each(element_matcher).
...@@ -2757,8 +2687,6 @@ class EachMatcher { ...@@ -2757,8 +2687,6 @@ class EachMatcher {
private: private:
const M inner_matcher_; const M inner_matcher_;
GTEST_DISALLOW_ASSIGN_(EachMatcher);
}; };
struct Rank1 {}; struct Rank1 {};
...@@ -2829,8 +2757,6 @@ class KeyMatcherImpl : public MatcherInterface<PairType> { ...@@ -2829,8 +2757,6 @@ class KeyMatcherImpl : public MatcherInterface<PairType> {
private: private:
const Matcher<const KeyType&> inner_matcher_; const Matcher<const KeyType&> inner_matcher_;
GTEST_DISALLOW_ASSIGN_(KeyMatcherImpl);
}; };
// Implements polymorphic Key(matcher_for_key). // Implements polymorphic Key(matcher_for_key).
...@@ -2847,8 +2773,6 @@ class KeyMatcher { ...@@ -2847,8 +2773,6 @@ class KeyMatcher {
private: private:
const M matcher_for_key_; const M matcher_for_key_;
GTEST_DISALLOW_ASSIGN_(KeyMatcher);
}; };
// Implements Pair(first_matcher, second_matcher) for the given argument pair // Implements Pair(first_matcher, second_matcher) for the given argument pair
...@@ -2934,8 +2858,6 @@ class PairMatcherImpl : public MatcherInterface<PairType> { ...@@ -2934,8 +2858,6 @@ class PairMatcherImpl : public MatcherInterface<PairType> {
const Matcher<const FirstType&> first_matcher_; const Matcher<const FirstType&> first_matcher_;
const Matcher<const SecondType&> second_matcher_; const Matcher<const SecondType&> second_matcher_;
GTEST_DISALLOW_ASSIGN_(PairMatcherImpl);
}; };
// Implements polymorphic Pair(first_matcher, second_matcher). // Implements polymorphic Pair(first_matcher, second_matcher).
...@@ -2954,8 +2876,6 @@ class PairMatcher { ...@@ -2954,8 +2876,6 @@ class PairMatcher {
private: private:
const FirstMatcher first_matcher_; const FirstMatcher first_matcher_;
const SecondMatcher second_matcher_; const SecondMatcher second_matcher_;
GTEST_DISALLOW_ASSIGN_(PairMatcher);
}; };
// Implements ElementsAre() and ElementsAreArray(). // Implements ElementsAre() and ElementsAreArray().
...@@ -3101,8 +3021,6 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> { ...@@ -3101,8 +3021,6 @@ class ElementsAreMatcherImpl : public MatcherInterface<Container> {
size_t count() const { return matchers_.size(); } size_t count() const { return matchers_.size(); }
::std::vector<Matcher<const Element&> > matchers_; ::std::vector<Matcher<const Element&> > matchers_;
GTEST_DISALLOW_ASSIGN_(ElementsAreMatcherImpl);
}; };
// Connectivity matrix of (elements X matchers), in element-major order. // Connectivity matrix of (elements X matchers), in element-major order.
...@@ -3205,8 +3123,6 @@ class GTEST_API_ UnorderedElementsAreMatcherImplBase { ...@@ -3205,8 +3123,6 @@ class GTEST_API_ UnorderedElementsAreMatcherImplBase {
private: private:
UnorderedMatcherRequire::Flags match_flags_; UnorderedMatcherRequire::Flags match_flags_;
MatcherDescriberVec matcher_describers_; MatcherDescriberVec matcher_describers_;
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImplBase);
}; };
// Implements UnorderedElementsAre, UnorderedElementsAreArray, IsSubsetOf, and // Implements UnorderedElementsAre, UnorderedElementsAreArray, IsSubsetOf, and
...@@ -3302,8 +3218,6 @@ class UnorderedElementsAreMatcherImpl ...@@ -3302,8 +3218,6 @@ class UnorderedElementsAreMatcherImpl
} }
::std::vector<Matcher<const Element&> > matchers_; ::std::vector<Matcher<const Element&> > matchers_;
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcherImpl);
}; };
// Functor for use in TransformTuple. // Functor for use in TransformTuple.
...@@ -3341,7 +3255,6 @@ class UnorderedElementsAreMatcher { ...@@ -3341,7 +3255,6 @@ class UnorderedElementsAreMatcher {
private: private:
const MatcherTuple matchers_; const MatcherTuple matchers_;
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreMatcher);
}; };
// Implements ElementsAre. // Implements ElementsAre.
...@@ -3371,7 +3284,6 @@ class ElementsAreMatcher { ...@@ -3371,7 +3284,6 @@ class ElementsAreMatcher {
private: private:
const MatcherTuple matchers_; const MatcherTuple matchers_;
GTEST_DISALLOW_ASSIGN_(ElementsAreMatcher);
}; };
// Implements UnorderedElementsAreArray(), IsSubsetOf(), and IsSupersetOf(). // Implements UnorderedElementsAreArray(), IsSubsetOf(), and IsSupersetOf().
...@@ -3393,8 +3305,6 @@ class UnorderedElementsAreArrayMatcher { ...@@ -3393,8 +3305,6 @@ class UnorderedElementsAreArrayMatcher {
private: private:
UnorderedMatcherRequire::Flags match_flags_; UnorderedMatcherRequire::Flags match_flags_;
::std::vector<T> matchers_; ::std::vector<T> matchers_;
GTEST_DISALLOW_ASSIGN_(UnorderedElementsAreArrayMatcher);
}; };
// Implements ElementsAreArray(). // Implements ElementsAreArray().
...@@ -3416,8 +3326,6 @@ class ElementsAreArrayMatcher { ...@@ -3416,8 +3326,6 @@ class ElementsAreArrayMatcher {
private: private:
const ::std::vector<T> matchers_; const ::std::vector<T> matchers_;
GTEST_DISALLOW_ASSIGN_(ElementsAreArrayMatcher);
}; };
// Given a 2-tuple matcher tm of type Tuple2Matcher and a value second // Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
...@@ -3479,8 +3387,6 @@ class BoundSecondMatcher { ...@@ -3479,8 +3387,6 @@ class BoundSecondMatcher {
private: private:
const Matcher<const ArgTuple&> mono_tuple2_matcher_; const Matcher<const ArgTuple&> mono_tuple2_matcher_;
const Second second_value_; const Second second_value_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
const Tuple2Matcher tuple2_matcher_; const Tuple2Matcher tuple2_matcher_;
...@@ -3553,12 +3459,10 @@ class OptionalMatcher { ...@@ -3553,12 +3459,10 @@ class OptionalMatcher {
private: private:
const Matcher<ValueType> value_matcher_; const Matcher<ValueType> value_matcher_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
private: private:
const ValueMatcher value_matcher_; const ValueMatcher value_matcher_;
GTEST_DISALLOW_ASSIGN_(OptionalMatcher);
}; };
namespace variant_matcher { namespace variant_matcher {
......
...@@ -879,8 +879,6 @@ class GTEST_API_ ExpectationBase { ...@@ -879,8 +879,6 @@ class GTEST_API_ ExpectationBase {
Clause last_clause_; Clause last_clause_;
mutable bool action_count_checked_; // Under mutex_. mutable bool action_count_checked_; // Under mutex_.
mutable Mutex mutex_; // Protects action_count_checked_. mutable Mutex mutex_; // Protects action_count_checked_.
GTEST_DISALLOW_ASSIGN_(ExpectationBase);
}; // class ExpectationBase }; // class ExpectationBase
// Impements an expectation for the given function type. // Impements an expectation for the given function type.
...@@ -1295,8 +1293,6 @@ class MockSpec { ...@@ -1295,8 +1293,6 @@ class MockSpec {
internal::FunctionMocker<F>* const function_mocker_; internal::FunctionMocker<F>* const function_mocker_;
// The argument matchers specified in the spec. // The argument matchers specified in the spec.
ArgumentMatcherTuple matchers_; ArgumentMatcherTuple matchers_;
GTEST_DISALLOW_ASSIGN_(MockSpec);
}; // class MockSpec }; // class MockSpec
// Wrapper type for generically holding an ordinary value or lvalue reference. // Wrapper type for generically holding an ordinary value or lvalue reference.
......
...@@ -218,8 +218,6 @@ class MaxBipartiteMatchState { ...@@ -218,8 +218,6 @@ class MaxBipartiteMatchState {
// right_[left_[i]] = i. // right_[left_[i]] = i.
::std::vector<size_t> left_; ::std::vector<size_t> left_;
::std::vector<size_t> right_; ::std::vector<size_t> right_;
GTEST_DISALLOW_ASSIGN_(MaxBipartiteMatchState);
}; };
const size_t MaxBipartiteMatchState::kUnused; const size_t MaxBipartiteMatchState::kUnused;
......
...@@ -575,8 +575,6 @@ class FromType { ...@@ -575,8 +575,6 @@ class FromType {
private: private:
bool* const converted_; bool* const converted_;
GTEST_DISALLOW_ASSIGN_(FromType);
}; };
class ToType { class ToType {
......
...@@ -3746,17 +3746,11 @@ struct AStruct { ...@@ -3746,17 +3746,11 @@ struct AStruct {
const double y; // A const field. const double y; // A const field.
Uncopyable z; // An uncopyable field. Uncopyable z; // An uncopyable field.
const char* p; // A pointer field. const char* p; // A pointer field.
private:
GTEST_DISALLOW_ASSIGN_(AStruct);
}; };
// A derived struct for testing Field(). // A derived struct for testing Field().
struct DerivedStruct : public AStruct { struct DerivedStruct : public AStruct {
char ch; char ch;
private:
GTEST_DISALLOW_ASSIGN_(DerivedStruct);
}; };
// Tests that Field(&Foo::field, ...) works when field is non-const. // Tests that Field(&Foo::field, ...) works when field is non-const.
......
...@@ -1120,8 +1120,6 @@ class NativeArray { ...@@ -1120,8 +1120,6 @@ class NativeArray {
const Element* array_; const Element* array_;
size_t size_; size_t size_;
void (NativeArray::*clone_)(const Element*, size_t); void (NativeArray::*clone_)(const Element*, size_t);
GTEST_DISALLOW_ASSIGN_(NativeArray);
}; };
// Backport of std::index_sequence. // Backport of std::index_sequence.
......
...@@ -682,7 +682,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; ...@@ -682,7 +682,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// This should be used in the private: declarations for a class. // This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \ #define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
type(type const &) = delete; \ type(type const &) = delete; \
GTEST_DISALLOW_ASSIGN_(type) type& operator=(type const &) = delete
// A macro to disallow move operator= // A macro to disallow move operator=
// This should be used in the private: declarations for a class. // This should be used in the private: declarations for a class.
...@@ -693,7 +693,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; ...@@ -693,7 +693,7 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// This should be used in the private: declarations for a class. // This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_MOVE_AND_ASSIGN_(type) \ #define GTEST_DISALLOW_MOVE_AND_ASSIGN_(type) \
type(type &&) noexcept = delete; \ type(type &&) noexcept = delete; \
GTEST_DISALLOW_MOVE_ASSIGN_(type) type& operator=(type &&) noexcept = delete
// Tell the compiler to warn about unused return values for functions declared // Tell the compiler to warn about unused return values for functions declared
// with this macro. The macro should be used on function declarations // with this macro. The macro should be used on function declarations
...@@ -920,8 +920,6 @@ class GTEST_API_ RE { ...@@ -920,8 +920,6 @@ class GTEST_API_ RE {
const char* full_pattern_; // For FullMatch(); const char* full_pattern_; // For FullMatch();
# endif # endif
GTEST_DISALLOW_ASSIGN_(RE);
}; };
#endif // GTEST_USES_PCRE #endif // GTEST_USES_PCRE
......
...@@ -1180,8 +1180,6 @@ class DestructorTracker { ...@@ -1180,8 +1180,6 @@ class DestructorTracker {
return DestructorCall::List().size() - 1; return DestructorCall::List().size() - 1;
} }
const size_t index_; const size_t index_;
GTEST_DISALLOW_ASSIGN_(DestructorTracker);
}; };
typedef ThreadLocal<DestructorTracker>* ThreadParam; typedef ThreadLocal<DestructorTracker>* ThreadParam;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment