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
2fc23831
Commit
2fc23831
authored
May 12, 2019
by
Chaoran Yang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use std::addressof to instead of plain '&'.
Otherwise the code won't compile if the '&' operater is overloaded and return something that cannot be casted to void *.
parent
52998153
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
gtest-printers.h
googletest/include/gtest/gtest-printers.h
+2
-2
No files found.
googletest/include/gtest/gtest-printers.h
View file @
2fc23831
...
@@ -152,8 +152,8 @@ class TypeWithoutFormatter {
...
@@ -152,8 +152,8 @@ class TypeWithoutFormatter {
// This default version is called when kTypeKind is kOtherType.
// This default version is called when kTypeKind is kOtherType.
static
void
PrintValue
(
const
T
&
value
,
::
std
::
ostream
*
os
)
{
static
void
PrintValue
(
const
T
&
value
,
::
std
::
ostream
*
os
)
{
PrintBytesInObjectTo
(
static_cast
<
const
unsigned
char
*>
(
PrintBytesInObjectTo
(
static_cast
<
const
unsigned
char
*>
(
reinterpret_cast
<
const
void
*>
(
&
value
)),
reinterpret_cast
<
const
void
*>
(
sizeof
(
value
),
os
);
std
::
addressof
(
value
))),
sizeof
(
value
),
os
);
}
}
};
};
...
...
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