Skip to content

Conversation

@kazutakahirata
Copy link
Contributor

getSignificantBits() already returns unsigned.

getSignificantBits() already returns unsigned.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jul 30, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 30, 2025

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

Changes

getSignificantBits() already returns unsigned.


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

1 Files Affected:

  • (modified) clang/include/clang/AST/ASTContext.h (+1-1)
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 0273109f8a698..3b98274a80420 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -1818,7 +1818,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
         NumPositiveBits = std::max({NumPositiveBits, ActiveBits, 1u});
       } else {
         NumNegativeBits =
-            std::max(NumNegativeBits, (unsigned)InitVal.getSignificantBits());
+            std::max(NumNegativeBits, InitVal.getSignificantBits());
       }
 
       MembersRepresentableByInt &= isRepresentableIntegerValue(InitVal, IntTy);

@kazutakahirata kazutakahirata merged commit b90e1e1 into llvm:main Jul 30, 2025
12 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250729_cast_clang_AST branch July 30, 2025 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants