diff --git a/tests/src/unit-json_view_edit_values.cpp b/tests/src/unit-json_view_edit_values.cpp index 39db8d0ba..881d957f8 100644 --- a/tests/src/unit-json_view_edit_values.cpp +++ b/tests/src/unit-json_view_edit_values.cpp @@ -54,14 +54,18 @@ int accepts_any(nlohmann::basic_json_view /*unused*/) return Mode == nlohmann::view_mode::editable ? 3 : 4; } -template -auto overload(View v) -> decltype(accepts_editable(v)) +// overloads that differ only in the mode; deduction ignores the conversion from +// read-only to editable views, so each view picks the overload of its own mode +// (two templates that differ only in a decltype return type are a redefinition +// for MSVC 2015) +template +int overload(nlohmann::basic_json_view v) { return accepts_editable(v); } -template -auto overload(View v) -> decltype(accepts_read_only(v)) +template +int overload(nlohmann::basic_json_view v) { return accepts_read_only(v); }