Issue 60627
Summary Regression Clang-format 16: AllowShortFunctionsOnASingleLine: Inline
Labels new issue
Assignees
Reporter JVApen
    Found on our codebase comparing clang-format 13 with 16.
Relevant configuration:
AllowShortFunctionsOnASingleLine: Inline

Formatting in 13:
````
namespace NS::Inner
{
 auto function() -> std::unique_ptr<IClass> { return factory<Class, IClass>(); }
}
````

Formatting in 16:
````
namespace NS::Inner
{
   auto function() -> std::unique_ptr<IClass>
   {
 return factory<Class, IClass>();
   }
}
````

I suspect there was a change on what was considered to count for this value.
Documentation of both 13 and 16 state: `Only merge functions defined inside a class`, however, behavior of 13 seems to also merge free functions while this is no longer the case in 16.

For rolling out the upgrade of clang-format, minimal changes to formatting are preferred, such that we can roll this out without merge conflicts and do the changes to the options in a later wave one-by-one. I understand this change and it makes sense, though, having an option to ensure the old behavior will make our upgrades go more smooth.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to