From 650e286dcf39e58a1e9de767354ff0bda4a9a82e Mon Sep 17 00:00:00 2001 From: Alp Toker Date: Mon, 27 Jan 2014 05:24:39 +0000 Subject: Roll back the ConstStringRef change for now There are a couple of interesting things here that we want to check over (particularly the expecting asserts in StringRef) and get right for general use in ADT so hold back on this one. For clang we have a workable templated solution to use in the meanwhile. This reverts commit r200187. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200194 91177308-0d34-0410-b5e6-96231b3b80d8 --- unittests/ADT/StringRefTest.cpp | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'unittests') diff --git a/unittests/ADT/StringRefTest.cpp b/unittests/ADT/StringRefTest.cpp index b240a87ef7..0ab8fcf6f0 100644 --- a/unittests/ADT/StringRefTest.cpp +++ b/unittests/ADT/StringRefTest.cpp @@ -531,22 +531,4 @@ TEST(StringRefTest, joinStrings) { EXPECT_TRUE(v2_join3); } -static void fn_stringref(StringRef str) { - EXPECT_TRUE(str == "hello"); -} -static void fn_conststringref(ConstStringRef str) { - fn_stringref(str); -} - -TEST(StringRefTest, constStringRef) { - LLVM_CONSTEXPR ConstStringRef csr("hello"); -#if __has_feature(cxx_constexpr) || defined(__GXX_EXPERIMENTAL_CXX0X__) - LLVM_STATIC_ASSERT(csr[0] != csr[1], ""); - LLVM_STATIC_ASSERT(csr[2] == csr[3], ""); - LLVM_STATIC_ASSERT(csr.size() == 5, ""); -#endif - llvm_expect(csr[2] == csr[3]); - fn_conststringref(csr); -} - } // end anonymous namespace -- cgit v1.2.3