The static analyzer is warning about a potential null dereference, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374988
91177308-0d34-0410-b5e6-
96231b3b80d8
return nullptr;
// FIXME: We should not have to call getBaseElementType here.
- const RecordType *RT =
- CGM.getContext().getBaseElementType(Ty)->getAs<RecordType>();
+ const auto *RT =
+ CGM.getContext().getBaseElementType(Ty)->castAs<RecordType>();
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
// If the class doesn't have a trivial destructor, we can't emit it as a