// == minimal testcase start == alias uint DWORD; MY_API_FUNCTION lpStartAddress; // <-- comment this line to remove error extern (Windows) alias DWORD function(void*) MY_API_FUNCTION; static assert(MY_API_FUNCTION.stringof == "uint(Windows *)(void*)"); // == minimal testcase end == The actual calling convention (MY_API_FUNCTION.stringof) is "uint(*)(void*)". This is from a real-life case (the Windows header project).
For dmd 2.023 alias uint DWORD; MY_API_FUNCTION lpStartAddress; // <-- comment this line to remove error extern (Windows) alias DWORD function(void*) MY_API_FUNCTION; static assert(MY_API_FUNCTION.stringof == "uintWindows function(void*)", MY_API_FUNCTION.stringof);
Subtle and disastrous bug, raising severity.
Created attachment 465 [details] evaluate forward referenced alias in correct scope The forward reference to the alias causes its semantic analysis to be run from the scope of the variable declaration, omitting the "extern(Windows)" attribute. The patch uses the scope of the symbol (which happens to already exist) instead of the current scope. The patch also fixes the bad spacing "uintWindows".
the patch is against dmd 2.032
You're a legend! This was on my list of ten most worst bugs in DMD.
Fixed dmd 1.048 and 2.033
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル