Skip to content
Commit 3c3ccc00 authored by Thomas Anderson's avatar Thomas Anderson
Browse files

[libc++] Fix build failure with _LIBCPP_DEBUG=0 when iterators return values instead of references

There are many STL algorithms (such as lexicographical_compare) that compare
values pointed to by iterators like so:
    __comp(*it1, *it2);
	
When building with `_LIBCPP_DEBUG=0`, comparators are wrapped in `__debug_less`
which does some additional validation.  But `__debug_less::operator()` takes
non-const references, so if the type of `*it1` is int, not int&, then the build
will fail.

This change adds a `const&` overload for `operator()` to fix the build.

Differential Revision: https://reviews.llvm.org/D60592

llvm-svn: 358423
parent 09e539fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment