Commit bc1023b4 authored by Abseil Team's avatar Abseil Team Committed by Gennadiy Civil
Browse files

Googletest export

Fix warning about deprecation of implicit operations such as copy constructors or assignment operators.

Specifically:

MatcherBase's default copy constructor, assignment operator, move operator, and move assignment operator are now declared explicitly rather than depending on the compiler implicit generation (which is disallowed/warned against due to MatcherBase's declaration of the destructor).

PiperOrigin-RevId: 228573333
parent 50f1a779
...@@ -296,6 +296,11 @@ class MatcherBase { ...@@ -296,6 +296,11 @@ class MatcherBase {
!internal::IsSame<U, const U&>::value>::type* = nullptr) !internal::IsSame<U, const U&>::value>::type* = nullptr)
: impl_(new internal::MatcherInterfaceAdapter<U>(impl)) {} : impl_(new internal::MatcherInterfaceAdapter<U>(impl)) {}
MatcherBase(const MatcherBase&) = default;
MatcherBase& operator=(const MatcherBase&) = default;
MatcherBase(MatcherBase&&) = default;
MatcherBase& operator=(MatcherBase&&) = default;
virtual ~MatcherBase() {} virtual ~MatcherBase() {}
private: private:
...@@ -545,13 +550,9 @@ class PolymorphicMatcher { ...@@ -545,13 +550,9 @@ class PolymorphicMatcher {
private: private:
const Impl impl_; const Impl impl_;
GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
}; };
Impl impl_; Impl impl_;
GTEST_DISALLOW_ASSIGN_(PolymorphicMatcher);
}; };
// Creates a matcher from its implementation. This is easier to use // Creates a matcher from its implementation. This is easier to use
...@@ -618,10 +619,8 @@ class ComparisonBase { ...@@ -618,10 +619,8 @@ class ComparisonBase {
private: private:
Rhs rhs_; Rhs rhs_;
GTEST_DISALLOW_ASSIGN_(Impl);
}; };
Rhs rhs_; Rhs rhs_;
GTEST_DISALLOW_ASSIGN_(ComparisonBase);
}; };
template <typename Rhs> template <typename Rhs>
...@@ -724,8 +723,6 @@ class MatchesRegexMatcher { ...@@ -724,8 +723,6 @@ class MatchesRegexMatcher {
private: private:
const std::shared_ptr<const RE> regex_; const std::shared_ptr<const RE> regex_;
const bool full_match_; const bool full_match_;
GTEST_DISALLOW_ASSIGN_(MatchesRegexMatcher);
}; };
} // namespace internal } // namespace internal
......
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