]> granicus.if.org Git - clang/commitdiff
Add const qualifier on FieldChainInfoComparator::operator()
authorSteven Wu <stevenwu@apple.com>
Fri, 22 Jun 2018 16:51:17 +0000 (16:51 +0000)
committerSteven Wu <stevenwu@apple.com>
Fri, 22 Jun 2018 16:51:17 +0000 (16:51 +0000)
libcxx has user defined warning to check for non const call operator.
Silence the warning by adding the const on operator().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@335366 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/UninitializedObjectChecker.cpp

index a517e81122b1fb74a3baa55c082c8e7d7698786d..d9168d037e1588f01a84e729bd50f40b18bcf75d 100644 (file)
@@ -85,7 +85,7 @@ private:
 };
 
 struct FieldChainInfoComparator {
-  bool operator()(const FieldChainInfo &lhs, const FieldChainInfo &rhs) {
+  bool operator()(const FieldChainInfo &lhs, const FieldChainInfo &rhs) const {
     assert(!lhs.Chain.isEmpty() && !rhs.Chain.isEmpty() &&
            "Attempted to store an empty fieldchain!");
     return *lhs.Chain.begin() < *rhs.Chain.begin();