[clang] a460aa1 - [Sema] Fix a warning

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 27 08:15:13 PDT 2025


Author: Kazu Hirata
Date: 2025-06-27T08:15:06-07:00
New Revision: a460aa1071c90e849144a5ca2c11b3016e1dc2a0

URL: https://github.com/llvm/llvm-project/commit/a460aa1071c90e849144a5ca2c11b3016e1dc2a0
DIFF: https://github.com/llvm/llvm-project/commit/a460aa1071c90e849144a5ca2c11b3016e1dc2a0.diff

LOG: [Sema] Fix a warning

This patch fixes:

  clang/lib/Sema/AnalysisBasedWarnings.cpp:686:23: error: variable
  'FD' set but not used [-Werror,-Wunused-but-set-variable]

Added: 
    

Modified: 
    clang/lib/Sema/AnalysisBasedWarnings.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index f3798bb6a7450..7420ba2d461c6 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -683,7 +683,7 @@ static void CheckFallThroughForBody(Sema &S, const Decl *D, const Stmt *Body,
     } else if (!ReturnsVoid && CD.diag_FallThrough_ReturnsNonVoid) {
       // If the final statement is a call to an always-throwing function,
       // don't warn about the fall-through.
-      if (const auto *FD = D->getAsFunction()) {
+      if (D->getAsFunction()) {
         if (const auto *CS = dyn_cast<CompoundStmt>(Body);
             CS && !CS->body_empty()) {
           const Stmt *LastStmt = CS->body_back();


        


More information about the cfe-commits mailing list