Skip to content

Commit

Permalink
Fix build with CATCH_CONFIG_DISABLE_EXCEPTIONS enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
khyperia authored and horenmar committed Apr 21, 2020
1 parent 4e41714 commit e59fc2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/internal/catch_assertionhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "catch_interfaces_registry_hub.h"
#include "catch_capture_matchers.h"
#include "catch_run_context.h"
#include "catch_enforce.h"

namespace Catch {

Expand Down
4 changes: 4 additions & 0 deletions include/internal/catch_interfaces_exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ namespace Catch {
{}

std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
return "";
#else
try {
if( it == itEnd )
std::rethrow_exception(std::current_exception());
Expand All @@ -55,6 +58,7 @@ namespace Catch {
catch( T& ex ) {
return m_translateFunction( ex );
}
#endif
}

protected:
Expand Down

0 comments on commit e59fc2c

Please sign in to comment.