[clang] 6e934b7 - [clang] Fix -Wunused-variable in SemaCast.cpp (NFC)

Jie Fu via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 14 05:35:22 PDT 2024


Author: Jie Fu
Date: 2024-04-14T20:34:26+08:00
New Revision: 6e934b7cfba8e0c167d2b287a30dfc1b720397c1

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

LOG: [clang] Fix -Wunused-variable in SemaCast.cpp (NFC)

llvm-project/clang/lib/Sema/SemaCast.cpp:503:23:
error: unused variable 'Res' [-Werror,-Wunused-variable]
    OverloadingResult Res =
                      ^
1 error generated.

Added: 
    

Modified: 
    clang/lib/Sema/SemaCast.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaCast.cpp b/clang/lib/Sema/SemaCast.cpp
index aac43e2cad603f..b0c28531fe8738 100644
--- a/clang/lib/Sema/SemaCast.cpp
+++ b/clang/lib/Sema/SemaCast.cpp
@@ -500,7 +500,7 @@ static bool tryDiagnoseOverloadedCast(Sema &S, CastType CT,
 
   case OR_Deleted: {
     OverloadCandidateSet::iterator Best;
-    OverloadingResult Res =
+    [[maybe_unused]] OverloadingResult Res =
         candidates.BestViableFunction(S, range.getBegin(), Best);
     assert(Res == OR_Deleted && "Inconsistent overload resolution");
 


        


More information about the cfe-commits mailing list