mirror of
https://github.com/nlohmann/json.git
synced 2026-10-11 17:07:15 +00:00
Silence MSVC 2015 C4100 in parser::syntax_error for static SAX::parse_error
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
2 files changed
+4
No files matched your search
@@ -518,6 +518,8 @@ class parser
|
|||||||
template<typename SAX>
|
template<typename SAX>
|
||||||
bool syntax_error(SAX& sax, const std::string& message)
|
bool syntax_error(SAX& sax, const std::string& message)
|
||||||
{
|
{
|
||||||
|
// MSVC 2015 reports C4100 (unreferenced parameter) when SAX::parse_error is static
|
||||||
|
static_cast<void>(sax);
|
||||||
return sax.parse_error(m_lexer.get_position(), m_lexer.get_token_string(),
|
return sax.parse_error(m_lexer.get_position(), m_lexer.get_token_string(),
|
||||||
parse_error::create(exception_id::syntax_error, m_lexer.get_position(), message, nullptr));
|
parse_error::create(exception_id::syntax_error, m_lexer.get_position(), message, nullptr));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18818,6 +18818,8 @@ class parser
|
|||||||
template<typename SAX>
|
template<typename SAX>
|
||||||
bool syntax_error(SAX& sax, const std::string& message)
|
bool syntax_error(SAX& sax, const std::string& message)
|
||||||
{
|
{
|
||||||
|
// MSVC 2015 reports C4100 (unreferenced parameter) when SAX::parse_error is static
|
||||||
|
static_cast<void>(sax);
|
||||||
return sax.parse_error(m_lexer.get_position(), m_lexer.get_token_string(),
|
return sax.parse_error(m_lexer.get_position(), m_lexer.get_token_string(),
|
||||||
parse_error::create(exception_id::syntax_error, m_lexer.get_position(), message, nullptr));
|
parse_error::create(exception_id::syntax_error, m_lexer.get_position(), message, nullptr));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user