-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support For Incomplete Types In reference_wrapper #393
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
Support For Incomplete Types In reference_wrapper #393
Conversation
CaseyCarter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks fine to me; I'm sure we'll have some test fallout to fix in addition to adding some incomplete type coverage.
Co-Authored-By: Casey Carter <cartec69@gmail.com>
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
This change is blocked by the libcxx test |
|
Well that was fast. Thanks @tstellar ! llvm/llvm-project@85ee4ff |
…\refwrap\weak_result.pass.cpp, and exclude "// REQUIRES: c++98 || c++03 || c++11 || c++14 || c++17" as a 'magic comment'.
StephanTLavavej
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, this looks good!
| class reference_wrapper : public _Weak_types<_Ty>::type { // stand-in for an assignable reference | ||
| class reference_wrapper | ||
| #if !_HAS_CXX20 | ||
| : public _Weak_types<_Ty>::type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a design question here, because we haven't yet merged #380 to implement #28 (WG21-P0619 Removing C++17-Deprecated Features In C++20). Specifically, an escape hatch to restore reference_wrapper's weak result type is incompatible with supporting incomplete types. There are two possible decisions: allow reference_wrapper to be affected by such an escape hatch (thereby disabling support for incomplete types), or exempt reference_wrapper from the escape hatch (so C++20 mode always activates support for incomplete types).
It's not a big deal because reference_wrapper's support for weak result types is extremely obscure. I am inclined to accept the code as-is, meaning that C++20 mode always makes reference_wrapper support incomplete types and removes its weak result type, even if weak result types have otherwise been escape-hatched.
|
Thanks for your contribution! |
Description
Resolves #14.
Checklist
Be sure you've read README.md and understand the scope of this repo.
If you're unsure about a box, leave it unchecked. A maintainer will help you.
_Uglyas perhttps://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
verified by an STL maintainer before automated testing is enabled on GitHub,
leave this unchecked for initial submission).
members, adding virtual functions, changing whether a type is an aggregate
or trivially copyable, etc.).
the C++ Working Draft (including any cited standards), other WG21 papers
(excluding reference implementations outside of proposed standard wording),
and LWG issues as reference material. If they were derived from a project
that's already listed in NOTICE.txt, that's fine, but please mention it.
If they were derived from any other project (including Boost and libc++,
which are not yet listed in NOTICE.txt), you must mention it here,
so we can determine whether the license is compatible and what else needs
to be done.