[clang-format] Allow breaking before a return type of template functions.

Hi,

Given the two functions:

    SOMEMACRO
    Precision One() const;

    inline
    Precision Two() const;

    __device__
    Precision Three() const;

    template <bool ForInnerSurface>
    SOMEMACRO
    Precision TemplateOne() const;

    template <bool ForInnerSurface>
    inline
    Precision TemplateTwo() const;

    template <bool ForInnerSurface>
    __device__
    Precision TemplateThree() const;

with AlwaysBreakTemplateDeclarations set to true, I would like the code to remained unchanged after process via clang-format. However the result is

    SOMEMACRO
    Precision One() const;

    inline Precision Two() const;

    __device__ Precision Three() const;

    template <bool ForInnerSurface>
    SOMEMACRO Precision TemplateOne() const;

    template <bool ForInnerSurface>
    inline Precision TemplateTwo() const;

    template <bool ForInnerSurface>
    __device__ Precision TemplateThree() const;

Note that the macro and the keyword are treated differently for the regular function (see One() vs Two()).

In practice, clang-format seems to leave the placement of SOMEMACRO unchanged (i.e. if it was originally on the same line as the function decl, it stays there).

Is there a way to force a break *before* the return type?

Thanks,
Philippe

No, there is no way at the moment and I also don’t know whether this can even be done (considering that clang-format doesn’t have type information and doesn’t really understand macros).