I’m trying to upgrade my project’s clang-format version from 12 to 18. No changes were made in the project’s “.clang-format” file, I’ve only upgraded the version of the clang-format program. And clang-format 18 started to format structures inherited from decltype(...)
differently.
Clang-format 12:
struct X : std::true_type
{
};
struct Y : decltype(std::true_type())
{
};
Clang-format 18:
struct X : std::true_type
{
};
struct Y : decltype(std::true_type()) {};
The AllowShortBlocksOnASingleLine
parameter in my “.clang-format” has been set to Never
, the BraceWrapping
section is defined like this:
BraceWrapping:
...
AfterClass: true
AfterStruct: true
AfterUnion: true
IndentBraces: false
SplitEmptyRecord: true
Is that a bug? Are there any workarounds to keep the old behavior with clang-format 18 and make such struct
s place their braces on separate lines, as clang-format 12 did?