================
@@ -402,6 +402,9 @@ void NarrowingConversionsCheck::handleIntegralCast(const 
ASTContext &Context,
       return;
     const BuiltinType *FromType = getBuiltinType(Rhs);
 
+    if (FromType->getKind() == BuiltinType::Bool)
----------------
zeyi2 wrote:

I understand that this is correct, but IIUC there is already a dedicated 
handler for bool-to-signed-integral conversions in 
[`handleBooleanToSignedIntegral`](https://github.com/llvm/llvm-project/blob/b7febd772c57fc21a126a8e125d749df9e4a6a53/clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.cpp#L484).

Would it make more sense to route this case there from the 
[`CK_IntegralCast`](https://github.com/llvm/llvm-project/blob/b7febd772c57fc21a126a8e125d749df9e4a6a53/clang-tools-extra/clang-tidy/bugprone/NarrowingConversionsCheck.cpp#L596)
 path instead of special-casing it here?

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

Reply via email to