Skip to content

[libc++] std::optional<T&> non-conformance issues #174350

Description

@smallp-o-p

Godbolt example

The following functions when used on optional<T&> of && fail to compile:

value();
operator*();
and_then();
transform();
  • For value() and operator*() it appears that the && and const && return the wrong type.
  • and_then() and transform() issues seem related to the above
  • It appears there is missing test coverage for this too.
  • Also operator-> is wrong.

Obviously, since I'm the one that provided this implementation (apologies!), I'll work on fixing it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions