Repository navigation
<ranges>: Fix C2382 when mixing #include <ranges> with import std; - #6436
Closed
zika (tycket033-tech) wants to merge 2 commits into
Closed
zika (tycket033-tech) wants to merge 2 commits into
zika (tycket033-tech) wants to merge 2 commits into
Conversation
_Zip_iterator_sentinel_equal's noexcept-specifier contains a fold expression, which the compiler fails to match as equivalent between the textually-included and module-imported declarations, emitting C2382. Extract it into a variable template so both declarations reference a simple name, which is trivially matched. Fixes microsoft#6121
This comment was marked as resolved.
This comment was marked as resolved.
<ranges>: Fix C2382 when mixing #include <ranges> with import std;
Stephan T. Lavavej (StephanTLavavej)
requested changes
Sep 24, 2026
…tes, cite DevCom-11148844 in TRANSITION comment
zika (tycket033-tech)
requested a review
from Stephan T. Lavavej (StephanTLavavej)
September 25, 2026 03:50
Member
|
Closing this workaround PR without merging as DevCom-11148844 (internal VSO-3061350) was fixed by internal MSVC-PR-780594 on 2026-09-14. (There's no point in merging a library workaround after the compiler has already been fixed.) This compiler fix will ship in the MSVC Build Tools 14.52 Preview very soon, and was merged just in time for 14.52 GA. Thanks for looking into this! |
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.
Fixes #6121
_Zip_iterator_sentinel_equalhas a fold expression in itsnoexcept-specifier. When a translation unit both#include <ranges>and does
import std;, the compiler fails to match the two declarationsas equivalent (C2382: redefinition; different exception specifications).
This extracts the fold expression into a variable template
_Zip_iterator_sentinel_equal_is_nothrow; both declarations thenreference a simple name + template arguments, which is trivially matched.