diff --git a/llvm/include/llvm/ADT/SmallString.h b/llvm/include/llvm/ADT/SmallString.h index 667cb3b419af..cd6f2173d04f 100644 --- a/llvm/include/llvm/ADT/SmallString.h +++ b/llvm/include/llvm/ADT/SmallString.h @@ -263,7 +263,7 @@ public: // Extra methods. /// Explicit conversion to StringRef. - StringRef str() const { return StringRef(this->begin(), this->size()); } + StringRef str() const { return StringRef(this->data(), this->size()); } // TODO: Make this const, if it's safe... const char* c_str() { @@ -276,7 +276,7 @@ public: operator StringRef() const { return str(); } explicit operator std::string() const { - return std::string(this->begin(), this->size()); + return std::string(this->data(), this->size()); } // Extra operators.