www.digitalmars.com         C & C++   DMDScript  

D - DMD 0.52 release

reply "Walter" <walter digitalmars.com> writes:
www.digitalmars.com/d/changelog.html
Feb 05 2003
next sibling parent reply "Sean L. Palmer" <seanpalmer directvinternet.com> writes:
Hmm.. are you sure you fixed using a template inside a with clause?

template VecTemplate(tfloat)

{

    struct Vector

    {

        tfloat d;

    }

}

int main(char[][] args)

{

    with (instance VecTemplate(int)) // crash DMD

    {

    }

    return 0;

}



"Walter" <walter digitalmars.com> wrote in message
news:b1qqta$2tf2$1 digitaldaemon.com...
 www.digitalmars.com/d/changelog.html
Feb 05 2003
parent reply "Walter" <walter digitalmars.com> writes:
I fixed your previous example of it. I'll add this one to the bug
list. -Walter
Feb 05 2003
parent reply "Sean L. Palmer" <seanpalmer directvinternet.com> writes:
Actually this is a distilled example of my original bug, which still crashed
after upgrading to DMD 0.52.  I went back to the original code (which hadn't
changed since I posted the report) and uncommented the "I dare you" line,
and compiled.  POOF!

You may have fixed a different bug than what I was (and still am) seeing.

Sean

"Walter" <walter digitalmars.com> wrote in message
news:b1rqrg$g09$1 digitaldaemon.com...
 I fixed your previous example of it. I'll add this one to the bug
 list. -Walter
Feb 06 2003
parent "Walter" <walter digitalmars.com> writes:
Hmm, I wonder what happened. The test case is in my regression tests.

"Sean L. Palmer" <seanpalmer directvinternet.com> wrote in message
news:b1t83j$19ri$1 digitaldaemon.com...
 Actually this is a distilled example of my original bug, which still
crashed
 after upgrading to DMD 0.52.  I went back to the original code (which
hadn't
 changed since I posted the report) and uncommented the "I dare you" line,
 and compiled.  POOF!

 You may have fixed a different bug than what I was (and still am) seeing.
Feb 06 2003
prev sibling next sibling parent "Mike Wynn" <mike.wynn l8night.co.uk> writes:
more ways to crash the compiler;
note some bits are commented out it crashes if they are not too (trying to
create some test code for another problem)

/*
template base( T )
{
 void errfunc() { throw new Exception("no init"); }
 typedef T safeptr = cast(T)&errfunc;
}
*/

template func0( T )
{
 instance base( fp ) safe;
 alias safe.safeptr fp;
}

instance func0( int ) I_V_fp;
//I_V_fp.fp tc;
int main( char[][] args )
{
 return 0; //tc();
}


"Walter" <walter digitalmars.com> wrote in message
news:b1qqta$2tf2$1 digitaldaemon.com...
 www.digitalmars.com/d/changelog.html
Feb 08 2003
prev sibling parent "Mike Wynn" <mike.wynn l8night.co.uk> writes:
another odd error message ..

Expression TOK26
tet3.d(5): Integer constant expression expected instead of &errfunc

template base( T )
{
 void errfunc() { throw new Exception("no init"); }
 typedef T safeptr = cast(T)&errfunc;
}

alias int (*mfp)(int);
// alias void (*mfp)(); // works (as you would expect)
instance base( mfp ) I_V_fp;

int main( char[][] args )
{
 return 0; //tc();
}

----------------------------------------------
I know
 typedef T safeptr = cast(T)&errfunc;
is a bit bad if the T is a func pointer to a pascal or stdcall method that
takes params
but there's no way to write
T foo = { throw ... }; typedef safe = foo; or typedef T safe = { throw
... };
or &{}

Mike.

"Walter" <walter digitalmars.com> wrote in message
news:b1qqta$2tf2$1 digitaldaemon.com...
 www.digitalmars.com/d/changelog.html
Feb 08 2003