[llvm-commits] [llvm] r162310 - /llvm/trunk/unittests/Support/Casting.cpp

Richard Smith richard-llvm at metafoo.co.uk
Tue Aug 21 13:39:25 PDT 2012


Author: rsmith
Date: Tue Aug 21 15:39:25 2012
New Revision: 162310

URL: http://llvm.org/viewvc/llvm-project?rev=162310&view=rev
Log:
Don't pass a null pointer to cast<> in its unit tests.

Modified:
    llvm/trunk/unittests/Support/Casting.cpp

Modified: llvm/trunk/unittests/Support/Casting.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/Casting.cpp?rev=162310&r1=162309&r2=162310&view=diff
==============================================================================
--- llvm/trunk/unittests/Support/Casting.cpp (original)
+++ llvm/trunk/unittests/Support/Casting.cpp Tue Aug 21 15:39:25 2012
@@ -95,8 +95,9 @@
   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 @@
   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);





More information about the llvm-commits mailing list