[PATCH] [clang-format] Fix AlwaysBreakAfterDefinitionReturnType incompatibility with BreakBeforeBraces: Stroustrup

Daniel Jasper djasper at google.com
Thu Aug 14 01:28:13 PDT 2014


I am happy to get this in as is especially as it is good to have the tests. I also agree that there is an underlying issue which we should look at in more detail. Can you add a FIXME to this effect?

REPOSITORY
  rL LLVM

================
Comment at: lib/Format/TokenAnnotator.cpp:1293
@@ -1292,3 +1292,3 @@
         InFunctionDecl && Current->Type == TT_FunctionDeclarationName &&
-        Line.Last->is(tok::l_brace))  // Only for definitions.
+        !Line.Last->is(tok::semi))  // Only for definitions.
       Current->MustBreakBefore = true;
----------------
Can you make this:

  !Line.Last->isOneOf(tok::semi, tok::comment)

That seems to be the most obvious exception I can think of.

http://reviews.llvm.org/D4886






More information about the cfe-commits mailing list