[libcxx-commits] [libcxx] r372907 - add tests that debug mode catches nullptr->string_view conversions in comparison operators

Eric Fiselier via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 25 11:43:40 PDT 2019


Author: ericwf
Date: Wed Sep 25 11:43:40 2019
New Revision: 372907

URL: http://llvm.org/viewvc/llvm-project?rev=372907&view=rev
Log:
add tests that debug mode catches nullptr->string_view conversions in comparison operators

Modified:
    libcxx/trunk/test/libcxx/debug/db_string_view.pass.cpp

Modified: libcxx/trunk/test/libcxx/debug/db_string_view.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/libcxx/debug/db_string_view.pass.cpp?rev=372907&r1=372906&r2=372907&view=diff
==============================================================================
--- libcxx/trunk/test/libcxx/debug/db_string_view.pass.cpp (original)
+++ libcxx/trunk/test/libcxx/debug/db_string_view.pass.cpp Wed Sep 25 11:43:40 2019
@@ -26,6 +26,11 @@ void test_null_argument() {
   EXPECT_DEATH(std::string_view(nullptr));
   EXPECT_DEATH(std::string_view(NULL));
   EXPECT_DEATH(std::string_view(static_cast<const char*>(0)));
+  {
+    std::string_view v;
+    EXPECT_DEATH(((void)(v == nullptr)));
+    EXPECT_DEATH(((void)(nullptr == v)));
+  }
 }
 
 int main(int, char**)




More information about the libcxx-commits mailing list