Environment
The tested v19 clang-format executable was built from latest source of 13.03.2024. Also tested with clang-format 17.0.3.
Setting in .clang-format is:
Language: Cpp
PointerAlignment: Left
SpaceAroundPointerQualifiers: Before
Problem
class A {
public:
int B;
};
void function(int A::* parameter, int* parameter2) {
int A::* variable = &A::B;
int* A::B;
}
formats to
class A {
public:
int B;
};
void function(int A::*parameter, int* parameter2) {
int A::*variable = &A::B;
int* A::B;
}
For the pointers to member field we expect the space between the ::* and the variable/parameter name to be there and NOT removed.