mirror of
https://github.com/nlohmann/json.git
synced 2026-02-28 06:16:24 +00:00
🚑 fix regression from #2181
This commit is contained in:
@@ -1945,6 +1945,15 @@ TEST_CASE("regression tests")
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
SECTION("PR #2181 - regression bug with lvalue")
|
||||
{
|
||||
// see https://github.com/nlohmann/json/pull/2181#issuecomment-653326060
|
||||
json j{{"x", "test"}};
|
||||
std::string defval = "default value";
|
||||
auto val = j.value("x", defval);
|
||||
auto val2 = j.value("y", defval);
|
||||
}
|
||||
}
|
||||
|
||||
#if not defined(JSON_NOEXCEPTION)
|
||||
|
||||
Reference in New Issue
Block a user