From 0a9ec38f44c06513ebd396b133b35ee970291d4e Mon Sep 17 00:00:00 2001 From: Remy Jette Date: Mon, 15 Mar 2021 17:30:58 -0700 Subject: [PATCH] Remove HEDLEY annotation from exception::what() The latest MSVC compiler throws the following warning on nlohmann::detail::exception::what() if /analyze is enabled: ``` vcruntime_exception.h(93) : warning C28204: 'what' has an override at `nlohmann\json\develop\single_include\nlohmann\json.hpp(2644)` and only the override is annotated for return: when an override is annotated, the base (this function) should be similarly annotated. ``` See https://godbolt.org/z/r331h4 --- include/nlohmann/detail/exceptions.hpp | 1 - single_include/nlohmann/json.hpp | 1 - 2 files changed, 2 deletions(-) diff --git a/include/nlohmann/detail/exceptions.hpp b/include/nlohmann/detail/exceptions.hpp index 5c9dce3c57..bd0534c438 100644 --- a/include/nlohmann/detail/exceptions.hpp +++ b/include/nlohmann/detail/exceptions.hpp @@ -49,7 +49,6 @@ class exception : public std::exception { public: /// returns the explanatory string - JSON_HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what(); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index a83971da21..d34b790056 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -2640,7 +2640,6 @@ class exception : public std::exception { public: /// returns the explanatory string - JSON_HEDLEY_RETURNS_NON_NULL const char* what() const noexcept override { return m.what();