Skip to content

Commit 489a07a

Browse files
committed
Update JSON for Modern C++ version 3.10.2
Note that JSON for Modern C++ now uses the following attribute on the parse() function: __attribute__((__warn_unused_result__)) While Clang allows using an explicit cast to (void) to ignore the result of this invocation, GCC does not. The result must be stored, and then the result can be ignored.
1 parent 89dd9b2 commit 489a07a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bench/json/benchmark_json.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ class NLohmannJsonParser : public JsonParserBase
6666
void parse(const std::filesystem::path &path) override
6767
{
6868
std::ifstream stream(path);
69-
FLY_UNUSED(nlohmann::json::parse(stream));
69+
auto ignored = nlohmann::json::parse(stream);
70+
FLY_UNUSED(ignored);
7071
}
7172
};
7273

extern/nlohmann/json

Submodule json updated 368 files

0 commit comments

Comments
 (0)