class Test {
public:
__stdcall Test()
{
int x = 0;
++x;
}
};
int main(int argc, char** argv)
{
Test t;
return 0;
}
Why is the constructor declared to use the stdcall convention as opposed to thiscall? It doesn't actually seem to affect the assembly in debug mode (the following appears to be thiscall convention):
12: Test t;
0108143E lea ecx,[t]
01081441 call Test::Test (010810E1h)
13:
14: return 0;
01081446 xor eax,eax
And Microsoft seems to confirm:
When you use the __stdcall keyword on a non-static member function, such as a constructor, the compiler will use the thiscall calling convention."[/quote]
This was only tested in VS2012 so maybe this stdcall->thiscall behavior is implementation specific?