[clang] [clang-tools-extra] [clang-tidy] Fix FP in misc-const-correctness (PR #206515)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 2 12:59:46 PDT 2026


================
@@ -160,6 +160,13 @@ class ExprPointeeResolve {
         if (CastType == SubExprType)
           return resolveExpr(ICE->getSubExpr());
       }
+      if (kind == CK_BitCast) {
+        const QualType DestType = ICE->getType();
+        const QualType SubExprType = ICE->getSubExpr()->getType();
+        if (DestType->isPointerType() && SubExprType->isPointerType() &&
+            !DestType->getPointeeType().isConstQualified())
----------------
vbvictor wrote:

Yeah, this method is not moving in the right direction (with previous kind == CK_NoOP handling as well at some point)
Now I reworked the patch and removed unnecessary code from `resolveExpr`.
Now this should be cleaner

https://github.com/llvm/llvm-project/pull/206515


More information about the cfe-commits mailing list