www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - compiler crash

This is the shortest repro I've gotten so far:

D:\code\d>type test6.d
import std.stdarg;
import std.format;
import std.utf;

int unFormat( bit delegate( out dchar ) getc,
bit delegate( dchar ) ungetc,
TypeInfo[] arguments,
void* argptr )
size_t  arg = 0;
dchar[] fmt;
if( arguments[arg] is typeid( char[] ) )
fmt = toUTF32( va_arg!(char[])( argptr ) );
else if( arguments[arg] is typeid( wchar[] ) )
fmt = toUTF32( va_arg!(wchar[])( argptr ) );
else if( arguments[arg] is typeid( dchar[] ) )
fmt = va_arg!(dchar[])( argptr );
return 0;

int main()
return 0;

Also, I get a related error in the full implementation of my unformat code that
I haven't been able to produce a minimal repro for yet.  This occurred when I
started including the format string in the varargs instead of passing an
explicit format parameter.  So far as I can tell it has something to do with my
specifying both va_arg!(char[]) and va_arg!(char[]*) in the same file, but it
may be more complicated than that.  The error is:

D:\code\d>dmd -unittest unformat.d
D:\bin\dmd\bin\..\..\dm\bin\link.exe unformat,,,user32+kernel32/noi;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

D:\bin\dmd\bin\..\lib\phobos.lib(format)  Offset 16439H Record Type 00C3
Error 1: Previous Definition Different : _D3std6stdarg9va_arg_Aa6va_argFKPvZAa
--- errorlevel 1

If the crashing error is fixed I can probably narrow down the second error a bit

Jul 26 2004