Add missing const to StringRef.copy()
authorNick Kledzik <kledzik@apple.com>
Sat, 30 Aug 2014 02:29:49 +0000 (02:29 +0000)
committerNick Kledzik <kledzik@apple.com>
Sat, 30 Aug 2014 02:29:49 +0000 (02:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216811 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringRef.h

index 390e7f718a5b3b9960dfb492ae76746753a7a0b0..f1861c8f92bce2351a166de176b5bdf55c6d3647 100644 (file)
@@ -118,7 +118,7 @@ namespace llvm {
     }
 
     // copy - Allocate copy in Allocator and return StringRef to it.
-    template <typename Allocator> StringRef copy(Allocator &A) {
+    template <typename Allocator> StringRef copy(Allocator &A) const {
       char *S = A.template Allocate<char>(Length);
       std::copy(begin(), end(), S);
       return StringRef(S, Length);