[Issue 4828] ICE w/ non-boolean dot expression sth.template_instance in static if

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 5 23:29:20 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4828



--- Comment #1 from Shin Fujishiro <rsinfu at gmail.com> 2010-09-05 23:28:59 PDT ---
Created an attachment (id=748)
Patch against dmd r660, implements DotExp::toCBuffer()

The attached patch implements DotExp::toCBuffer().

The syntax `something.template_instance` yields a DotExp.  The repro code in
comment #0 is invalid, and the compiler tries to generate an error message. 
Then it calls toCBuffer() on the DotExp object, but it's not overridden, so the
base class' BinExp::toCBuffer() is invoked.

It hits the assertion because `precedence[TOKdotexp]` is PREC_zero:
--------------------
void BinExp::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
{
    expToCBuffer(buf, hgs, e1, precedence[op]); // op == TOKdotexp
...
--------------------

So, DotExp::toCBuffer() needs to be implemented to handle this case.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list