Enable __cpp_lib_concepts for EDG, part 1#4296
Merged
StephanTLavavej merged 39 commits intomicrosoft:mainfrom Feb 1, 2024
Merged
Enable __cpp_lib_concepts for EDG, part 1#4296StephanTLavavej merged 39 commits intomicrosoft:mainfrom
__cpp_lib_concepts for EDG, part 1#4296StephanTLavavej merged 39 commits intomicrosoft:mainfrom
Conversation
…alizations that differ only in the requires-clause
…rray to const reference to pointer
…_copy_assignable_type> to be trivially copy-assignable
…e makes EDG ignore subsequent members
… within a function template
…ization in a mem-initializer
…r the private members can be accessed in the current context
…citDefault> has wrong value
…rs, but it should not
…dle an array of std::string in debug mode
…ked too early in constrained constructor
…tional noexcept with friendship
… pack expansion, when the pack is empty
…c constraint depends on itself
50c5def to
c2f695c
Compare
This was referenced Jan 4, 2024
Contributor
|
Oh wow, this is amazing! Thanks! |
This comment was marked as resolved.
This comment was marked as resolved.
CaseyCarter
approved these changes
Jan 31, 2024
This comment was marked as resolved.
This comment was marked as resolved.
… propagate triviality of assignment operations".
Member
They were |
StephanTLavavej
approved these changes
Feb 1, 2024
Member
|
I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed. |
DevCom-10265237 "Parameter pack size mismatch doesn't make the require-expression false (regression)" is an MSVC bug. This preprocessor logic is guarding an additional constraint that MSVC needs, so I'm updating the `#endif` comment to "^^^ workaround ^^^". Previously, I believe this code was mentally saying, "we're in concepts code, so we only need to distinguish Clang from MSVC". This is no longer the case. Now we need `!defined(__clang__) && !defined(__EDG__)` to prevent EDG from using a workaround that it doesn't need.
DevCom-1691516 "std::vector::emplace_back does not work for a class with default initializer" is an MSVC bug. Curiously, this preprocessor logic was checking only `#ifdef __EDG__` to distinguish it from MSVC. (I think it might have been written before Clang supported construct_at()?) Instead, we need to check `#if defined(__clang__) || defined(__EDG__)` and send them to the "no workaround" case. This prevents Clang from using a workaround that it doesn't need.
Member
|
I've pushed additional commits:
I have comment cleanups for a followup PR but I didn't want to further randomize this one when it's so close to landing. |
StephanTLavavej
approved these changes
Feb 1, 2024
CaseyCarter
approved these changes
Feb 1, 2024
Member
😻 🎉 🐈 🚀 🍰Thank you @cpplearner and @CaseyCarter for the massive amount of work needed to get to this long-awaited day! |
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.
This PR makes
__cpp_lib_conceptsdefined in C++20 mode for all supported compilers, after adding workarounds for various EDG concepts bugs. I have opened two follow-up PRs for non-essential and largely mechanical clean-ups.__cpp_lib_conceptsfor EDG, part 2 #4297) replacesconcepts_20_matrixandconcepts_latest_matrixwithusual_20_matrixandusual_latest_matrixrespectively.__cpp_lib_conceptsfor EDG, part 3 #4298) replacesdefined(__cpp_lib_concepts)in preprocessing conditions with_HAS_CXX20, and then eliminates some of them where they are redundant.