From c4379c3b7e5c7a5966e646bf39def5038fb59fa2 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 21 Aug 2012 20:39:25 +0000 Subject: [PATCH] Don't pass a null pointer to cast<> in its unit tests. llvm-svn: 162310 --- llvm/unittests/Support/Casting.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/llvm/unittests/Support/Casting.cpp b/llvm/unittests/Support/Casting.cpp index ca0b40b1f55b..dc0205f325f2 100644 --- a/llvm/unittests/Support/Casting.cpp +++ b/llvm/unittests/Support/Casting.cpp @@ -95,8 +95,9 @@ TEST(CastingTest, cast) { EXPECT_NE(&F5, null_foo); const foo *F6 = cast(B4); EXPECT_NE(F6, null_foo); - foo *F7 = cast(fub()); - EXPECT_EQ(F7, null_foo); + // Can't pass null pointer to cast<>. + // foo *F7 = cast(fub()); + // EXPECT_EQ(F7, null_foo); foo *F8 = B1.baz(); EXPECT_NE(F8, null_foo); } @@ -121,7 +122,8 @@ TEST(CastingTest, dyn_cast) { EXPECT_NE(F2, null_foo); const foo *F3 = dyn_cast(B4); EXPECT_NE(F3, null_foo); - // foo *F4 = dyn_cast(fub()); // not permittible + // Can't pass null pointer to dyn_cast<>. + // foo *F4 = dyn_cast(fub()); // EXPECT_EQ(F4, null_foo); foo *F5 = B1.daz(); EXPECT_NE(F5, null_foo);