File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -116,17 +116,6 @@ char **envp = nullptr;
116116
117117using internal::RunContext;
118118
119- void Test::addTest (Test *T) {
120- if (End == nullptr ) {
121- Start = T;
122- End = T;
123- return ;
124- }
125-
126- End->Next = T;
127- End = T;
128- }
129-
130119int Test::getNumTests () {
131120 int N = 0 ;
132121 for (Test *T = Start; T; T = T->Next , ++N)
Original file line number Diff line number Diff line change @@ -127,7 +127,18 @@ class Test {
127127 static int runTests (const TestOptions &Options);
128128
129129protected:
130- static void addTest (Test *T);
130+ constexpr static void *addTest (Test *T) {
131+ if (End == nullptr ) {
132+ Start = T;
133+ End = T;
134+ // read of constexpr
135+ return nullptr ;
136+ }
137+
138+ End->Next = T;
139+ End = T;
140+ return nullptr ;
141+ }
131142
132143 // We make use of a template function, with |LHS| and |RHS| as explicit
133144 // parameters, for enhanced type checking. Other gtest like unittest
You can’t perform that action at this time.
0 commit comments