clang-format version 18.1.8 and default config
Formatting following code will replicate the issue.
#pragma once
namespace Helper {
// Correct: CMyClass& myclass
HRESULT GetSomething(CMyClass& myclass);
interface MyInterface {
// Wrong: CMyClass & myclass
HRESULT GetSomethingElse(CMyClass& myclass);
}
}
Clang-format with default config will change formatting a lot but the probem is that when references or pointers to function parameters are first parameters there is an extra space.
You get:
CMyClass & myclass
Instead of:
CMyClass& myclass
But this is only if there is a nested scope (like with MSVC interface) and object is first paramater.