[clang] fa343be - Fix warnings in #102848 [-Wunused-but-set-variable]

NAKAMURA Takumi via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 15 00:17:51 PDT 2024


Author: NAKAMURA Takumi
Date: 2024-08-15T16:12:05+09:00
New Revision: fa343be414f9364911b947f109f3df5539e23068

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

LOG: Fix warnings in #102848 [-Wunused-but-set-variable]

Added: 
    

Modified: 
    clang/lib/AST/MicrosoftMangle.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/MicrosoftMangle.cpp b/clang/lib/AST/MicrosoftMangle.cpp
index a113574675b4c..db8000e25dc7c 100644
--- a/clang/lib/AST/MicrosoftMangle.cpp
+++ b/clang/lib/AST/MicrosoftMangle.cpp
@@ -2969,6 +2969,7 @@ void MicrosoftCXXNameMangler::mangleFunctionType(const FunctionType *T,
       if (const auto *AT = ResultType->getContainedAutoType()) {
         assert(AT->getKeyword() == AutoTypeKeyword::Auto &&
                "should only need to mangle auto!");
+        (void)AT;
         Out << '?';
         mangleQualifiers(ResultType.getLocalQualifiers(), /*IsMember=*/false);
         Out << '?';
@@ -2987,7 +2988,7 @@ void MicrosoftCXXNameMangler::mangleFunctionType(const FunctionType *T,
       // SourceRange Range)` for details.
       auto UseClangMangling = [](QualType ResultType) {
         QualType T = ResultType;
-        while (const auto *PT = dyn_cast<PointerType>(T.getTypePtr())) {
+        while (isa<PointerType>(T.getTypePtr())) {
           T = T->getPointeeType();
           if (T.getQualifiers().hasAddressSpace())
             return true;


        


More information about the cfe-commits mailing list