[lld] r211833 - Add const to sort() comparator function. Caught by gcc but not clang

Nick Kledzik kledzik at apple.com
Thu Jun 26 18:04:01 PDT 2014


Author: kledzik
Date: Thu Jun 26 20:04:01 2014
New Revision: 211833

URL: http://llvm.org/viewvc/llvm-project?rev=211833&view=rev
Log:
Add const to sort() comparator function.  Caught by gcc but not clang

Modified:
    lld/trunk/include/lld/Core/Simple.h

Modified: lld/trunk/include/lld/Core/Simple.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Core/Simple.h?rev=211833&r1=211832&r2=211833&view=diff
==============================================================================
--- lld/trunk/include/lld/Core/Simple.h (original)
+++ lld/trunk/include/lld/Core/Simple.h Thu Jun 26 20:04:01 2014
@@ -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)





More information about the llvm-commits mailing list