[PATCH] D115879: [clang-format] extern with new line brace without indentation

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 17 03:24:38 PST 2021


MyDeveloperDay marked 7 inline comments as done.
MyDeveloperDay added inline comments.


================
Comment at: clang/lib/Format/UnwrappedLineParser.cpp:1282-1300
     if (FormatTok->Tok.is(tok::string_literal)) {
       nextToken();
       if (FormatTok->Tok.is(tok::l_brace)) {
+        if (Style.BraceWrapping.AfterExternBlock) {
+          addUnwrappedLine();
+        }
         if (!Style.IndentExternBlock) {
----------------
owenpan wrote:
> This `case` is kind of messy and some cleanup may be in order. A related question: why do we make `IEBS_AfterExternBlock` depend on `BraceWrapping.AfterExternBlock`? Can't we only have true/false for `IndentExternBlock` and let the user set it independent of `BraceWrapping.AfterExternBlock`?
This a a backwards compatibility thing, (its needed for the google style by the looks of things)


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

https://reviews.llvm.org/D115879



More information about the cfe-commits mailing list