Skip to content

Commit e439d22

Browse files
committed
[clang][ExprConst][NFC] Replace typecheck+castAs with getAs
1 parent c0ff36e commit e439d22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14014,8 +14014,8 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr(
1401414014
QualType Ty = E->getTypeOfArgument();
1401514015
// If the vector has a fixed size, we can determine the number of elements
1401614016
// at compile time.
14017-
if (Ty->isVectorType())
14018-
return Success(Ty->castAs<VectorType>()->getNumElements(), E);
14017+
if (const auto *VT = Ty->getAs<VectorType>())
14018+
return Success(VT->getNumElements(), E);
1401914019

1402014020
assert(Ty->isSizelessVectorType());
1402114021
if (Info.InConstantContext)

0 commit comments

Comments
 (0)