[clang] 4f08fa1 - [clang] Fix -Wunused-variable in InterpBuiltin.cpp (NFC)
Jie Fu via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 9 05:23:26 PST 2024
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());
}
More information about the cfe-commits
mailing list