extern(Windows) alias bug

Walter Bright newshound at digitalmars.com
Fri Jun 2 12:05:17 PDT 2006


John C wrote:
> The following are not equivalent, though I can't understand why not.
> 
> template TFunc1() {
>   extern(Windows) alias int function(int) TFunc1;
> }
> 
> alias int function(int) funcA;
> template TFunc2() {
>   extern(Windows) alias funcA TFunc2;
> }
> 
> void main() {
>   writefln(TFunc1!().mangleof); // PWiZi
>   writefln(TFunc2!().mangleof); // PFiZi
> }
> 
> So the extern(Windows) gets applied to TFunc1, but not TFunc2.

That's right. An alias does not modify the calling convention of 
whatever it is calling. It cannot, it is just another name for it.



More information about the Digitalmars-d-bugs mailing list