diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 64fb45c4c..d588dae74 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -2561,6 +2561,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec { auto ret = ValueType(); JSONSerializer::from_json(*this, ret); + // false positive: ret is returned by value, not its address + // @infer-ignore STACK_VARIABLE_ADDRESS_ESCAPE return ret; } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index db07ff1f9..bdfb3f0c8 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -29790,6 +29790,8 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec { auto ret = ValueType(); JSONSerializer::from_json(*this, ret); + // false positive: ret is returned by value, not its address + // @infer-ignore STACK_VARIABLE_ADDRESS_ESCAPE return ret; }