1 .. title:: clang-tidy - fuchsia-trailing-return
3 fuchsia-trailing-return
4 =======================
6 Functions that have trailing returns are disallowed, except for those using
7 ``decltype`` specifiers and lambda with otherwise unutterable return types.
14 int add_one(const int arg) { return arg; }
17 auto get_add_one() -> int (*)(const int) {
21 Exceptions are made for lambdas and ``decltype`` specifiers:
26 auto lambda = [](double x, double y) -> double {return x + y;};
29 template <typename T1, typename T2>
30 auto fn(const T1 &lhs, const T2 &rhs) -> decltype(lhs + rhs) {
35 See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en