Author: Jie Fu
Date: 2024-12-09T21:23:08+08:00
New Revision: 4f08fa1a77b7357b4f1455b386ab8ca835e92558

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

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

/llvm-project/clang/lib/AST/ByteCode/InterpBuiltin.cpp:262:23:
error: unused variable 'AC' [-Werror,-Wunused-variable]
    const ASTContext &AC = S.getASTContext();
                      ^
1 error generated.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/InterpBuiltin.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/InterpBuiltin.cpp 
b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
index 2469648d68edb1..f816373c4d3dcc 100644
--- a/clang/lib/AST/ByteCode/InterpBuiltin.cpp
+++ b/clang/lib/AST/ByteCode/InterpBuiltin.cpp
@@ -259,7 +259,7 @@ static bool interp__builtin_strlen(InterpState &S, CodePtr 
OpPC,
   unsigned ElemSize = StrPtr.getFieldDesc()->getElemSize();
 
   if (ID == Builtin::BI__builtin_wcslen || ID == Builtin::BIwcslen) {
-    const ASTContext &AC = S.getASTContext();
+    [[maybe_unused]] const ASTContext &AC = S.getASTContext();
     assert(ElemSize == AC.getTypeSizeInChars(AC.getWCharType()).getQuantity());
   }
 


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to