Use '=default' to define trivial constructor/destructors
https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html PiperOrigin-RevId: 526079054 Change-Id: Ia4db21e3e5f58b90de05d52fd94b291ed06d785d
This commit is contained in:
committed by
Copybara-Service
parent
baf182e006
commit
783d00fd19
@@ -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
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user