Skip to content

Fix task callback alias for older MSVC - #4

Merged
sean-parent merged 1 commit into
mainfrom
fix-msvc-task-noexcept
Nov 3, 2026
Merged

sean-parent merged 1 commit into
mainfrom
fix-msvc-task-noexcept

Conversation

@sean-parent

Copy link
Copy Markdown
Member

Summary

  • Replace the dependent noexcept(NoExcept) function-pointer alias with std::conditional_t selecting explicit throwing and non-throwing pointer types.
  • Preserve callback signatures, exception specifications, and task storage layout without adding runtime work.
  • Add contract tests for exact callback and relocation_invoke() return types, reference results, arguments, and exception propagation.

Fixes stlab/stlab#614.

Test plan

Fresh local validation on Windows x64; no validation cache was reused:

  • clang-format --dry-run --Werror include\stlab\concurrency\task.hpp test\task_contract_test.cpp and git diff --check.
  • MSVC 19.51: cmake --preset=test, cmake --build --preset=test, ctest --preset=test --no-tests=error: 26/26 passed.
  • MSVC 19.42, native C++17 DLL: cmake --preset=test -B build\msvc1942-cpp17-shared -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=ON, matching build, and CTest with --no-tests=error: 23/23 passed.
  • MSVC 19.42, portable C++20 DLL: cmake --preset=test -B build\msvc1942-cpp20-portable-shared -DSTLAB_TASK_SYSTEM=portable -DBUILD_SHARED_LIBS=ON, matching build, and CTest with --no-tests=error: 23/23 passed.
  • MSVC 19.42: cmake --preset=clang-tidy, cmake --build --preset=clang-tidy, ctest --preset=clang-tidy --no-tests=error: build succeeded and 26/26 passed. Existing lint diagnostics remain outside the changed lines, including modernization/include-cleaner checks, an executor-base stack-address analyzer warning, and a timer-test dead store; this is not a warning-free lint result.
  • Before the fix, MSVC 19.42 reproduced C2065/C2664 and the new callback type assertion failed. After the fix, the same task target built and passed. The original MSVC 19.42 C++20 static suite also passed 26/26.
  • Repository CI: Linux GCC/Clang, macOS, Windows, installation/find_package checks, and Ubuntu clang-tidy.

MSVC 19.44 and UWP were not available for local verification. STLab's dependency pin is unchanged; it will need a fixed execution release separately. Documentation deployment is release-only and does not apply to this PR.

Generated with GitHub Copilot CLI

Select explicit throwing and non-throwing callback types with std::conditional_t to avoid MSVC's dependent noexcept alias bug. Test callback signatures, reference results, and exception propagation.

Fixes stlab/stlab#614

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@sean-parent sean-parent left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Talos review complete

Verdict: no accepted findings in the alias change or the two new regression tests. Reviewed commit c04bdeb7d0be6ed6067ae56cb37040a381491e5c, full PR diff against main (merge base 4ea38c3001789f2b242e5a220e8fc316cdd9b8c0).

Six independent personas reviewed security, correctness, standards, architecture, operations, and documentation. The challenge reviewer rejected the single standards candidate requesting an inline workaround comment: no applicable repository rule requires it, the commit records the MSVC defect and issue reference, and the added type assertions detect a regression. No correctness or test defect was reported.

Files Reviewers Candidates → validated → accepted Posted Tests
2 of 2 6 personas plus challenge 1 → 1 → 0 0 inline findings; 0 overflow Existing exact-snapshot local validation: 98 CTest entries passed across default C++20, C++17 native DLL, C++20 portable DLL, and clang-tidy builds; formatting passed. No tests were rerun solely for this review.

Both include/stlab/concurrency/task.hpp and test/task_contract_test.cpp were reviewed, including exact throwing/non-throwing callback types, relocation_invoke() return types, reference results, arguments, and exception propagation. Scout's Must Run test files, test/task_contract_test.cpp and test/executor_abi_test.cpp, were covered by the prior local suites. CI reports success for Ubuntu GCC, Ubuntu Clang, macOS, Windows, and clang-tidy at this head; release-only docs were skipped.

Coverage limitations: the operations reviewer read the implementation and tests but did not inspect its supplemental custom-instruction artifact or Scout packet/leads; other personas and the challenge reviewer consumed the applicable rule context. MSVC 19.44, UWP, and Emscripten were not tested locally. Existing lint warnings remain outside the changed lines. No files were skipped. No approval was submitted.

Project context: CLAUDE.md and the repository-wide .github/copilot-instructions.md at the merge base; no additional rule files or active OpenSpec changes were found. GitHub instruction matching loaded one file for both changed paths without diagnostics.

Persona routing: static roster (DCAP routing off; rerun with --dcap to enable).

Org knowledge: off (rerun with --knowledge).

Scout

Used: risk MEDIUM, evidence HIGH, status COMPLETE (scout 0.9.133, <1s).
Cross-file leads given to reviewers: 3 changed symbol(s) with uses outside the diff, 0 new value(s) not handled everywhere, 0 possibly unused symbol(s).

Tests to run (Scout: 4 Must Run test(s), in these files):

  • test/task_contract_test.cpp
  • test/executor_abi_test.cpp
    Scout also lists 12 Should Run test(s).

Generated with GitHub Copilot CLI

@sean-parent
sean-parent merged commit 4d97dca into main Nov 3, 2026
6 checks passed
@sean-parent
sean-parent deleted the fix-msvc-task-noexcept branch November 3, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MSVC 19.44 rejects task's dependent noexcept function-pointer alias

1 participant