diff --git a/include/llvm/ADT/SmallString.h b/include/llvm/ADT/SmallString.h index 05bd8a42c67..73285608221 100644 --- a/include/llvm/ADT/SmallString.h +++ b/include/llvm/ADT/SmallString.h @@ -41,12 +41,6 @@ public: // Implicit conversion to StringRef. operator StringRef() const { return str(); } - const char *c_str() { - this->push_back(0); - this->pop_back(); - return this->data(); - } - // Extra operators. const SmallString &operator=(StringRef RHS) { this->clear(); diff --git a/include/llvm/ADT/SmallVector.h b/include/llvm/ADT/SmallVector.h index 0c9f7eb6345..123b85daff8 100644 --- a/include/llvm/ADT/SmallVector.h +++ b/include/llvm/ADT/SmallVector.h @@ -340,6 +340,12 @@ public: return Result; } + // TODO: Make this const, if it's safe... + typename SuperClass::const_pointer c_str() { + push_back(0); + pop_back(); + return this->data(); + } void swap(SmallVectorImpl &RHS);