mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-26 16:19:30 +03:00
tests/TestTestRunner.cpp: avoid referencing yet unitialized member
On recent gcc-12 snapshot build fails as:
[ 52%] Building CXX object CMakeFiles/TestUnitTest++.dir/tests/TestTestRunner.cpp.o
unittest-cpp/tests/TestTestRunner.cpp:
In constructor '{anonymous}::FixtureBase::FixtureBase()':
unittest-cpp/tests/TestTestRunner.cpp:48:19:
error: member '{anonymous}::FixtureBase::reporter' is used uninitialized [-Werror=uninitialized]
48 | : runner(reporter)
| ^~~~~~~~
cc1plus: all warnings being treated as errors
On https://gcc.gnu.org/PR103375 Andrew suggested to match order of class
members to avoid picking a member reference to yet unconstructed object.
This commit is contained in:
parent
10e50ad70c
commit
f361c2a103
1 changed files with 1 additions and 1 deletions
|
|
@ -60,8 +60,8 @@ namespace
|
|||
return result;
|
||||
}
|
||||
|
||||
TestRunner runner;
|
||||
RecordingReporter reporter;
|
||||
TestRunner runner;
|
||||
};
|
||||
|
||||
struct TestRunnerFixture : public FixtureBase
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue