You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that cdtors (as they pedantically have no name?) do not pay attention to AfterFunctionDeclarationName: true or AfterFunctionDefinitionName: true with SpaceBeforeParens: custom style options. Aesthetically this is undesired -- the space in the declaration/definition makes the name stand out more.
/*
.clang-format contents:
BasedOnStyle: LLVM
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterFunctionDeclarationName: true
AfterFunctionDefinitionName: true
*/
struct A {
// space before (, as expected
void frob(); // void frob ();
// no space before (, unexpected
A (int); // A(int);
A (int) {} // A(int) {}
~A (); // ~A();
~A (); // ~A() {}
};
void fn (A &a)
{
// no space before (, expected
(void)A (); // (void)A();
a.frob (); // a.frob();
a.~A (); // a.~A();
}
Perhaps the type should be considered the name in these cases? or a new cdtor-specific spacing option?