Repository navigation
Replace remaining std::invoke_result with decltype for MSVC 14.52 - #806
Open
clockblocker wants to merge 1 commit into
Open
clockblocker wants to merge 1 commit into
clockblocker wants to merge 1 commit into
Conversation
This was referenced Dec 2, 2026
…MSVC 14.52 (munich-data-engineering#805) Follow-up to upstream PR munich-data-engineering#794, which converted std::invoke_result_t sites to direct decltype expressions to work around MSVC 14.52 C3539 ('type': a template-argument cannot be a type that contains 'auto'), but missed the remaining typename std::invoke_result<...>::type sites. - Convert field_names_t.hpp (directly hit by rfl::json::read<T> in munich-data-engineering#805) and drop its unused <functional> include. - Convert internal/field_tuple_t.hpp, internal/Field.hpp, internal/flattened_ptr_tuple_t.hpp, and internal/move_from_named_tuple.hpp (also resolving the overloaded nt_to_ptr_named_tuple<T>(std::declval<T&>()) call). - Convert the remaining 3 std::invoke_result<F, T>::type sites in internal/cpp20/Result.hpp and harmonize transform && to decltype(_f(...)) so all 4 monadic overloads match the actual call expression and const&/&& value category.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #805
Problem
MSVC 14.52 rejects basic
rfl::json::read<T>()withC3539whenstd::invoke_resultreceives a function template with a deducedautoreturn type.PR #794 replaced the
std::invoke_result_tsites withdecltype(...), but missed six headers still usingstd::invoke_result<...>::type—includingfield_names_t, which every struct read hits.Summary
std::invoke_result<...>::typesites with directdecltype(...)call expressions (leaving zerostd::invoke_resultuses in public or internal headers) and drops an unused<functional>include.move_from_named_tuple.hppand brings all fourcpp20::Resultmonadic overloads onto the samedecltype(_f(...))pattern.Testing
-Wall -Wextra -Wextra-semi -Werror, C++20,REFLECTCPP_C_ARRAYS_OR_INHERITANCE, and C++23std::expected) on Clang 23 and GCC 13, plus standalone regression tests inclockblocker/refl-cpp-workbench/queue-tests/json/test_invoke_result_decltype.cppcovering the#805reproducer, cv-ref trait aliases, move-only flattenedNamedTuple, and all fourResult::and_then/transformoverloads (kept out of the PR diff to keep it minimal; happy to pull them in if preferred).