[clang] [Sema] Remove an unnecessary cast (NFC) (PR #147154)

2025-07-05 Thread Kazu Hirata via cfe-commits

https://github.com/kazutakahirata closed 
https://github.com/llvm/llvm-project/pull/147154
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Sema] Remove an unnecessary cast (NFC) (PR #147154)

2025-07-05 Thread Corentin Jabot via cfe-commits

https://github.com/cor3ntin approved this pull request.


https://github.com/llvm/llvm-project/pull/147154
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Sema] Remove an unnecessary cast (NFC) (PR #147154)

2025-07-05 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)


Changes

BitWidth is already of Expr *.


---
Full diff: https://github.com/llvm/llvm-project/pull/147154.diff


1 Files Affected:

- (modified) clang/lib/Sema/SemaDecl.cpp (+1-2) 


``diff
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d0e9bef58ddee..11cbda412667f 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -18636,8 +18636,7 @@ ExprResult Sema::VerifyBitField(SourceLocation FieldLoc,
 << FieldName << FieldTy << BitWidth->getSourceRange();
 return Diag(FieldLoc, diag::err_not_integral_type_anon_bitfield)
   << FieldTy << BitWidth->getSourceRange();
-  } else if (DiagnoseUnexpandedParameterPack(const_cast(BitWidth),
- UPPC_BitFieldWidth))
+  } else if (DiagnoseUnexpandedParameterPack(BitWidth, UPPC_BitFieldWidth))
 return ExprError();
 
   // If the bit-width is type- or value-dependent, don't try to check

``




https://github.com/llvm/llvm-project/pull/147154
___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] [Sema] Remove an unnecessary cast (NFC) (PR #147154)

2025-07-05 Thread Kazu Hirata via cfe-commits

https://github.com/kazutakahirata created 
https://github.com/llvm/llvm-project/pull/147154

BitWidth is already of Expr *.


>From 5c55d621391595a2066c4d675b153d637483c79a Mon Sep 17 00:00:00 2001
From: Kazu Hirata 
Date: Fri, 4 Jul 2025 18:42:46 -0700
Subject: [PATCH] [Sema] Remove an unnecessary cast (NFC)

BitWidth is already of Expr *.
---
 clang/lib/Sema/SemaDecl.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index d0e9bef58ddee..11cbda412667f 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -18636,8 +18636,7 @@ ExprResult Sema::VerifyBitField(SourceLocation FieldLoc,
 << FieldName << FieldTy << BitWidth->getSourceRange();
 return Diag(FieldLoc, diag::err_not_integral_type_anon_bitfield)
   << FieldTy << BitWidth->getSourceRange();
-  } else if (DiagnoseUnexpandedParameterPack(const_cast(BitWidth),
- UPPC_BitFieldWidth))
+  } else if (DiagnoseUnexpandedParameterPack(BitWidth, UPPC_BitFieldWidth))
 return ExprError();
 
   // If the bit-width is type- or value-dependent, don't try to check

___
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits