mirror of
https://github.com/nlohmann/json.git
synced 2026-09-20 15:08:31 +00:00
Remove dead unused-parameter casts from copy_metadata()
@gregmarr asked whether the static_cast<void> pair in the JSON_DIAGNOSTIC_POSITIONS-off branch was needed for an empty json_base_class_t. It isn't: src and dst are already referenced unconditionally by the base-class copy above, so no -Wunused-parameter warning fires either way (checked with -Wall -Wextra -Wunused-parameter, JSON_DIAGNOSTIC_POSITIONS 0 and 1). Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
@@ -915,9 +915,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
#if JSON_DIAGNOSTIC_POSITIONS
|
||||
dst.start_position = src.start_position;
|
||||
dst.end_position = src.end_position;
|
||||
#else
|
||||
static_cast<void>(src);
|
||||
static_cast<void>(dst);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -24693,9 +24693,6 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
#if JSON_DIAGNOSTIC_POSITIONS
|
||||
dst.start_position = src.start_position;
|
||||
dst.end_position = src.end_position;
|
||||
#else
|
||||
static_cast<void>(src);
|
||||
static_cast<void>(dst);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user