[PATCH] D138777: [clang-tidy] Add check bugprone-multiple-new-in-one-expression.

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 28 07:27:06 PST 2022


Eugene.Zelenko added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/bugprone/MultipleNewInOneExpressionCheck.h:25
+  bool isLanguageVersionSupported(const LangOptions &LangOpts) const override {
+    return LangOpts.CPlusPlus11;
+  }
----------------
I think check is applicable to early versions too.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/bugprone/multiple-new-in-one-expression.rst:9
+
+C++ does often not specify the exact order of evaluation of the operands of an operator or arguments of a function.
+Therefore if a first allocation succeeds and a second fails, in an exception handler it is not possible to tell which allocation has failed and free the memory.
----------------
Please follow 80 characters limit.


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