https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64384
Alvin Wong <alvinhochun at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alvinhochun at gmail dot com --- Comment #8 from Alvin Wong <alvinhochun at gmail dot com> --- According to https://devblogs.microsoft.com/oldnewthing/20220113-00/?p=106152, Microsoft acknowledged that the behaviour is different between free function and C++ member functions, and that it does cause breakage of the COM ABI between C and C++. What they have done is to update the MIDL compiler to generate C bindings compatible with the C++ ABI. (I filed https://bugs.winehq.org/show_bug.cgi?id=54226 for implementing the same function in widl.) In this sense, the current behaviour of gcc and g++ regarding free functions should be correct and does not need fixing. Only the ABI for C++ class member functions are wrong.