[cfe-dev] clang-format: Return type in its own line for function definitions

Eli Bendersky eliben at google.com
Thu Sep 25 18:29:38 PDT 2014


On Thu, Sep 25, 2014 at 6:19 PM, Damian Lezama <Damian.Lezama at riverbed.com>
wrote:

> Hi,
>
> Our code standards ask for the return type in its own line for function
> definitions (if not inside the class declaration), how can I make that work?
>
> Header:
> class A
> {
>     int a() { }
>     int b();
> }
>
> Source:
> int
> A::b()
> {
>     // something
> }
>

There's the *AlwaysBreakAfterDefinitionReturnType * style option. It (along
with the others) is documented at:
http://clang.llvm.org/docs/ClangFormatStyleOptions.html

Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140925/2231a154/attachment.html>


More information about the cfe-dev mailing list