Fix MSVC compile error in tests on C++17 - multiple versions of a defaulted special member functions are not allowed - #2833
Merged
SergeyKopienko merged 1 commit intoSep 21, 2026
Conversation
…OnlyCompare::ConstCopyOnlyCompare(const TestUtils::ConstCopyOnlyCompare &)': multiple versions of a defaulted special member functions are not allowed
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused fix preserves the test utility’s intended behavior with no unresolved issues.
Review effort: Balanced
Findings: None
What changed in this PR
Fixes MSVC compile error C2580 by replacing defaulted copy operations with explicit implementations while preserving const-copy-only semantics.
Changes:
- Explicitly implements copy construction and assignment.
- Retains deleted non-const copy overloads.
| File | Description |
|---|---|
test/support/utils.h |
Updates ConstCopyOnlyCompare copy operations for compiler compatibility. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
MSVC compile error in tests on C++17
MSVC compile error in tests on C++17MSVC compile error in tests on C++17 - multiple versions of a defaulted special member functions are not allowed
dmitriy-sobolev
approved these changes
Sep 21, 2026
dmitriy-sobolev
left a comment
Contributor
There was a problem hiding this comment.
Looks good.
It looks like a workaround for a MSVC bug and not a c++ spec compliance issue in our code.
SergeyKopienko
deleted the
dev/skopienko/fix_broken_tests_after_simd_min_element
branch
September 21, 2026 13:31
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.
In this PR we fix
MSVCcompile errorC2580: 'TestUtils::ConstCopyOnlyCompare::ConstCopyOnlyCompare(const TestUtils::ConstCopyOnlyCompare &)': multiple versions of a defaulted special member functions are not allowedIt has been introduced in #2816
Link for [dcl.fct.def.default] : https://eel.is/c++draft/dcl.fct.def.default