[llvm-bugs] [Bug 44711] New: __reference_binds_to_temporary is missing binding an rvalue reference to a prvalue

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jan 29 14:26:14 PST 2020


            Bug ID: 44711
           Summary: __reference_binds_to_temporary is missing binding an
                    rvalue reference to a prvalue
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: barry.revzin at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk


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; }).

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200129/985aebd0/attachment.html>

More information about the llvm-bugs mailing list