[PATCH] D120374: [clang-format] Do not insert space after new/delete keywords in C function declarations

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 22 23:14:00 PST 2022


curdeius accepted this revision.
curdeius added a comment.
This revision is now accepted and ready to land.

In D120374#3339337 <https://reviews.llvm.org/D120374#3339337>, @penagos wrote:

> Though it's still unclear to me whether or not it'd make more sense to continue to pursue a change to introduce `C` as a language. Thoughts?

I prefer your current approach (and there should be not that many cases that we need a special treatment for C).
Adding a new language would be to disruptive and difficult, as well as hard to use in some cases (headers in C and C++ often share the same extension).



================
Comment at: clang/unittests/Format/FormatTest.cpp:9926
+            format("void new (link p);\n"
+                   "void delete(link p);\n"));
 }
----------------
Why there's no space after `delete` in the input?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120374



More information about the cfe-commits mailing list