mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-11-04 05:59:32 +01:00 
			
		
		
		
	Compatility fixes for GCC5 (#2448)
* GCC5 compat: work around inherited constructor issues
Don't use inherited constructors, forward manually instead. This
basically reverts 61f803126d.
I believe that GCC5 does not implement P0136, a C++17 change that made
inherited constructors actually usable and was backported as a DR all
the way to C++11.
* GCC5 compat: bypass std::pair construction issue
Co-authored-by: Martin Hořeňovský <martin.horenovsky@gmail.com>
			
			
This commit is contained in:
		@@ -126,7 +126,7 @@ namespace Catch {
 | 
				
			|||||||
                    return {};
 | 
					                    return {};
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                auto ret = kvPairs.emplace( kv.key, kv.value );
 | 
					                auto ret = kvPairs.emplace( std::string(kv.key), std::string(kv.value) );
 | 
				
			||||||
                if ( !ret.second ) {
 | 
					                if ( !ret.second ) {
 | 
				
			||||||
                    // Duplicated key. We might want to handle this differently,
 | 
					                    // Duplicated key. We might want to handle this differently,
 | 
				
			||||||
                    // e.g. by overwriting the existing value?
 | 
					                    // e.g. by overwriting the existing value?
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,9 @@
 | 
				
			|||||||
#ifndef CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
 | 
					#ifndef CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
 | 
				
			||||||
#define CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
 | 
					#define CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <catch2/interfaces/catch_interfaces_reporter.hpp>
 | 
				
			||||||
#include <catch2/reporters/catch_reporter_streaming_base.hpp>
 | 
					#include <catch2/reporters/catch_reporter_streaming_base.hpp>
 | 
				
			||||||
 | 
					#include <catch2/internal/catch_move_and_forward.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -16,7 +18,11 @@ namespace Catch {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    class AutomakeReporter final : public StreamingReporterBase {
 | 
					    class AutomakeReporter final : public StreamingReporterBase {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        using StreamingReporterBase::StreamingReporterBase;
 | 
					        // GCC5 compat: we cannot use inherited constructor, because it
 | 
				
			||||||
 | 
					        //              doesn't implement backport of P0136
 | 
				
			||||||
 | 
					        AutomakeReporter(ReporterConfig&& _config):
 | 
				
			||||||
 | 
					            StreamingReporterBase(CATCH_MOVE(_config))
 | 
				
			||||||
 | 
					        {}
 | 
				
			||||||
        ~AutomakeReporter() override;
 | 
					        ~AutomakeReporter() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        static std::string getDescription() {
 | 
					        static std::string getDescription() {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,9 @@
 | 
				
			|||||||
#ifndef CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
 | 
					#ifndef CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
 | 
				
			||||||
#define CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
 | 
					#define CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <catch2/interfaces/catch_interfaces_reporter.hpp>
 | 
				
			||||||
#include <catch2/reporters/catch_reporter_common_base.hpp>
 | 
					#include <catch2/reporters/catch_reporter_common_base.hpp>
 | 
				
			||||||
 | 
					#include <catch2/internal/catch_move_and_forward.hpp>
 | 
				
			||||||
#include <catch2/internal/catch_unique_ptr.hpp>
 | 
					#include <catch2/internal/catch_unique_ptr.hpp>
 | 
				
			||||||
#include <catch2/internal/catch_optional.hpp>
 | 
					#include <catch2/internal/catch_optional.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -88,7 +90,11 @@ namespace Catch {
 | 
				
			|||||||
        using TestCaseNode = Node<TestCaseStats, SectionNode>;
 | 
					        using TestCaseNode = Node<TestCaseStats, SectionNode>;
 | 
				
			||||||
        using TestRunNode = Node<TestRunStats, TestCaseNode>;
 | 
					        using TestRunNode = Node<TestRunStats, TestCaseNode>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        using ReporterBase::ReporterBase;
 | 
					        // GCC5 compat: we cannot use inherited constructor, because it
 | 
				
			||||||
 | 
					        //              doesn't implement backport of P0136
 | 
				
			||||||
 | 
					        CumulativeReporterBase(ReporterConfig&& _config):
 | 
				
			||||||
 | 
					            ReporterBase(CATCH_MOVE(_config))
 | 
				
			||||||
 | 
					        {}
 | 
				
			||||||
        ~CumulativeReporterBase() override;
 | 
					        ~CumulativeReporterBase() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        void benchmarkPreparing( StringRef ) override {}
 | 
					        void benchmarkPreparing( StringRef ) override {}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,7 +8,9 @@
 | 
				
			|||||||
#ifndef CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
 | 
					#ifndef CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
 | 
				
			||||||
#define CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
 | 
					#define CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <catch2/interfaces/catch_interfaces_reporter.hpp>
 | 
				
			||||||
#include <catch2/reporters/catch_reporter_common_base.hpp>
 | 
					#include <catch2/reporters/catch_reporter_common_base.hpp>
 | 
				
			||||||
 | 
					#include <catch2/internal/catch_move_and_forward.hpp>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <vector>
 | 
					#include <vector>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -16,7 +18,11 @@ namespace Catch {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    class StreamingReporterBase : public ReporterBase {
 | 
					    class StreamingReporterBase : public ReporterBase {
 | 
				
			||||||
    public:
 | 
					    public:
 | 
				
			||||||
        using ReporterBase::ReporterBase;
 | 
					        // GCC5 compat: we cannot use inherited constructor, because it
 | 
				
			||||||
 | 
					        //              doesn't implement backport of P0136
 | 
				
			||||||
 | 
					        StreamingReporterBase(ReporterConfig&& _config):
 | 
				
			||||||
 | 
					            ReporterBase(CATCH_MOVE(_config))
 | 
				
			||||||
 | 
					        {}
 | 
				
			||||||
        ~StreamingReporterBase() override;
 | 
					        ~StreamingReporterBase() override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        void benchmarkPreparing( StringRef ) override {}
 | 
					        void benchmarkPreparing( StringRef ) override {}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user