Files
unittest-cpp/unittest-cpp-2.0.0-gcc12.patch
Takashi Iwai 7df3be05a6 Accepting request 999689 from home:1Antoine1:branches:multimedia:libs
- Add unittest-cpp-2.0.0-gcc12.patch: Fix build with GCC 12.
- Remove unittest-cpp-2.0.0.tar.xz: It is created at build time
  from obscpio.
- Remove unused project.diff.
- Refresh spec file.

Note: Something weird happened in revision 5 (https://build.opensuse.org/package/rdiff/multimedia:libs/unittest-cpp?linkrev=base&rev=5): spec and changes files were removed. I restored the spec and the changes files as I found them in openSUSE:Factory before applying my changes.

OBS-URL: https://build.opensuse.org/request/show/999689
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/unittest-cpp?expand=0&rev=7
2022-08-30 05:20:09 +00:00

38 lines
1.3 KiB
Diff

From f361c2a1034c02ba8059648f9a04662d6e2b5553 Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyich@gmail.com>
Date: Tue, 23 Nov 2021 08:44:06 +0000
Subject: [PATCH] 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.
---
tests/TestTestRunner.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/TestTestRunner.cpp b/tests/TestTestRunner.cpp
index 86c672d..eb7a918 100644
--- a/tests/TestTestRunner.cpp
+++ b/tests/TestTestRunner.cpp
@@ -60,8 +60,8 @@ namespace
return result;
}
- TestRunner runner;
RecordingReporter reporter;
+ TestRunner runner;
};
struct TestRunnerFixture : public FixtureBase