[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
Mon Jun 13 07:21:31 PDT 2022


HazardyKnusperkeks added inline comments.


================
Comment at: clang/lib/Format/Format.cpp:1314
   LLVMStyle.SpaceBeforeParensOptions.AfterIfMacros = true;
+  LLVMStyle.SpaceBeforeParensOptions.AfterPlacementNew = true;
   LLVMStyle.SpaceBeforeRangeBasedForLoopColon = true;
----------------
omarahmed wrote:
> HazardyKnusperkeks wrote:
> > 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.
> I think they are initialized with false so that when we come to [this case](https://github.com/llvm/llvm-project/blob/54ae4ca7550a81fd1fa9e484904d553af8fbb2fd/clang/lib/Format/Format.cpp#L1155), it breaks while all of them are false. (I am not sure so) I will try to add a test to cover 'SBPO_Never' but after converting it to enum.
Then you need to set it to `false` in the CTor.


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