diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-27 05:24:39 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-27 05:24:39 +0000 |
commit | 17d4e98e7308922d6cbf24a577367dca75d3920e (patch) | |
tree | 230c7800a25a1a46d4cd91d4235ccdde6bc8ba27 /llvm/unittests/ADT/StringRefTest.cpp | |
parent | 0d865d3d7beb04ab0f634a711a785156e25771aa (diff) | |
download | llvm-17d4e98e7308922d6cbf24a577367dca75d3920e.zip llvm-17d4e98e7308922d6cbf24a577367dca75d3920e.tar.gz llvm-17d4e98e7308922d6cbf24a577367dca75d3920e.tar.bz2 |
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.
llvm-svn: 200194
Diffstat (limited to 'llvm/unittests/ADT/StringRefTest.cpp')
-rw-r--r-- | llvm/unittests/ADT/StringRefTest.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp index b240a87..0ab8fcf 100644 --- a/llvm/unittests/ADT/StringRefTest.cpp +++ b/llvm/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 |