[cfe-commits] r107264 - in /cfe/trunk: lib/CodeGen/MicrosoftCXXABI.cpp test/CodeGenCXX/mangle-ms.cpp

Sean Hunt rideau3 at gmail.com
Wed Jun 30 20:27:51 PDT 2010

On 06/30/2010 07:20 PM, Charles Davis wrote:
> On 6/30/10 6:04 PM, Sean Hunt wrote:
>> How does MSVC mangle void foo(int*)? Is it actually different from void
>> foo(int * const)?
> The first one is mangled '?foo@@YAXPAH at Z', the second '?foo@@YAXQAH at Z'.
> So yeah, they're different. Microsoft designed the mangling scheme so
> that it is possible to recover the entire C++ declaration (with MS
> extensions, of course) from the mangled name. (IIUC, they did this to
> enforce the ODR.)
> Chip

Does the following conforming program fail to link, then?:

// File 1

void foo (int*);

int main() { foo(0); }

// File 2

void foo (int * const) {}

// End of files


More information about the cfe-commits mailing list