Skip to content

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 into
mainfrom
dev/skopienko/fix_broken_tests_after_simd_min_element
Sep 21, 2026
Merged

SergeyKopienko merged 1 commit into
mainfrom
dev/skopienko/fix_broken_tests_after_simd_min_element

Conversation

@SergeyKopienko

@SergeyKopienko SergeyKopienko commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

In this PR we fix MSVC compile error C2580: 'TestUtils::ConstCopyOnlyCompare::ConstCopyOnlyCompare(const TestUtils::ConstCopyOnlyCompare &)': multiple versions of a defaulted special member functions are not allowed

It has been introduced in #2816

Link for [dcl.fct.def.default] : https://eel.is/c++draft/dcl.fct.def.default

…OnlyCompare::ConstCopyOnlyCompare(const TestUtils::ConstCopyOnlyCompare &)': multiple versions of a defaulted special member functions are not allowed
@SergeyKopienko SergeyKopienko added this to the 2022.15.0 milestone Sep 21, 2026
@SergeyKopienko SergeyKopienko self-assigned this Sep 21, 2026
@SergeyKopienko SergeyKopienko added the test Test only Change label Sep 21, 2026
@SergeyKopienko
SergeyKopienko requested a balanced review from Copilot September 21, 2026 12:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@SergeyKopienko SergeyKopienko changed the title Fix compile error in tests Fix compile error in tests on C++17 Sep 21, 2026
@SergeyKopienko SergeyKopienko changed the title Fix compile error in tests on C++17 Fix MSVC compile error in tests on C++17 Sep 21, 2026
@SergeyKopienko SergeyKopienko changed the title Fix MSVC compile error in tests on C++17 Fix MSVC compile error in tests on C++17 - multiple versions of a defaulted special member functions are not allowed Sep 21, 2026

@dmitriy-sobolev dmitriy-sobolev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

It looks like a workaround for a MSVC bug and not a c++ spec compliance issue in our code.

@SergeyKopienko
SergeyKopienko merged commit aaa67f2 into main Sep 21, 2026
28 checks passed
@SergeyKopienko
SergeyKopienko deleted the dev/skopienko/fix_broken_tests_after_simd_min_element branch September 21, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test Test only Change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants