[PATCH] D127270: [clang-format] Add space in placement new expression

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 7 23:21:03 PDT 2022


curdeius added a comment.

Apart from some missing tests, looks promising!



================
Comment at: clang/unittests/Format/FormatTest.cpp:15276-15286
+  FormatStyle SpacePlacementNew = getLLVMStyle();
+  SpacePlacementNew.SpaceBeforeParens = FormatStyle::SBPO_Custom;
+  SpacePlacementNew.SpaceBeforeParensOptions.AfterPlacementNew = true;
+  verifyFormat("new (buf) T;", SpacePlacementNew);
+  verifyFormat("T *p = new (buf) T;", SpacePlacementNew);
+  verifyFormat("T *p = new (buf) T(3);", SpacePlacementNew);
+  verifyFormat("T *new() {}", SpacePlacementNew);
----------------
Are there any tests with `AfterPlacementNew = false;`? Could you add those please?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127270/new/

https://reviews.llvm.org/D127270



More information about the cfe-commits mailing list