[clang] e57b872 - Avoid unusable variable in ByteCodeExprGen.cpp (#90469)
    via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Mon Apr 29 06:23:33 PDT 2024
    
    
  
Author: Danial Klimkin
Date: 2024-04-29T15:23:29+02:00
New Revision: e57b8724140664da408da92d5d50f9a1e0c9828a
URL: https://github.com/llvm/llvm-project/commit/e57b8724140664da408da92d5d50f9a1e0c9828a
DIFF: https://github.com/llvm/llvm-project/commit/e57b8724140664da408da92d5d50f9a1e0c9828a.diff
LOG: Avoid unusable variable in ByteCodeExprGen.cpp (#90469)
Inline assert to avoid unusable variable warning/error when asserts are
disabled.
Added: 
    
Modified: 
    clang/lib/AST/Interp/ByteCodeExprGen.cpp
Removed: 
    
################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index 626c30157b228f..568a929c6a1693 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -2363,8 +2363,7 @@ bool ByteCodeExprGen<Emitter>::VisitCXXUuidofExpr(const CXXUuidofExpr *E) {
   if (!this->emitGetPtrGlobal(*GlobalIndex, E))
     return false;
 
-  const Record *R = this->getRecord(E->getType());
-  assert(R);
+  assert(this->getRecord(E->getType()));
 
   const APValue &V = E->getGuidDecl()->getAsAPValue();
   if (V.getKind() == APValue::None)
        
    
    
More information about the cfe-commits
mailing list