Skip to content

Commit

Permalink
Merge pull request #14 from spineight/fixCatchByValueWarning
Browse files Browse the repository at this point in the history
Fixed warning: error: catching polymorphic type ‘class std::out_of_ra…
  • Loading branch information
nlohmann committed Apr 14, 2022
2 parents ece9457 + 80613a0 commit d732aaf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/unit.cpp
Expand Up @@ -59,13 +59,13 @@ TEST_CASE("element access")
CHECK(m.at("A") == 2);
CHECK(m.at("B") == 3);

CHECK_THROWS_AS(m.at("Z"), std::out_of_range);
CHECK_THROWS_AS(m.at("Z"), std::out_of_range&);

CHECK(mc.at("C") == 1);
CHECK(mc.at("A") == 2);
CHECK(mc.at("B") == 3);

CHECK_THROWS_AS(mc.at("Z"), std::out_of_range);
CHECK_THROWS_AS(mc.at("Z"), std::out_of_range&);
}

SECTION("operator[] (rvalue)")
Expand Down

0 comments on commit d732aaf

Please sign in to comment.