diff --git a/include/chaiscript/dispatchkit/dispatchkit.hpp b/include/chaiscript/dispatchkit/dispatchkit.hpp index 755db33..21e98ae 100644 --- a/include/chaiscript/dispatchkit/dispatchkit.hpp +++ b/include/chaiscript/dispatchkit/dispatchkit.hpp @@ -811,6 +811,12 @@ namespace chaiscript return false; } +#ifdef CHAISCRIPT_MSVC +// MSVC is unable to recognize that "rethrow_exception" causes the function to return +// so we must disable it here. +#pragma warning(push) +#pragma warning(disable : 4715) +#endif Boxed_Value call_member(const std::string &t_name, const std::vector ¶ms, bool t_has_params) const { const auto funs = get_function(t_name); @@ -887,6 +893,11 @@ namespace chaiscript } } } +#ifdef CHAISCRIPT_MSVC +#pragma warning(pop) +#endif + + Boxed_Value call_function(const std::string &t_name, const std::vector ¶ms) const { diff --git a/unittests/compiled_tests.cpp b/unittests/compiled_tests.cpp index 7001f85..df23c2f 100644 --- a/unittests/compiled_tests.cpp +++ b/unittests/compiled_tests.cpp @@ -1,9 +1,11 @@ // All of these are necessary because of catch.hpp. It's OK, they'll be // caught in other cpp files if chaiscript causes them +#include + #ifdef CHAISCRIPT_MSVC #pragma warning(push) -#pragma warning(disable : 4190 4640) +#pragma warning(disable : 4190 4640 28251) #endif #ifdef __GNUC__ @@ -24,7 +26,6 @@ #define CATCH_CONFIG_MAIN -#include #include "catch.hpp" // lambda_tests