Add const to sort() comparator function. Caught by gcc but not clang
authorNick Kledzik <kledzik@apple.com>
Fri, 27 Jun 2014 01:04:01 +0000 (01:04 +0000)
committerNick Kledzik <kledzik@apple.com>
Fri, 27 Jun 2014 01:04:01 +0000 (01:04 +0000)
llvm-svn: 211833

lld/include/lld/Core/Simple.h

index ad041b6..307f454 100644 (file)
@@ -174,7 +174,7 @@ public:
   /// Sort references in a canonical order (by offset, then by kind).
   void sortReferences() const {
     std::sort(_references.begin(), _references.end(),
-        [] (SimpleReference &lhs, SimpleReference &rhs) -> bool {
+        [] (const SimpleReference &lhs, const SimpleReference &rhs) -> bool {
           uint64_t lhsOffset = lhs.offsetInAtom();
           uint64_t rhsOffset = rhs.offsetInAtom();
           if (rhsOffset != lhsOffset)