Idaclang does not correctly handle calling convention declarations in class member functions


extern "C++"
{
	struct IUnknown333
	{
	public:
		virtual int __stdcall QueryInterface(const void* riid, void** ppvObject) = 0;

		virtual int __stdcall AddRef(void) = 0;

		virtual int __stdcall Release(void) = 0;
	};
}

int __fastcall FindWindow333(int a1, double a2);


This problem also exists in idaclang.exe. The following code is a dump of TIL generated by idaclang.exe

struct __cppobj IUnknown333 {IUnknown333_vtbl *__vftable /*VFT*/;};
struct /*VFT*/ IUnknown333_vtbl {int (__cdecl *QueryInterface)(IUnknown333 *__hidden this, const void *riid, void **ppvObject);int (__cdecl *AddRef)(IUnknown333 *__hidden this);int (__cdecl *Release)(IUnknown333 *__hidden this);};

int __cdecl ?AddRef_IUnknown333__UAGHXZ(IUnknown333 *__hidden this);
int __fastcall ?FindWindow333__YIHHN_Z(int a1, double a2);
int __cdecl ?QueryInterface_IUnknown333__UAGHPBXPAPAX_Z(IUnknown333 *__hidden this, const void *riid, void **ppvObject);
int __cdecl ?Release_IUnknown333__UAGHXZ(IUnknown333 *__hidden this);

Hello,

Indeed, it seems clang parser behaves incorrectly here. Please use the built-in parser for COM classes.

But, I need use idaclang for build a new til from many complex header files such as those using c++17 syntax, It cannot be done via the built-in parser.

As a workaround, could you try to specify stdcall as the default calling convention?