From 5775c5d05c91c82efef522043ddfb52c28e65b4d Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 15 Jul 2022 13:25:02 +0200 Subject: [PATCH] Remove an unsued-variable warning, NFC. --- clang/lib/AST/DeclPrinter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 3f04d9b4073e..b041e2a67e95 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -1007,10 +1007,10 @@ void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { } } - if (auto *Def = D->getDefinition()) { - if (D->hasAttr()) { - Out << " final"; - } + if (D->hasDefinition()) { + if (D->hasAttr()) { + Out << " final"; + } } if (D->isCompleteDefinition()) {