Skip to content

Commit 5abbe8e

Browse files
Revert "[ADT] Add std::string_view conversion to SmallString (#83397)"
This reverts commit cff36bb. This patch was causing build failures in certain configurations.
1 parent de55c2f commit 5abbe8e

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

llvm/include/llvm/ADT/SmallString.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,11 +265,6 @@ class SmallString : public SmallVector<char, InternalLen> {
265265
/// Implicit conversion to StringRef.
266266
operator StringRef() const { return str(); }
267267

268-
/// Implicit conversion to std::string_view.
269-
operator std::string_view() const {
270-
return std::string_view(this->data(), this->size());
271-
}
272-
273268
explicit operator std::string() const {
274269
return std::string(this->data(), this->size());
275270
}

llvm/unittests/ADT/SmallStringTest.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,4 @@ TEST_F(SmallStringTest, GTestPrinter) {
244244
EXPECT_EQ(R"("foo")", ::testing::PrintToString(ErasedSmallString));
245245
}
246246

247-
TEST_F(SmallStringTest, StringView) {
248-
theString = "hello from std::string_view";
249-
EXPECT_EQ("hello from std::string_view",
250-
static_cast<std::string_view>(theString));
251-
}
252-
253247
} // namespace

0 commit comments

Comments
 (0)