[PATCH] D117416: [clang-format] Handle C variables with name that matches c++ access specifier

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 16 12:12:16 PST 2022


HazardyKnusperkeks added a comment.

In D117416#3246838 <https://reviews.llvm.org/D117416#3246838>, @curdeius wrote:

> Thanks for having a try on this.
> However, I don't like this approach too much. You add many changes and a single test. That's not sufficient.
> Also, handling C++ keywords in all cases (e.g. `delete` as a function name) *may* need to distinguish whether we format a C file or a C++ file. It's probably impossible to do this without user input (.h extension is used in both languages for example).
> We'd maybe need to add C as language option and let the user specify the language (`-x c`?).
> That in turn may be painful (because not automatic).
> But, you may have a better solution.
> My 2 cents.

I second just adding a new language.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117416



More information about the cfe-commits mailing list