Unlike isa<> and cast<>, current implementation of dyn_cast<> fails
to process a std::unique_ptr to a class supporting LLVM RTTI:
// A and B support LLVM RTTI
class A {...}
class B: public A {...}
void foo() {
...
auto V = std::make_unique<A>();
auto VB = dyn_cast<B>(std::move(V));
if (VB)
...
...
}
Reviewed By: lattner, bzcheeseman
Differential Revision: https://reviews.llvm.org/D147991
16 KiB
16 KiB