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

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 8 05:03:28 PDT 2022


HazardyKnusperkeks added inline comments.


================
Comment at: clang/include/clang/Format/Format.h:3498
+    /// \endcode
+    bool AfterPlacementNew;
     /// If ``true``, put a space between operator overloading and opening
----------------
Please sort after `AfterOver...` here and all other occasions.


================
Comment at: clang/lib/Format/Format.cpp:1314
   LLVMStyle.SpaceBeforeParensOptions.AfterIfMacros = true;
+  LLVMStyle.SpaceBeforeParensOptions.AfterPlacementNew = true;
   LLVMStyle.SpaceBeforeRangeBasedForLoopColon = true;
----------------
This isn't needed, because the default CTor initializes it with true.
Or you change that, I don't know right now why all other attributes are initialized with false.


================
Comment at: clang/unittests/Format/FormatTest.cpp:15278
+  SpacePlacementNew.SpaceBeforeParens = FormatStyle::SBPO_Custom;
+  SpacePlacementNew.SpaceBeforeParensOptions.AfterPlacementNew = true;
+  verifyFormat("new (buf) T;", SpacePlacementNew);
----------------
Assert on that.


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