mirror of
https://github.com/nlohmann/json.git
synced 2026-10-07 06:57:14 +00:00
Fix CI: do not hide base class methods in the #3989 test SAX parsers
clang-tidy's bugprone-derived-method-shadowing-base-method rejected the test SAX parsers that derive from json_sax_dom_parser (or the test's SaxEventLogger) and redefine their non-virtual event functions. The recovering DOM parsers of unit-class_parser.cpp and unit-regression2.cpp now hold a json_sax_dom_parser and forward to it, SaxEventLogger gets a flag to recover from errors instead of a derived class, and the one function unit-alt-string.cpp redefines is marked as intended. Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
3 files changed
+47
-45
No files matched your search
@@ -384,6 +384,9 @@ TEST_CASE("alternative string type")
|
||||
: nlohmann::detail::json_sax_dom_parser<alt_json>(j, false)
|
||||
{}
|
||||
|
||||
// sax_parse() calls the SAX parser's own parse_error(), so hiding
|
||||
// the one of the base class is what recovering takes
|
||||
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
|
||||
bool parse_error(std::size_t /*unused*/, const std::string& /*unused*/, const nlohmann::detail::exception& /*unused*/)
|
||||
{
|
||||
++errors;
|
||||
|
||||
Reference in new issue
Block a user