Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
fbe34cec
Commit
fbe34cec
authored
Jan 02, 2020
by
Andy Soffer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2639 from trzecieu:trzeci/move_ctor_assign
PiperOrigin-RevId: 286896167
parents
a13a0626
bf31ed37
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
gtest-internal.h
googletest/include/gtest/internal/gtest-internal.h
+5
-2
gtest-port.h
googletest/include/gtest/internal/gtest-port.h
+16
-3
No files found.
googletest/include/gtest/internal/gtest-internal.h
View file @
fbe34cec
...
@@ -1405,12 +1405,15 @@ constexpr bool InstantiateTypedTestCase_P_IsDeprecated() { return true; }
...
@@ -1405,12 +1405,15 @@ constexpr bool InstantiateTypedTestCase_P_IsDeprecated() { return true; }
: public parent_class { \
: public parent_class { \
public: \
public: \
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
~GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() = default; \
GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
test_name)); \
GTEST_DISALLOW_MOVE_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
test_name)); \
\
\
private: \
private: \
void TestBody() override; \
void TestBody() override; \
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \
static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \
GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
test_name)); \
}; \
}; \
\
\
::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_suite_name, \
::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_suite_name, \
...
...
googletest/include/gtest/internal/gtest-port.h
View file @
fbe34cec
...
@@ -190,8 +190,10 @@
...
@@ -190,8 +190,10 @@
// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
// variable don't have to be used.
// variable don't have to be used.
// GTEST_DISALLOW_ASSIGN_ - disables operator=.
// GTEST_DISALLOW_ASSIGN_ - disables
copy
operator=.
// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
// GTEST_DISALLOW_MOVE_ASSIGN_ - disables move operator=.
// GTEST_DISALLOW_MOVE_AND_ASSIGN_ - disables move ctor and operator=.
// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
// GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
// GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
// suppressed (constant conditional).
// suppressed (constant conditional).
...
@@ -666,10 +668,10 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
...
@@ -666,10 +668,10 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
#endif
#endif
// A macro to disallow operator=
// A macro to disallow
copy
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_ASSIGN_(type) \
#define GTEST_DISALLOW_ASSIGN_(type) \
void
operator=(type const &) = delete
type&
operator=(type const &) = delete
// 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.
...
@@ -677,6 +679,17 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
...
@@ -677,6 +679,17 @@ typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
type(type const &) = delete; \
type(type const &) = delete; \
GTEST_DISALLOW_ASSIGN_(type)
GTEST_DISALLOW_ASSIGN_(type)
// A macro to disallow move operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_MOVE_ASSIGN_(type) \
type& operator=(type &&) noexcept = delete
// A macro to disallow move constructor and operator=
// This should be used in the private: declarations for a class.
#define GTEST_DISALLOW_MOVE_AND_ASSIGN_(type) \
type(type &&) noexcept = delete; \
GTEST_DISALLOW_MOVE_ASSIGN_(type)
// 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
// following the argument list:
// following the argument list:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment