From f030da5ccd08fd552b62d0c68eeddb2ac0b2ac1a Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Tue, 14 Feb 2017 15:33:07 -0800 Subject: [PATCH] [core] Add noexcept(false) in MBGL_CHECK_ERROR C++11 destructors are noexcept by default, so the prior definition always called std::terminate without allowing anything to catch the exception. --- include/mbgl/gl/gl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/mbgl/gl/gl.hpp b/include/mbgl/gl/gl.hpp index 425f78bcb..7521b4c80 100644 --- a/include/mbgl/gl/gl.hpp +++ b/include/mbgl/gl/gl.hpp @@ -41,7 +41,7 @@ struct Error : std::runtime_error { void checkError(const char *cmd, const char *file, int line); #ifndef NDEBUG -#define MBGL_CHECK_ERROR(cmd) ([&]() { struct __MBGL_C_E { ~__MBGL_C_E() { ::mbgl::gl::checkError(#cmd, __FILE__, __LINE__); } } __MBGL_C_E; return cmd; }()) +#define MBGL_CHECK_ERROR(cmd) ([&]() { struct __MBGL_C_E { ~__MBGL_C_E() noexcept(false) { ::mbgl::gl::checkError(#cmd, __FILE__, __LINE__); } } __MBGL_C_E; return cmd; }()) #else #define MBGL_CHECK_ERROR(cmd) (cmd) #endif