Repository: catchorg/Catch2
File: single_include/catch.hpp (C++)

Code before:
    bool MessageInfo::operator<( MessageInfo const& other ) const {
        return sequence < other.sequence;
    }

    // This may need protecting if threading support is added
    unsigned int MessageInfo::globalCount = 0;

    ////////////////////////////////////////////////////////////////////////////

    Catch::MessageBuilder::MessageBuilder( std::string const& macroName,
                                           SourceLineInfo const& lineInfo,
                                           ResultWas::OfType type )
        :m_info(macroName, lineInfo, type) {}

    ////////////////////////////////////////////////////////////////////////////

    ScopedMessage::ScopedMessage( MessageBuilder const& builder )
    : m_info( builder.m_info )
    {
        m_info.message = builder.m_stream.str();
        getResultCapture().pushScopedMessage( m_info );
    }

// https://github.com/catchorg/Catch2/issues/1162
#if __cplusplus == 201703L
using uncaught_exceptions = std::uncaught_exceptions
#else
using uncaught_exceptions = std::uncaught_exception
#endif
    ScopedMessage::~ScopedMessage() {
        if ( !uncaught_exceptions() ){
            getResultCapture().popScopedMessage(m_info);
        }
    }
} // end namespace Catch
// end catch_message.cpp
// start catch_random_number_generator.cpp

// start catch_random_number_generator.h

#include <algorithm>

namespace Catch {

    struct IConfig;

    void seedRng( IConfig const& config );

    unsigned int rngSeed();

    struct RandomNumberGenerator {

Review comment (suggestion):
1. redefining language identifiers is a bad idea (and this might lead to weird clashes). I would use `catch_uncaught_exceptions`
2. Try and centralise this in a header shared by all instead of defining it three times in a row.

Code after:
    bool MessageInfo::operator<( MessageInfo const& other ) const {
        return sequence < other.sequence;
    }

    // This may need protecting if threading support is added
    unsigned int MessageInfo::globalCount = 0;

    ////////////////////////////////////////////////////////////////////////////

    Catch::MessageBuilder::MessageBuilder( std::string const& macroName,
                                           SourceLineInfo const& lineInfo,
                                           ResultWas::OfType type )
        :m_info(macroName, lineInfo, type) {}

    ////////////////////////////////////////////////////////////////////////////

    ScopedMessage::ScopedMessage( MessageBuilder const& builder )
    : m_info( builder.m_info )
    {
        m_info.message = builder.m_stream.str();
        getResultCapture().pushScopedMessage( m_info );
    }

#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996) // std::uncaught_exception is deprecated in C++17
#endif
    ScopedMessage::~ScopedMessage() {
        if ( !std::uncaught_exception() ){
            getResultCapture().popScopedMessage(m_info);
        }
    }
#if defined(_MSC_VER)
#pragma warning(pop)
#endif

} // end namespace Catch
// end catch_message.cpp
// start catch_random_number_generator.cpp

// start catch_random_number_generator.h

#include <algorithm>

namespace Catch {

    struct IConfig;

    void seedRng( IConfig const& config );

    unsigned int rngSeed();