[PATCH] D95168: [clang-format] Add InsertBraces option

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 3 01:47:43 PDT 2021


MyDeveloperDay added a comment.

> In my experience, the simplest thing to do is to remove all optional braces as allowed by the language syntax. When you want to add exceptions for matching if-else braces, avoiding dangling-else warnings, etc, things get much more complicated very quickly. :)

I can well imagine. I already hit this once where I mutated the TokenAnnotator.cpp incorrect (which caused the unit tests to break). TokenAnnotator.cpp is if/else hell as far as I'm concerned, its a really good test best for some of this stuff!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95168



More information about the cfe-commits mailing list