Skip to content

Commit d343913

Browse files
[Analysis] Remove a redundant cast. (#168214)
callOperatorDecl is already of type FunctionDecl *. Identified with readability-redundant-casting.
1 parent ff8ed4d commit d343913

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

clang/lib/Analysis/BodyFarm.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,15 +293,14 @@ static CallExpr *create_call_once_lambda_call(ASTContext &C, ASTMaker M,
293293
FunctionDecl *callOperatorDecl = CallbackDecl->getLambdaCallOperator();
294294
assert(callOperatorDecl != nullptr);
295295

296-
DeclRefExpr *callOperatorDeclRef =
297-
DeclRefExpr::Create(/* Ctx =*/ C,
298-
/* QualifierLoc =*/ NestedNameSpecifierLoc(),
299-
/* TemplateKWLoc =*/ SourceLocation(),
300-
const_cast<FunctionDecl *>(callOperatorDecl),
301-
/* RefersToEnclosingVariableOrCapture=*/ false,
302-
/* NameLoc =*/ SourceLocation(),
303-
/* T =*/ callOperatorDecl->getType(),
304-
/* VK =*/ VK_LValue);
296+
DeclRefExpr *callOperatorDeclRef = DeclRefExpr::Create(
297+
/* Ctx =*/C,
298+
/* QualifierLoc =*/NestedNameSpecifierLoc(),
299+
/* TemplateKWLoc =*/SourceLocation(), callOperatorDecl,
300+
/* RefersToEnclosingVariableOrCapture=*/false,
301+
/* NameLoc =*/SourceLocation(),
302+
/* T =*/callOperatorDecl->getType(),
303+
/* VK =*/VK_LValue);
305304

306305
return CXXOperatorCallExpr::Create(
307306
/*AstContext=*/C, OO_Call, callOperatorDeclRef,

0 commit comments

Comments
 (0)