Repository navigation
fix: decay decltype(Fn) in method::override for MSVC 19.52 - #149
Merged
Merged
Conversation
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<auto... Fn>` pack - spelled `f` or `&f` alike. A single `template<auto Fn>` 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<f>` 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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016fFU6iQPU1xuk7zqr2XGQx
|
An automated preview of the documentation is available at https://149.openmethod.prtest3.cppalliance.org/libs/openmethod/doc/html/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-11-26 21:41:12 UTC |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #149 +/- ##
========================================
Coverage 92.56% 92.57%
========================================
Files 29 29
Lines 2314 2316 +2
Branches 699 700 +1
========================================
+ Hits 2142 2144 +2
Misses 111 111
Partials 61 61
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
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.
(Written by Claude Code, on behalf of @jll63.)
The MSVC 14.5 CI jobs (VS 2026 runners, now on toolset 14.52 /
cl19.52.37029) fail with C2079 on the two troubleshooting examples that register a free function through the core API,fix_core_overrider_private_base.cppandfix_core_overrider_virtual.cpp:Cause
MSVC 19.52 gives
decltype(Fn)the function type rather than the pointer type for a function named without&in atemplate<auto... Fn>pack.override_auxis only defined forFnReturnType (*)(FnParameters...), sooverride<f>lands on the undefined primary template.Each case compiled in its own translation unit:
/std:c++17/permissive-or/std:c++20template<auto Fn>,ftemplate<auto... Fn>,ftemplate<auto... Fn>,&ftemplate<auto... Fn>, static memberS::gThis is not limited to the two examples. The CMake job stopped after 66 projects, before any
test_*.cpp; the b2 job, which keeps going, failed 144 compiles at C++17 (every test that passes a free function tooverride<>) and 616 each at C++20 andlatest, where/permissive-brings in the static member functions thatBOOST_OPENMETHOD_OVERRIDEregisters. So on 19.52 at C++20, every overrider fails to compile.Edit: earlier versions of this description, and the squashed commit message, got three things wrong: that
&fis affected (it failed only in a test program wherepack<f>had already instantiated the same specialization), that the macros escape because they register static member functions, and that other tests registering free functions still compile on 19.52. The b2 CI log above settles the last two.Fix
std::decay_t<decltype(Fn)>inmethod::overrideandmethod::inline_override.Tested
develop's headers, both examples still fail with the CI error.toolset=gcc): 258 passed, 0 failed.🤖 Generated with Claude Code
https://claude.ai/code/session_016fFU6iQPU1xuk7zqr2XGQx