From 2debf74f8ce1246a824f6db8e36576babb0f061f Mon Sep 17 00:00:00 2001 From: Jean-Louis Leroy Date: Thu, 26 Nov 2026 16:31:53 -0500 Subject: [PATCH] fix: decay decltype(Fn) in method::override for MSVC 19.52 MSVC 19.52 (VS 2026, toolset 14.52) gives `decltype(Fn)` the function type, not the pointer type, when `Fn` is a free function passed through a `template` pack - spelled `f` or `&f` alike. A single `template` and static member functions are unaffected, and 19.51, gcc and clang all give the pointer type. override_aux is only defined for `FnReturnType (*)(FnParameters...)`, so `override` fell back to the undefined primary template: preamble.hpp(1031): error C2079: 'tuple_element<...override_aux< void postfix_minus(...), void (...), false>>::element' uses undefined struct It broke the troubleshooting examples that register a free function through the core API (fix_core_overrider_private_base.cpp and fix_core_overrider_virtual.cpp) on every MSVC 14.5 CI job. The macros register static member functions, which is why nothing else failed. Decay the type in override and inline_override. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016fFU6iQPU1xuk7zqr2XGQx --- include/boost/openmethod/core.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/include/boost/openmethod/core.hpp b/include/boost/openmethod/core.hpp index 8276f7dc..9edd2036 100644 --- a/include/boost/openmethod/core.hpp +++ b/include/boost/openmethod/core.hpp @@ -2800,10 +2800,13 @@ class method : //! @tparam Fn One or more functions to the overrider list template class override { + // decay_t: MSVC 19.52 gives `decltype(Fn)` for a free function in an + // auto parameter pack the function type rather than the pointer type, + // which does not match override_aux's partial specialization. boost::mp11::mp_apply< detail::tuple, - boost::mp11::mp_unique< - boost::mp11::mp_list...>>> + boost::mp11::mp_unique, false>...>>> impl; }; @@ -2829,10 +2832,11 @@ class method : // right time. template class inline_override { + // decay_t: see override. boost::mp11::mp_apply< detail::tuple, - boost::mp11::mp_unique< - boost::mp11::mp_list...>>> + boost::mp11::mp_unique, true>...>>> impl; };