Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround for the interaction of constraints in expected and explicit template instantiation in permissive modes #4658

Conversation

frederick-vs-ja
Copy link
Contributor

@frederick-vs-ja frederick-vs-ja commented May 6, 2024

Fixes #4657. Works around DevCom-10652420, which is closed as Not a Bug. Works around /permissive-.

  • In <expected>, check is_swappable as is_swappable_v can be buggy in permissive modes.
  • In <iterator>, avoid instantiation of contiguous_iterator for istreambuf_iterator and ostreambuf_iterator, which are instantiated in locale facets.

Also adds test coverage for expected in permissive modes.

- In `<expected>`, check `is_swappable` as `is_swappable_v` can be
buggy in permissive modes.
- In `<iterator>`, avoid instantiation of `contiguous_iterator`
for `istreambuf_iterator` and `ostreambuf_iterator`, which are
instantiated in locale facets.

Also adds test coverage for `expected` in permissive modes.
@frederick-vs-ja frederick-vs-ja requested a review from a team as a code owner May 6, 2024 16:59
@StephanTLavavej StephanTLavavej added the bug Something isn't working label May 7, 2024
@StephanTLavavej StephanTLavavej self-assigned this May 7, 2024
stl/inc/expected Outdated Show resolved Hide resolved
stl/inc/expected Outdated Show resolved Hide resolved
stl/inc/iterator Outdated Show resolved Hide resolved
@StephanTLavavej
Copy link
Member

Thanks - a good workaround for a disgusting mode! 🤮 😹

I explored whether requires requires { MEOW.swap(PURR); } would help by itself, but it doesn't - possibly workarounds would need to be added to member swap in that case. I didn't care enough, so I abandoned the attempt for now.

@StephanTLavavej StephanTLavavej removed their assignment May 15, 2024
@StephanTLavavej StephanTLavavej self-assigned this May 17, 2024
@StephanTLavavej
Copy link
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit 3058972 into microsoft:main May 20, 2024
39 checks passed
@StephanTLavavej
Copy link
Member

Thanks again for investigating and fixing this bug! 🛠️ 🚀 🐞

@frederick-vs-ja frederick-vs-ja deleted the workaround-permissive-constraints branch May 20, 2024 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

<expected> in permissive mode: error C7608: atomic constraint should be a constant expression
4 participants