[PATCH] D42027: [Support][NFC] Improve isa implementation

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 23 13:46:05 PST 2018


dblaikie added inline comments.


================
Comment at: unittests/Support/Casting.cpp:288-289
+  EXPECT_TRUE(isa<Base>(DShared));
+  llvm::Optional<Derived> DOpt;
+  EXPECT_TRUE(isa<Base>(DOpt));
+}
----------------
Does this change then mean that one could cast<T> from Optional<Derived> to Optional<Base>? Because that'd be problematic, owing to Optional being a value-type. (it'd slice the object)


https://reviews.llvm.org/D42027





More information about the llvm-commits mailing list