From cf5db2ea98abf0509160eddbcd98e7f58121382a Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 15 Sep 2026 21:13:56 +0200 Subject: [PATCH] Remove dead unused-parameter casts from copy_metadata() @gregmarr asked whether the static_cast 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 --- include/nlohmann/json.hpp | 3 --- single_include/nlohmann/json.hpp | 3 --- 2 files changed, 6 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index fe496be01..301dc38b3 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -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(src); - static_cast(dst); #endif } diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 265322a96..937519fa5 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -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(src); - static_cast(dst); #endif }