[PATCH] PR10140 - StringPool's PooledStringPtr has non-const operator== causing bad OR-result

Nikola Smiljanić popizdeh at gmail.com
Wed Jun 18 06:23:35 PDT 2014


Hi chandlerc,

http://reviews.llvm.org/D4194

Files:
  include/llvm/Support/StringPool.h

Index: include/llvm/Support/StringPool.h
===================================================================
--- include/llvm/Support/StringPool.h
+++ include/llvm/Support/StringPool.h
@@ -130,8 +130,12 @@
     inline const char *operator*() const { return begin(); }
     inline 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4194.10562.patch
Type: text/x-patch
Size: 722 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140618/9cbb59d2/attachment.bin>


More information about the llvm-commits mailing list