================
@@ -353,6 +372,22 @@ void SizeofExpressionCheck::check(const
MatchFinder::MatchResult &Result) {
diag(E->getBeginLoc(),
"suspicious usage of 'sizeof(char*)'; do you mean 'strlen'?")
<< E->getSourceRange();
+ } else if (const auto *E = Result.Nodes.getNodeAs<Stmt>("loop-expr")) {
+ auto *SizeofArgTy = Result.Nodes.getNodeAs<Type>("sizeof-arg-type");
+ if (const auto member = dyn_cast<MemberPointerType>(SizeofArgTy))
+ SizeofArgTy = member->getPointeeType().getTypePtr();
+
+ auto Loc = Result.Nodes.getNodeAs<Expr>("sizeof-expr");
----------------
malavikasamak wrote:
Fixed in new version.
https://github.com/llvm/llvm-project/pull/143205
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits