[clang] [clang-format] fix incorrectly indents lambda trailing return (PR #94560)

Emilia Kond via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 9 07:07:47 PDT 2024


rymiel wrote:

Technically also applies to attributes applied to the return type of the lambda, i.e.
```
int main() {
  very_long_function_name_yes_it_is_really_long(
      // also happens with constexpr specifier
      [](auto n) [[attribute]]
      -> std::enable_if_t<
          std::is_arithmetic<decltype(n)>::value &&
          !std::is_same<std::remove_cv_t<decltype(n)>, bool>::value> {
        do_something(n * 2);
      });
}
```
...but currently at least no valid C++ attribute can go in that spot

https://github.com/llvm/llvm-project/pull/94560


More information about the cfe-commits mailing list