Skip to content

Conversation

@AdamBucior
Copy link
Contributor

@AdamBucior AdamBucior commented Dec 17, 2019

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.

  • Identifiers in product code changes are properly _Ugly as per
    https://eel.is/c++draft/lex.name#3.1 or there are no product code changes.
  • The STL builds successfully and all tests have passed (must be manually
    verified by an STL maintainer before automated testing is enabled on GitHub,
    leave this unchecked for initial submission).
  • These changes introduce no known ABI breaks (adding members, renaming
    members, adding virtual functions, changing whether a type is an aggregate
    or trivially copyable, etc.).
  • These changes were written from scratch using only this repository,
    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.

@AdamBucior AdamBucior requested a review from a team as a code owner December 17, 2019 22:01
Copy link
Contributor

@CaseyCarter CaseyCarter left a 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>
@BillyONeal
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@BillyONeal BillyONeal self-assigned this Jan 8, 2020
@BillyONeal BillyONeal added the blocked Something is preventing work on this label Jan 9, 2020
@BillyONeal
Copy link
Member

This change is blocked by the libcxx test utilities\function.objects\refwrap\weak_result.pass.cpp which fails after the typedefs are removed. I think we need to submit a change adding // REQUIRES: c++98 || c++03 || c++11 || c++14 || c++17 to that test or similar, I'm figuring out how to do that.

@BillyONeal
Copy link
Member

Well that was fast. Thanks @tstellar ! llvm/llvm-project@85ee4ff

@BillyONeal BillyONeal removed the blocked Something is preventing work on this label Jan 9, 2020
…\refwrap\weak_result.pass.cpp, and exclude "// REQUIRES: c++98 || c++03 || c++11 || c++14 || c++17" as a 'magic comment'.
Copy link
Member

@StephanTLavavej StephanTLavavej left a 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
Copy link
Member

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.

@BillyONeal
Copy link
Member

Thanks for your contribution!

@BillyONeal BillyONeal merged commit d862650 into microsoft:master Jan 9, 2020
@BillyONeal BillyONeal mentioned this pull request Jan 9, 2020
7 tasks
@AdamBucior AdamBucior deleted the ref-wrapper-incomplete-types branch January 9, 2020 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P0357R3 Supporting Incomplete Types In reference_wrapper

4 participants