[clang] c98b601 - [randstruct] Fix -Wunused-but-set-variable with Clang>=D122271 in -DLLVM_ENABLE_ASSERTIONS=off builds
    Fangrui Song via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Apr 13 17:09:34 PDT 2022
    
    
  
Author: Fangrui Song
Date: 2022-04-13T17:09:30-07:00
New Revision: c98b601b7fad9500742a9221bd8de4a86d68175e
URL: https://github.com/llvm/llvm-project/commit/c98b601b7fad9500742a9221bd8de4a86d68175e
DIFF: https://github.com/llvm/llvm-project/commit/c98b601b7fad9500742a9221bd8de4a86d68175e.diff
LOG: [randstruct] Fix -Wunused-but-set-variable with Clang>=D122271 in -DLLVM_ENABLE_ASSERTIONS=off builds
Added: 
    
Modified: 
    clang/lib/AST/Randstruct.cpp
Removed: 
    
################################################################################
diff  --git a/clang/lib/AST/Randstruct.cpp b/clang/lib/AST/Randstruct.cpp
index f6d7ba1c24164..fadc727bbc4ed 100644
--- a/clang/lib/AST/Randstruct.cpp
+++ b/clang/lib/AST/Randstruct.cpp
@@ -216,6 +216,7 @@ bool randomizeStructureLayout(const ASTContext &Context, StringRef Name,
 
   assert(TotalNumFields == FinalOrdering.size() &&
          "Decl count has been altered after Randstruct randomization!");
+  (void)TotalNumFields;
   return true;
 }
 
        
    
    
More information about the cfe-commits
mailing list