We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.clang-format:
BasedOnStyle: Google
Here is the formatted code when lambda doesn't have constexpr/noexcept specifier:
#include <type_traits> void very_long_function_name_yes_it_is_really_long(...); void do_something(...); int main() { very_long_function_name_yes_it_is_really_long( [](auto n) -> 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); }); }
As expected trailing return arrow is indented 4 spaces after the lambda. But adding constexpr or noexcept specifier after lambda makes it 0 spaces:
#include <type_traits> void very_long_function_name_yes_it_is_really_long(...); void do_something(...); int main() { very_long_function_name_yes_it_is_really_long( // also happens with constexpr specifier [](auto n) noexcept -> 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); }); }
Somewhat surprisingly, this issue doesn't happen when noexcept specifier with expression is used (e.g. noexcept(true)).
noexcept(true)
clang-format version: 17.0.6 OS: EndeavourOS Linux, kernel 6.9.3-arch1-1
The text was updated successfully, but these errors were encountered:
[clang-format] Fix a bug in indenting lambda trailing arrows (#94560)
d9593c1
Closes #94181
[clang-format] Fix a bug in indenting lambda trailing arrows (llvm#94560
fe9c4ee
) Closes llvm#94181
Successfully merging a pull request may close this issue.
.clang-format:
Here is the formatted code when lambda doesn't have constexpr/noexcept specifier:
As expected trailing return arrow is indented 4 spaces after the lambda. But adding constexpr or noexcept specifier after lambda makes it 0 spaces:
Somewhat surprisingly, this issue doesn't happen when noexcept specifier with expression is used (e.g.
noexcept(true)
).clang-format version: 17.0.6
OS: EndeavourOS Linux, kernel 6.9.3-arch1-1
The text was updated successfully, but these errors were encountered: