This patch uses castAs instead of getAs which will assert if the type doesn't match in checkSizelessVectorShift(clang::Sema &, clang::ActionResult<clang::Expr *, true> &, clang::ActionResult<clang::Expr *, true> &, clang::SourceLocation, bool).
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D152107
return QualType();
QualType LHSType = LHS.get()->getType();
- const BuiltinType *LHSBuiltinTy = LHSType->getAs<BuiltinType>();
+ const BuiltinType *LHSBuiltinTy = LHSType->castAs<BuiltinType>();
QualType LHSEleType = LHSType->isVLSTBuiltinType()
? LHSBuiltinTy->getSveEltType(S.getASTContext())
: LHSType;
// Note that RHS might not be a vector
QualType RHSType = RHS.get()->getType();
- const BuiltinType *RHSBuiltinTy = RHSType->getAs<BuiltinType>();
+ const BuiltinType *RHSBuiltinTy = RHSType->castAs<BuiltinType>();
QualType RHSEleType = RHSType->isVLSTBuiltinType()
? RHSBuiltinTy->getSveEltType(S.getASTContext())
: RHSType;