From 13512729b9d861d8efbb5caf5aaa3fd0e2b0bf0c0cb61f98321efc6030c3e071 Mon Sep 17 00:00:00 2001 From: Luigi Baldoni Date: Tue, 1 Jun 2021 10:30:13 +0000 Subject: [PATCH] Accepting request 896630 from home:cgiboudeaux:branches:devel:tools - Add GCC 11 compatibility fix: * 0001-Fix-build-with-GCC-11.patch OBS-URL: https://build.opensuse.org/request/show/896630 OBS-URL: https://build.opensuse.org/package/show/devel:tools/doctest?expand=0&rev=13 --- 0001-Fix-build-with-GCC-11.patch | 40 ++++++++++++++++++++++++++++++++ doctest.changes | 6 +++++ doctest.spec | 7 ++++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 0001-Fix-build-with-GCC-11.patch diff --git a/0001-Fix-build-with-GCC-11.patch b/0001-Fix-build-with-GCC-11.patch new file mode 100644 index 0000000..e0bf566 --- /dev/null +++ b/0001-Fix-build-with-GCC-11.patch @@ -0,0 +1,40 @@ +From e0ff2bd492fd0dc4d25e6a507aa7d6766ce2da83 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= +Date: Mon, 17 May 2021 12:41:37 +0200 +Subject: [PATCH] Fix build with GCC 11 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 11 started warning about unused-but-set variables. Here's how it +fails: + + examples/all_features/stringification.cpp: In function ‘void _DOCTEST_ANON_FUNC_20()’: + examples/all_features/stringification.cpp:106:26: error: variable ‘bla2’ set but not used [-Werror=unused-but-set-variable] + 106 | MyTypeInherited bla2; + | ^~~~ + +I don't think that that assignment is actually doing anything; in fact, +there's that other variable which is assigned in a similar manner, but +that one is also used for an assert. +--- + examples/all_features/stringification.cpp | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/examples/all_features/stringification.cpp b/examples/all_features/stringification.cpp +index a8b5d5b..492e1ec 100644 +--- a/examples/all_features/stringification.cpp ++++ b/examples/all_features/stringification.cpp +@@ -103,9 +103,6 @@ TEST_CASE("all asserts should fail and show how the objects get stringified") { + MyTypeInherited bla1; + bla1.one = 5; + bla1.two = 4u; +- MyTypeInherited bla2; +- bla2.one = 5; +- bla2.two = 6u; + + Bar::Foo f1; + Bar::Foo f2; +-- +2.31.1 + diff --git a/doctest.changes b/doctest.changes index 520fe79..6df8dce 100644 --- a/doctest.changes +++ b/doctest.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jun 1 09:19:24 UTC 2021 - Christophe Giboudeaux + +- Add GCC 11 compatibility fix: + * 0001-Fix-build-with-GCC-11.patch + ------------------------------------------------------------------- Mon Mar 22 15:28:53 UTC 2021 - Martin Hauke diff --git a/doctest.spec b/doctest.spec index 75a4dff..88eb95b 100644 --- a/doctest.spec +++ b/doctest.spec @@ -23,6 +23,8 @@ Summary: Single-header testing framework License: MIT URL: http://bit.ly/doctest-docs Source0: https://github.com/onqtam/doctest/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM +Patch0: 0001-Fix-build-with-GCC-11.patch BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: pkgconfig @@ -37,11 +39,12 @@ Summary: Single-header testing framework C++98/C++11 single-header testing framework for unit tests and TDD. %prep -%autosetup +%autosetup -p1 + +%build # fix cmake module path sed -i 's|lib/cmake|%{_lib}/cmake|g' CMakeLists.txt -%build %cmake %cmake_build