From 746765ef33df2fab96cf489ec423785c152239a6 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Thu, 3 Sep 2026 07:53:37 +0200 Subject: [PATCH] Silence VS2015's C4503 for the custom-base-class test The deep-copy support added for #5387 lengthened the mangled name of std::allocator_traits<...>::construct for the test's map type past VS2015's limit, which /WX turns into a build failure even though the name is only used for (now-truncated) debug info. Signed-off-by: Niels Lohmann --- tests/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4383b582c..670908c5f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -72,7 +72,12 @@ target_compile_options(test_main PUBLIC # is annotated JSON_HEDLEY_NO_RETURN (it always throws), which # makes MSVC flag the code following its call in binary_reader.hpp # as unreachable for that instantiation, in both Debug and Release - $<$:/W4;/wd4566;/wd4996;/wd4702> + # Disable warning C4503: decorated name length exceeded, name was truncated; the deep + # copy support added for #5387 pushes the mangled name of + # std::allocator_traits<...>::construct for the custom-base-class + # test's map type past VS2015's limit. The name is only used for + # debug info, so truncation does not affect the build. + $<$:/W4;/wd4566;/wd4996;/wd4702;/wd4503> # https://github.com/nlohmann/json/issues/1114 $<$:/bigobj> $<$:-Wa,-mbig-obj>