[PATCH] D114521: [clang-format] [PR47936] AfterControlStatement: MultiLine breaks AllowShortFunctionsOnASingleLine

Kyrylo Bohdanenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 24 07:48:08 PST 2021


KyrBoh added a comment.

@MyDeveloperDay

> What it seems is "AllowShortIfStatementsOnASingleLine" ONLY seems to work when there are no {}

AFAIR, there are 2 settings (in case of control statements):

- AllowShortBlocksOnASingleLine --> whether to treat (curly-)braced blocks as a single statement (i.e. allow them be one-liners)
- AllowShortIfStatementsOnASingleLine --> this actually tells whether control statements *can* be one-liners

So these two should be considered in pair. BTW, the documentation for AllowShortIfStatementsOnASingleLine seems to be a bit misleading

@curdeius 
Alright, I'll create a report


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114521



More information about the cfe-commits mailing list