Open llvmbot opened 10 years ago
Do we think this is subjective or objective? I honestly don't think we'd bother to fix this? who writes functions without braces?
This is completely subjective. After all, the function-try-block is an alternate function body, part of the function definition and therefore is closer to noexcept and const. It is not inside the function body.
They can be useful for avoiding indenting the entire body of a function an extra level of indentation just to make a function noexcept.
Why was the behavior here arbitrarily changed? https://discourse.llvm.org/t/a-question-regarding-formatting-of-function-try-block/49857
This seems like an area where a .clang-format option should be available to determine where to put the 'try' for Allman style braces: https://godbolt.org/z/KTGdYPxGd
I'm of the opinion it should be part of the same line as a function (like other qualifiers), and am disappointed there isn't an option to modify this behavior.
Extended Description
Example:
Attach
// {BasedOnStyle: LLVM}
Stroustrup
// {BasedOnStyle: LLVM, BreakBeforeBrace: Stroustrup}
Allman
// {BasedOnStyle: LLVM, BreakBeforeBrace: Allman}
I believe there should be break before the try keyword.