Skip to content

Commit 720d7e0

Browse files
authored
[CIR][NFC] Fix an unused variable warning (#145922)
This fixes a warning where a variable assigned in 'if' statement wasn't referenced again.
1 parent 69bbf21 commit 720d7e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -427,9 +427,9 @@ void CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd,
427427
setNonAliasAttributes(gd, funcOp);
428428
assert(!cir::MissingFeatures::opFuncAttributesForDefinition());
429429

430-
if (const ConstructorAttr *ca = funcDecl->getAttr<ConstructorAttr>())
430+
if (funcDecl->getAttr<ConstructorAttr>())
431431
errorNYI(funcDecl->getSourceRange(), "constructor attribute");
432-
if (const DestructorAttr *da = funcDecl->getAttr<DestructorAttr>())
432+
if (funcDecl->getAttr<DestructorAttr>())
433433
errorNYI(funcDecl->getSourceRange(), "destructor attribute");
434434

435435
if (funcDecl->getAttr<AnnotateAttr>())
@@ -1055,7 +1055,7 @@ cir::GlobalLinkageKind CIRGenModule::getFunctionLinkage(GlobalDecl gd) {
10551055

10561056
GVALinkage linkage = astContext.GetGVALinkageForFunction(fd);
10571057

1058-
if (const auto *dtor = dyn_cast<CXXDestructorDecl>(fd))
1058+
if (isa<CXXDestructorDecl>(fd))
10591059
errorNYI(fd->getSourceRange(), "getFunctionLinkage: CXXDestructorDecl");
10601060

10611061
return getCIRLinkageForDeclarator(fd, linkage, /*IsConstantVariable=*/false);

0 commit comments

Comments
 (0)