forked from OSchip/llvm-project
add tests that debug mode catches nullptr->string_view conversions in comparison operators
llvm-svn: 372907
This commit is contained in:
parent
d3b2b97195
commit
a32717750d
|
@ -26,6 +26,11 @@ void test_null_argument() {
|
||||||
EXPECT_DEATH(std::string_view(nullptr));
|
EXPECT_DEATH(std::string_view(nullptr));
|
||||||
EXPECT_DEATH(std::string_view(NULL));
|
EXPECT_DEATH(std::string_view(NULL));
|
||||||
EXPECT_DEATH(std::string_view(static_cast<const char*>(0)));
|
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**)
|
int main(int, char**)
|
||||||
|
|
Loading…
Reference in New Issue