Commit ef25d27d by Gennadiy Rozental

Merge pull request #2815 from Quuxplusone:simple

PiperOrigin-RevId: 308625388
parents 95555251 1b066f4e
...@@ -25,16 +25,16 @@ matrix: ...@@ -25,16 +25,16 @@ matrix:
script: ./ci/build-linux-bazel.sh script: ./ci/build-linux-bazel.sh
- os: linux - os: linux
compiler: gcc compiler: gcc
env: BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS=-std=c++11 env: BUILD_TYPE=Debug VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated"
- os: linux - os: linux
compiler: clang compiler: clang
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 NO_EXCEPTION=ON NO_RTTI=ON COMPILER_IS_GNUCXX=ON env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated" NO_EXCEPTION=ON NO_RTTI=ON COMPILER_IS_GNUCXX=ON
- os: osx - os: osx
compiler: gcc compiler: gcc
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated" HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
- os: osx - os: osx
compiler: clang compiler: clang
env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS=-std=c++11 HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp env: BUILD_TYPE=Release VERBOSE=1 CXX_FLAGS="-std=c++11 -Wdeprecated" HOMEBREW_LOGS=~/homebrew-logs HOMEBREW_TEMP=~/homebrew-temp
# These are the install and build (script) phases for the most common entries in the matrix. They could be included # These are the install and build (script) phases for the most common entries in the matrix. They could be included
# in each entry in the matrix, but that is just repetitive. # in each entry in the matrix, but that is just repetitive.
......
...@@ -571,13 +571,9 @@ class PolymorphicAction { ...@@ -571,13 +571,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
...@@ -718,13 +714,9 @@ class ReturnAction { ...@@ -718,13 +714,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.
...@@ -785,13 +777,9 @@ class ReturnRefAction { ...@@ -785,13 +777,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
...@@ -832,13 +820,9 @@ class ReturnRefOfCopyAction { ...@@ -832,13 +820,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
...@@ -895,8 +879,6 @@ class AssignAction { ...@@ -895,8 +879,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
...@@ -918,8 +900,6 @@ class SetErrnoAndReturnAction { ...@@ -918,8 +900,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
...@@ -1025,13 +1005,9 @@ class IgnoreResultAction { ...@@ -1025,13 +1005,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>
...@@ -1493,13 +1469,7 @@ auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) { ...@@ -1493,13 +1469,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( \
...@@ -1538,13 +1508,7 @@ auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) { ...@@ -1538,13 +1508,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>\
......
...@@ -499,7 +499,10 @@ class GTEST_API_ Expectation { ...@@ -499,7 +499,10 @@ class GTEST_API_ Expectation {
public: public:
// Constructs a null object that doesn't reference any expectation. // Constructs a null object that doesn't reference any expectation.
Expectation(); Expectation();
Expectation(Expectation&&) = default;
Expectation(const Expectation&) = default;
Expectation& operator=(Expectation&&) = default;
Expectation& operator=(const Expectation&) = default;
~Expectation(); ~Expectation();
// This single-argument ctor must not be explicit, in order to support the // This single-argument ctor must not be explicit, in order to support the
...@@ -879,8 +882,6 @@ class GTEST_API_ ExpectationBase { ...@@ -879,8 +882,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 +1296,6 @@ class MockSpec { ...@@ -1295,8 +1296,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;
......
...@@ -574,8 +574,6 @@ class FromType { ...@@ -574,8 +574,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.
......
...@@ -681,8 +681,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; ...@@ -681,8 +681,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// A macro to disallow copy constructor and operator= // A macro to disallow copy constructor and operator=
// 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.
...@@ -692,8 +692,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION; ...@@ -692,8 +692,8 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
// A macro to disallow move constructor and operator= // A macro to disallow move constructor and operator=
// 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
......
...@@ -490,11 +490,12 @@ TEST(CombineTest, CombineWithMaxNumberOfParameters) { ...@@ -490,11 +490,12 @@ TEST(CombineTest, CombineWithMaxNumberOfParameters) {
class NonDefaultConstructAssignString { class NonDefaultConstructAssignString {
public: public:
NonDefaultConstructAssignString(const std::string& s) : str_(s) {} NonDefaultConstructAssignString(const std::string& s) : str_(s) {}
NonDefaultConstructAssignString() = delete;
NonDefaultConstructAssignString(const NonDefaultConstructAssignString&) = NonDefaultConstructAssignString(const NonDefaultConstructAssignString&) =
default; default;
NonDefaultConstructAssignString& operator=(
NonDefaultConstructAssignString() = delete; const NonDefaultConstructAssignString&) = delete;
void operator=(const NonDefaultConstructAssignString&) = delete; ~NonDefaultConstructAssignString() = default;
const std::string& str() const { return str_; } const std::string& str() const { return str_; }
......
...@@ -90,10 +90,10 @@ TEST(IsXDigitTest, ReturnsFalseForWideNonAscii) { ...@@ -90,10 +90,10 @@ TEST(IsXDigitTest, ReturnsFalseForWideNonAscii) {
class Base { class Base {
public: public:
// Copy constructor and assignment operator do exactly what we need, so we
// use them.
Base() : member_(0) {} Base() : member_(0) {}
explicit Base(int n) : member_(n) {} explicit Base(int n) : member_(n) {}
Base(const Base&) = default;
Base& operator=(const Base&) = default;
virtual ~Base() {} virtual ~Base() {}
int member() { return member_; } int member() { return member_; }
...@@ -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