summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNikola Smiljanic <popizdeh@gmail.com>2014-06-19 00:26:49 +0000
committerNikola Smiljanic <popizdeh@gmail.com>2014-06-19 00:26:49 +0000
commit1260b844fd71720566eabd4cc5738f2abe747871 (patch)
treeb32fc7b9c50633711f0dca708780174daa5c9ccb /include
parent887a5c7f5da73ada835985d1f9552ff1716517a7 (diff)
downloadllvm-1260b844fd71720566eabd4cc5738f2abe747871.tar.gz
llvm-1260b844fd71720566eabd4cc5738f2abe747871.tar.bz2
llvm-1260b844fd71720566eabd4cc5738f2abe747871.tar.xz
PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad OR-result.
Mark conversion operator explicit and const qualify comparison operators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211244 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/StringPool.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/llvm/Support/StringPool.h b/include/llvm/Support/StringPool.h
index 7e1394cb23..7306ce2240 100644
--- a/include/llvm/Support/StringPool.h
+++ b/include/llvm/Support/StringPool.h
@@ -128,10 +128,10 @@ namespace llvm {
}
inline const char *operator*() const { return begin(); }
- inline operator bool() const { return S != nullptr; }
+ inline explicit operator bool() const { return S != nullptr; }
- inline bool operator==(const PooledStringPtr &That) { return S == That.S; }
- inline bool operator!=(const PooledStringPtr &That) { return S != That.S; }
+ inline bool operator==(const PooledStringPtr &That) const { return S == That.S; }
+ inline bool operator!=(const PooledStringPtr &That) const { return S != That.S; }
};
} // End llvm namespace