[clang-format] Trailing return type

Hi,

I'm looking for clang-format features to control formatting of
functions with trailing return type.

I found this related change
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20150601/130293.html

What are the options to control the formatting presented in that message?
Namely, how to achieve the "After" formatting as copied here?

Before:
  template <typename T>
  auto aaaaaaaaaaaaaaaaaaaaaa(T t) -> decltype(eaaaaaaaaaaaaaaa<T>(t.a)
                                                   .aaaaaaaa());

After:
  template <typename T>
  auto aaaaaaaaaaaaaaaaaaaaaa(T t)
      -> decltype(eaaaaaaaaaaaaaaa<T>(t.a).aaaaaaaa());

There seem to be nothing related to trailing return or arrow formatting
on https://clang.llvm.org/docs/ClangFormatStyleOptions.html

Best regards,

I think that was a bug fix as the latest clang-format will convert the “Before” code to “After” even in the absence of the .clang-format configuration file.

Regards,
Owen

Thanks for the hint.
I upgraded from 6.0 to 7.0 and it does handle the trailing return types indeed.

I noticed one issue which I wonder if it does qualify for a bug report:

TL;TR: arrow followed by typename keyword is not handled

Before:

template <int K, typename E, typename L, int N>
auto bbbbbbbbbbbbbbbbbbbbbbb(detail::base<E, L, N>& p) -> typename
std::add_lvalue_reference<E>::type;

After:

template <int K, typename E, typename L, int N>
auto bbbbbbbbbbbbbbbbbbbbbbb(detail::base<E, L, N> &p) ->
    typename std::add_lvalue_reference<E>::type;

Whereas, if typename is removed:

Before

template <int K, typename E, typename L, int N>
auto ccccccccccccccccccccccc(detail::base<E, L, N>& p) ->
std::add_lvalue_reference<E>::type;

After:

template <int K, typename E, typename L, int N>
auto ccccccccccccccccccccccc(detail::base<E, L, N> &p)
    -> std::add_lvalue_reference<E>::type;

Best regards,

FYI, I've reported it as a bug (took me a while!)

https://bugs.llvm.org/show_bug.cgi?id=42835

Best regards,

Looks like thread inter-linking as not quite worked,
so here is old thread

http://lists.llvm.org/pipermail/cfe-users/2018-November/001421.html

Best regards,