compiler assertion failure w/ templates

Bill Baxter dnewsgroup at billbaxter.com
Sun Dec 17 16:02:12 PST 2006


Bugzilla is back.  URL is:
http://d.puremagic.com/issues/
I think how to use it is pretty self-explanatory.

--bb

Dan wrote:
> The following code:
> 
> static int _i=0;
> 
> template NEXT(int idx) {
>   const NEXT = idx;
> }
> 
> interface Protocol {
>   static ubyte HELO = NEXT!(_i++);
> }
> 
> void main() { }
> 
> causes the Win32 dmd compiler to error with the following:
> 
> C:\>dmd z.d
> global.errors = 0, gag = 0
> 00936D54 ++ type=int e1=00962524 e2=00936D78
>   00962524 var var=_i type=int
>   00936D78 1 type=int
> Assertion failure: '0' on line 775 in file 'expression.c'
> 
> abnormal program termination
> 
> --- errorlevel 1
> 
> --Dan
> 
> P.S. Is Bugzilla still down?  If not, how do I post bugs formally and/or
> review if they're already reported?


More information about the Digitalmars-d-bugs mailing list