cjdb added a subscriber: rsmith. cjdb added inline comments.
================ Comment at: clang/lib/Sema/SemaChecking.cpp:10320 + + const clang::CastKind Kind = Cast->getCastKind(); + if (Kind == clang::CK_BitCast && ---------------- aaron.ballman wrote: > We don't typically use top-level `const` on locals or params. This makes Christopher sad :( ================ Comment at: clang/lib/Sema/SemaChecking.cpp:10326 + !isa<IntegerLiteral>( + Cast->getSubExpr()->IgnoreImplicitAsWritten()->IgnoreParens())) + return; ---------------- aaron.ballman wrote: > I'm not 100% certain, but would `IgnoreParenImpCasts()` be sufficient here? > (`IgnoreImplicitAsWritten() seems to be a bit special -- the only use of it I > can find in tree is for rewritten binary operator expressions.) @rsmith would you mind weighing in here please? My original use-case for `IgnoreImplicitAsWritten` might be different to here and I don't have an answer for @aaron.ballman. ================ Comment at: clang/test/Analysis/free.cpp:221 +void t18b (S s) { + std::free((void*)(unsigned long long)s.p); // no warning +} ---------------- aaron.ballman wrote: > I think it'd be useful to add tests for named casts as well as the C-style > casts. Great idea! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97512/new/ https://reviews.llvm.org/D97512 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits