diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-21 20:39:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-08-21 20:39:25 +0000 |
commit | 79b59a2766c42180f08fd49c3ea1c5b66682d487 (patch) | |
tree | aa52a9c5edff5bd42bd6e23c3f482a30ac65cdf9 /unittests/Support/Casting.cpp | |
parent | 875cc5d629697c16fd24662f7cce21766c3d2e4e (diff) | |
download | external_llvm-79b59a2766c42180f08fd49c3ea1c5b66682d487.zip external_llvm-79b59a2766c42180f08fd49c3ea1c5b66682d487.tar.gz external_llvm-79b59a2766c42180f08fd49c3ea1c5b66682d487.tar.bz2 |
Don't pass a null pointer to cast<> in its unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162310 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Support/Casting.cpp')
-rw-r--r-- | unittests/Support/Casting.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/unittests/Support/Casting.cpp b/unittests/Support/Casting.cpp index ca0b40b..dc0205f 100644 --- a/unittests/Support/Casting.cpp +++ b/unittests/Support/Casting.cpp @@ -95,8 +95,9 @@ TEST(CastingTest, cast) { EXPECT_NE(&F5, null_foo); const foo *F6 = cast<foo>(B4); EXPECT_NE(F6, null_foo); - foo *F7 = cast<foo>(fub()); - EXPECT_EQ(F7, null_foo); + // Can't pass null pointer to cast<>. + // foo *F7 = cast<foo>(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<foo>(B4); EXPECT_NE(F3, null_foo); - // foo *F4 = dyn_cast<foo>(fub()); // not permittible + // Can't pass null pointer to dyn_cast<>. + // foo *F4 = dyn_cast<foo>(fub()); // EXPECT_EQ(F4, null_foo); foo *F5 = B1.daz(); EXPECT_NE(F5, null_foo); |