From: David Spickett Date: Mon, 26 Jun 2023 15:19:06 +0000 (+0000) Subject: [clang][OpenMP] Fix unused var warning X-Git-Tag: upstream/17.0.6~3861 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3ca99a87c566fb5e910071f4cbb474ddb4e7f37;p=platform%2Fupstream%2Fllvm.git [clang][OpenMP] Fix unused var warning This was added by 453e02ca0903c9f65529d21c513925ab0fdea1e1.Use isa instead since we don't use the result. Fixes: <..>SemaOpenMP.cpp:23149:13: warning: unused variable ‘TargetVarDecl’ [-Wunused-variable] 23149 | if (auto *TargetVarDecl = dyn_cast_or_null(TargetDecl)) | ^~~~~~~~~~~~~ Which came up when building with GCC 9. --- diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 0b6f5be..e22425b 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -23146,7 +23146,7 @@ public: /// variables with static storage duration in declare target directive. void Sema::ActOnOpenMPDeclareTargetInitializer(Decl *TargetDecl) { GlobalDeclRefChecker Checker; - if (auto *TargetVarDecl = dyn_cast_or_null(TargetDecl)) + if (isa(TargetDecl)) Checker.declareTargetInitializer(TargetDecl); }