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

Zachary Turner zturner at google.com
Wed Aug 13 12:59:22 PDT 2014


I don't know enough to give you an lgtm here, but I can say that I was
having an issue with AlwaysBreakAfterDefinitionReturnType: true,
BreakBeforeBraces:
Allman, which is the style for LLDB, and this patch appears to fix my issue
as well.


On Mon, Aug 11, 2014 at 8:50 AM, Curdeius Curdeius <curdeius at gmail.com>
wrote:

> Hi,
>
> I have found a bug when using a style like:
>   AlwaysBreakAfterDefinitionReturnType: true
>   BreakBeforeBraces: Stroustrup
>
> I attach a straightforward patch that passes the tests.
> However, I think that the issue may be actually somewhere deeper, e.g. in
> `Line.Last` pointing incorrectly to a different token than l_brace (cf. the
> patch).
>
> An example.
>
>  Before:
>   template <class T>
>   T *f(T &c)  // Problem here: no line break before f
>   {
>     return NULL;
>   }
>
> After:
>   template <class T>
>   T *
>   f(T &c)
>   {
>     return NULL;
>   }
>
> Regards,
> Marek Kurdej
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140813/c1077501/attachment.html>


More information about the cfe-commits mailing list