[llvm-bugs] [Bug 31168] New: Relational operators for std::experimental::optional<T>

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Nov 26 16:37:05 PST 2016


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

            Bug ID: 31168
           Summary: Relational operators for
                    std::experimental::optional<T>
           Product: libc++
           Version: 3.9
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com
    Classification: Unclassified

Created attachment 17652
  --> https://llvm.org/bugs/attachment.cgi?id=17652&action=edit
Patch for optional<T> relational operators

N4606 requires that optional<T>::operator> be implemented in terms of
T::operator>, but right now libc++'s optional<T>::operator> is (incorrectly)
implemented in terms of T::operator< with the operands flipped.

This is important for types T that have only incomplete orderings: (x < y) may
not imply (y > x).

I've attached a patch that I think suffices to fix the issue, but I don't have
commit privileges.

-- 
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/20161127/daa87ebb/attachment.html>


More information about the llvm-bugs mailing list