Skip to content

Commit d63c8be

Browse files
committed
[clang][ExprConst] Remove unnecessary cast
FD is a FunctionDecl, so no need to cast a FunctionDecl to a CXXMethodDecl just to assign it to a FunctionDecl.
1 parent fe8a62c commit d63c8be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/AST/ExprConstant.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8006,7 +8006,8 @@ class ExprEvaluatorBase
80068006
assert(CorrespondingCallOpSpecialization &&
80078007
"We must always have a function call operator specialization "
80088008
"that corresponds to our static invoker specialization");
8009-
FD = cast<CXXMethodDecl>(CorrespondingCallOpSpecialization);
8009+
assert(isa<CXXMethodDecl>(CorrespondingCallOpSpecialization));
8010+
FD = CorrespondingCallOpSpecialization;
80108011
} else
80118012
FD = LambdaCallOp;
80128013
} else if (FD->isReplaceableGlobalAllocationFunction()) {

0 commit comments

Comments
 (0)