[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
Tue Nov 29 03:06:40 PST 2022


balazske added a comment.

CppCoreGuidelines rule r13-perform-at-most-one-explicit-resource-allocation-in-a-single-expression-statement <https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#r13-perform-at-most-one-explicit-resource-allocation-in-a-single-expression-statement> is applicable for this problem. The current check is more restricted. If the check is moved to cppcoreguidelines it should check for any multiple `new` in a single expression and probably for other "resource allocation" that is not `new` (if there is such case at all that can not be changed to a safe function call or is not deprecated by other rules). Probably we can have an option to switch the behavior (any 2 `new` or the current way) and move the check to cppcoreguidelines.


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