Talk:Visual C++ name mangling

Data Type
It appears that  may be a type modifier, but I'm unsure of the specifics, or whether it's actually used by the compiler.

I'm not sure, but I think  might be a modifier that indicates that the following is to be interpreted as a raw type regardless of anything else, or it might tell the undecorator not to try to expand numbers as abbreviated names. Or it might do something else, I honestly don't know.

[Tested with Visual Studio 2010. I would test with Studio 2015, but I'm unable to do so directly at the moment, and can't use the online compiler since I don't know how to use  or   in Studio 2015.

It also appears that the code  is associated with Managed Extensions for C++ (and possibly C++/CLI), although I'm unsure of its exact meaning.

Similarly, C++/CLI uses, generating one signature with it and one without.

I'm unsure of what exactly this means. I suspect it's part of the "IJW" mechanism, and allows native C++ code to link to the C++/CLI functions, but that's just a guess. 24.222.178.254 (discuss) 16:31, 1 May 2016 (UTC)

Okay, I've found what  is for. It indicates that a function symbol is for the managed entry point; the one without  is the native entry point (for mixed native C++ and C++/CLI code, and appears to simply pass the call to the   version.

To test this, I made a simplified version of the above C++/CLI, that only exports :

I then compiled it with, and obtained the following ASM file:

From this, compiling  above with   (which only generated   symbols, and no  s), compiling a native function  with   (which generated the symbols ,  , and  ), and the MSDN "Double Thunking" article, it appears that   indicates that a function is managed. It also appears that when managed and native versions of a function are generated, the native one will be a stub that uses the  symbol to call the managed one.

That's one symbol down, one to go! 24.222.178.254 (discuss) 18:47, 1 May 2016 (UTC)

Did more testing with, and it appears that the "managed" prefix comes before the "based" prefix.

"?a@@$$F_Y2X@@AXXZ" == "void __cdecl __based(X) a(void)" "?a@@$$F_Y0AXXZ" == "void __cdecl __based(void) a(void)" "?a@@_$$FY0AXXZ" == " ?? const volatile ?? ::XZ::& ?? a( ?? ) throw( ?? )"

Updated the main page.

24.222.178.254 (discuss) 19:54, 1 May 2016 (UTC)

Access types
Here's a more exhaustive list of the access types taken from Clang's MicrosoftMangle.cpp. Would be great to incorporate these and the other information found in Clang's mangler into the wiki, but that would almost require a total rewrite of the page. I also think these should be called Declaration Classes instead of Access Types.

--PhilipNO (discuss • contribs) 03:17, 6 June 2021 (UTC)