diff options
author | Tom Hughes <tomhughes@google.com> | 2023-04-21 17:40:36 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-21 17:41:25 (GMT) |
commit | 783d00fd19865fcbc3065e3fb3e17144761fcf5a (patch) | |
tree | bb27246918f3fcdea0cb619a37ac43ccb1abeac0 /googlemock/include | |
parent | baf182e006bcb82ef5e0b407e350a1d4c444b76a (diff) | |
download | googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.zip googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.tar.gz googletest-783d00fd19865fcbc3065e3fb3e17144761fcf5a.tar.bz2 |
Use '=default' to define trivial constructor/destructorsrefs/pull/4221/head
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html
PiperOrigin-RevId: 526079054
Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
Diffstat (limited to 'googlemock/include')
-rw-r--r-- | googlemock/include/gmock/gmock-actions.h | 8 | ||||
-rw-r--r-- | googlemock/include/gmock/gmock-cardinalities.h | 4 | ||||
-rw-r--r-- | googlemock/include/gmock/gmock-spec-builders.h | 4 | ||||
-rw-r--r-- | googlemock/include/gmock/internal/gmock-internal-utils.h | 2 |
4 files changed, 9 insertions, 9 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index c0bb8a9..bd9ba73 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -611,7 +611,7 @@ class DefaultValue { private: class ValueProducer { public: - virtual ~ValueProducer() {} + virtual ~ValueProducer() = default; virtual T Produce() = 0; }; @@ -699,8 +699,8 @@ class ActionInterface { typedef typename internal::Function<F>::Result Result; typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; - ActionInterface() {} - virtual ~ActionInterface() {} + ActionInterface() = default; + virtual ~ActionInterface() = default; // Performs the action. This method is not const, as in general an // action can have side effects and be stateful. For example, a @@ -749,7 +749,7 @@ class Action<R(Args...)> { // Constructs a null Action. Needed for storing Action objects in // STL containers. - Action() {} + Action() = default; // Construct an Action from a specified callable. // This cannot take std::function directly, because then Action would not be diff --git a/googlemock/include/gmock/gmock-cardinalities.h b/googlemock/include/gmock/gmock-cardinalities.h index b6ab648..533e604 100644 --- a/googlemock/include/gmock/gmock-cardinalities.h +++ b/googlemock/include/gmock/gmock-cardinalities.h @@ -65,7 +65,7 @@ namespace testing { // The implementation of a cardinality. class CardinalityInterface { public: - virtual ~CardinalityInterface() {} + virtual ~CardinalityInterface() = default; // Conservative estimate on the lower/upper bound of the number of // calls allowed. @@ -92,7 +92,7 @@ class GTEST_API_ Cardinality { public: // Constructs a null cardinality. Needed for storing Cardinality // objects in STL containers. - Cardinality() {} + Cardinality() = default; // Constructs a Cardinality from its implementation. explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {} diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index 2a33acb..78ca15d 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -566,7 +566,7 @@ class ExpectationSet { typedef Expectation::Set::value_type value_type; // Constructs an empty set. - ExpectationSet() {} + ExpectationSet() = default; // This single-argument ctor must not be explicit, in order to support the // ExpectationSet es = EXPECT_CALL(...); @@ -1446,7 +1446,7 @@ class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase { using ArgumentTuple = std::tuple<Args...>; using ArgumentMatcherTuple = std::tuple<Matcher<Args>...>; - FunctionMocker() {} + FunctionMocker() = default; // There is no generally useful and implementable semantics of // copying a mock object, so copying a mock is usually a user error. diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index d344438..ead6d7c 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -224,7 +224,7 @@ class FailureReporterInterface { // The type of a failure (either non-fatal or fatal). enum FailureType { kNonfatal, kFatal }; - virtual ~FailureReporterInterface() {} + virtual ~FailureReporterInterface() = default; // Reports a failure that occurred at the given source file location. virtual void ReportFailure(FailureType type, const char* file, int line, |