[llvm] r182713 - Disable the StringMapEntry copy constructor, to make sure we

Chris Lattner sabre at nondot.org
Sat May 25 15:28:22 PDT 2013


Author: lattner
Date: Sat May 25 17:28:22 2013
New Revision: 182713

URL: http://llvm.org/viewvc/llvm-project?rev=182713&view=rev
Log:
Disable the StringMapEntry copy constructor, to make sure we
reject things like: "for (auto Entry : SomeStringMap)".  Previously
this would copy the value but not the tail allocated string data
(the key).

Modified:
    llvm/trunk/include/llvm/ADT/StringMap.h

Modified: llvm/trunk/include/llvm/ADT/StringMap.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringMap.h?rev=182713&r1=182712&r2=182713&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringMap.h (original)
+++ llvm/trunk/include/llvm/ADT/StringMap.h Sat May 25 17:28:22 2013
@@ -116,6 +116,7 @@ public:
 /// and data.
 template<typename ValueTy>
 class StringMapEntry : public StringMapEntryBase {
+  StringMapEntry(StringMapEntry &E) LLVM_DELETED_FUNCTION;
 public:
   ValueTy second;
 





More information about the llvm-commits mailing list