www.digitalmars.com         C & C++   DMDScript  

D - another compiler GPF

the following (more bad code) crashes the compiler.

import c.stdio;

template OP( T ) {
 void lazy() {
  printf( "%.*s\n", T );
 }
 typedef void (*fp)(void) = &lazy;
}

instance OP( "one" ).fp one;
instance OP( "two" ).fp two;
instance OP( "one" ).fp oneB;

int main( char[][] argv ) {
 one();
 two();
 oneB();
}

// the instruction at "0x0040b29e" referenced memory at "0x0000000c". the
memory could not be "read"
Aug 08 2003