Skip to content

__reference_binds_to_temporary is missing binding an rvalue reference to a prvalue #44056

@llvmbot

Description

@llvmbot
Bugzilla Link 44711
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

This:

static_assert(__reference_binds_to_temporary(int&&, int));

Fails, the implementation doesn't consider this to be a reference binding to a temporary (the implementation is in terms of isDirectReferenceBinding).

While this particular case isn't important for std::tuple (where we'll have already materialized the temporary on the constructor boundary, so the right-hand side would be int&& already), it is important for the INVOKE<R> machinery -- where we might want to reject std::function<int&&()>([]{ return 42; }).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second party

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions