[llvm-bugs] [Bug 27375] New: tuple's "TupleLike" constructors behave slightly differently than standard versions

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Apr 15 11:33:15 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27375

            Bug ID: 27375
           Summary: tuple's "TupleLike" constructors behave slightly
                    differently than standard versions
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: eric at efcs.ca
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

Libc++ implements the two standard constructors 1) 'tuple(tuple<Up...> const&)'
and 2) 'tuple(tuple<Up...>&&)' as a single generic overload 'tuple(Tuple&&)'.
This can cause a slight differences in overload resolution.

For example the call to 'tuple(tuple<...>{})' will first consider ctor #2.
However if this constructor SFINAE's aware then ctor #1 should be considered.
Since libc++ only provides a single overload it will only consider #2. This
breaks the following code:

std::tuple<int&>(std::tuple<int&&>(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/20160415/6b3aab01/attachment.html>


More information about the llvm-bugs mailing list