[clang] [clang-tools-extra] [clang-tidy] Fix FP in misc-const-correctness (PR #206515)
Yanzuo Liu via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 30 19:22:18 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())
----------------
zwuis wrote:
Are these conditions necessary? (Looking at the function name `resolveExpr`)
https://github.com/llvm/llvm-project/pull/206515
More information about the cfe-commits
mailing list