[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?


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.


More information about the cfe-commits mailing list