[clang] [Index] Remove an unnecessary cast (NFC) (PR #146944)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 3 12:29:37 PDT 2025
https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/146944
We don't need to cast twice to the same type.
>From 03383da4eee7f35bdf1148b37cb44a2056b547d0 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 3 Jul 2025 12:04:54 -0700
Subject: [PATCH] [Index] Remove an unnecessary cast (NFC)
We don't need to cast twice to the same type.
---
clang/lib/Index/IndexBody.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/lib/Index/IndexBody.cpp b/clang/lib/Index/IndexBody.cpp
index 98ce6f73ec849..1979117d4695c 100644
--- a/clang/lib/Index/IndexBody.cpp
+++ b/clang/lib/Index/IndexBody.cpp
@@ -69,7 +69,7 @@ class BodyIndexer : public RecursiveASTVisitor<BodyIndexer> {
while (isa<CastExpr>(*It) || isa<ParenExpr>(*It)) {
if (auto ICE = dyn_cast<ImplicitCastExpr>(*It)) {
if (ICE->getCastKind() == CK_LValueToRValue)
- Roles |= (unsigned)(unsigned)SymbolRole::Read;
+ Roles |= (unsigned)SymbolRole::Read;
}
if (It == StmtStack.begin())
break;
More information about the cfe-commits
mailing list