1 /*
2  *  Created by Josh on 1/2/2018.
3  *  Copyright 2018 Two Blue Cubes Ltd. All rights reserved.
4  *
5  *  Distributed under the Boost Software License, Version 1.0. (See accompanying
6  *  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7  */
8 
9 #include "catch_compiler_capabilities.h"
10 #include "catch_uncaught_exceptions.h"
11 #include "catch_config_uncaught_exceptions.hpp"
12 
13 #include <exception>
14 
15 namespace Catch {
uncaught_exceptions()16     bool uncaught_exceptions() {
17 #if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
18         return false;
19 #elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
20         return std::uncaught_exceptions() > 0;
21 #else
22         return std::uncaught_exception();
23 #endif
24   }
25 } // end namespace Catch
26