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
efe70361
Commit
efe70361
authored
Nov 19, 2020
by
Abseil Team
Committed by
Gennadiy Rozental
Nov 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Googletest export
Update note on static const data members for C++17. Using `constexpr` provides a tidier solution, where applicable. PiperOrigin-RevId: 343276402
parent
60b8906d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
faq.md
googletest/docs/faq.md
+12
-0
No files found.
googletest/docs/faq.md
View file @
efe70361
...
@@ -217,6 +217,18 @@ particular, using it in googletest comparison assertions (`EXPECT_EQ`, etc) will
...
@@ -217,6 +217,18 @@ particular, using it in googletest comparison assertions (`EXPECT_EQ`, etc) will
generate an "undefined reference" linker error. The fact that "it used to work"
generate an "undefined reference" linker error. The fact that "it used to work"
doesn't mean it's valid. It just means that you were lucky. :-)
doesn't mean it's valid. It just means that you were lucky. :-)
If the declaration of the static data member is
`constexpr`
then it is
implicitly an
`inline`
definition, and a separate definition in
`foo.cc`
is not
needed:
```
c++
// foo.h
class
Foo
{
...
static
constexpr
int
kBar
=
100
;
// Defines kBar, no need to do it in foo.cc.
};
```
## Can I derive a test fixture from another?
## Can I derive a test fixture from another?
Yes.
Yes.
...
...
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