diff options
author | Thomas Anderson <thomasanderson@google.com> | 2019-04-15 17:02:15 +0000 |
---|---|---|
committer | Thomas Anderson <thomasanderson@google.com> | 2019-04-15 17:02:15 +0000 |
commit | 3c3ccc0049506c917632f901560e10280d70e729 (patch) | |
tree | 4a9f473f1c04bbc182614c9f67576a0a28af39c3 /llvm/lib/Support/CommandLine.cpp | |
parent | 09e539fcaebb6362795d352cdcf4a818cf4d0d6a (diff) | |
download | llvm-3c3ccc0049506c917632f901560e10280d70e729.zip llvm-3c3ccc0049506c917632f901560e10280d70e729.tar.gz llvm-3c3ccc0049506c917632f901560e10280d70e729.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Support/CommandLine.cpp')
0 files changed, 0 insertions, 0 deletions