Manna created this revision. Manna added a reviewer: erichkeane. Herald added subscribers: ctetreau, manas, ASDenysPetrov, dkrupp, donat.nagy, Szelethus, a.sidorin, baloghadamsoftware. Herald added a project: All. Manna requested review of this revision. Herald added a project: clang.
This patch uses castAs instead of getAs which will assert if the type doesn't match in clang::Sema::CheckSizelessVectorOperands(clang::ActionResult<clang::Expr *, true> &, clang::ActionResult<clang::Expr *, true> &, clang::SourceLocation, bool, clang::Sema::ArithConvKind). Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D152197 Files: clang/lib/Sema/SemaExpr.cpp Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -11111,8 +11111,8 @@ QualType LHSType = LHS.get()->getType().getUnqualifiedType(); QualType RHSType = RHS.get()->getType().getUnqualifiedType(); - const BuiltinType *LHSBuiltinTy = LHSType->getAs<BuiltinType>(); - const BuiltinType *RHSBuiltinTy = RHSType->getAs<BuiltinType>(); + const BuiltinType *LHSBuiltinTy = LHSType->castAs<BuiltinType>(); + const BuiltinType *RHSBuiltinTy = RHSType->castAs<BuiltinType>(); unsigned DiagID = diag::err_typecheck_invalid_operands; if ((OperationKind == ACK_Arithmetic) &&
Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -11111,8 +11111,8 @@ QualType LHSType = LHS.get()->getType().getUnqualifiedType(); QualType RHSType = RHS.get()->getType().getUnqualifiedType(); - const BuiltinType *LHSBuiltinTy = LHSType->getAs<BuiltinType>(); - const BuiltinType *RHSBuiltinTy = RHSType->getAs<BuiltinType>(); + const BuiltinType *LHSBuiltinTy = LHSType->castAs<BuiltinType>(); + const BuiltinType *RHSBuiltinTy = RHSType->castAs<BuiltinType>(); unsigned DiagID = diag::err_typecheck_invalid_operands; if ((OperationKind == ACK_Arithmetic) &&
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits