[PATCH] D138777: [clang-tidy] Add check bugprone-multiple-new-in-one-expression.
Balázs Kéri via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 12 06:31:57 PDT 2023
balazske marked 2 inline comments as done.
balazske added inline comments.
================
Comment at: clang-tools-extra/clang-tidy/bugprone/MultipleNewInOneExpressionCheck.cpp:44-45
+ return BinOp->getOpcode() == BO_Assign &&
+ BinOp->getRHS()->IgnoreParenCasts() == E;
+
+ return isa<CallExpr, CXXConstructExpr>(ParentE);
----------------
donat.nagy wrote:
> In general, a value can be stored by passing it to a CompoundAssignOperator. This is not relevant in the current application (pointers do not appear on the RHS of compound assignment operators); but perhaps it's worth to mention this in a short comment in case someone wishes to reuse this function in some other checker.
It is mentioned now in the comment before the function.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138777/new/
https://reviews.llvm.org/D138777
More information about the cfe-commits
mailing list