[Issue 2962] ICE(glue.c) or bad codegen passing variable as template value parameter

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 21 12:14:43 PDT 2009


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


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|accepts-invalid,            |ice-on-valid-code
                   |ice-on-invalid-code         |


--- Comment #20 from Don <clugdbug at yahoo.com.au> 2009-09-21 12:14:39 PDT ---
Here's a reduced test case for the ice-on-valid case. dmd moduleC.d moduleA.d
The instantiation of funcD inside funcC is failing, if funcC is only
instantiated from another module. Some kind of instantiation order problem
(semantic not run, perhaps). This is definitely valid code.
Quite probably related to the other template alias ICE and bad codegen
bugs.(eg, bug 3293, bug 2325, bug 2845, ...)

moduleA.d
==========
import moduleC;

void main() {
    funcC!(bool)(1.0);
}
=====
moduleC.d
=======
void funcD(alias x)() {
   assert(x==1.0);
}

void funcC(T)(double a){
    // Case 1: ICE(glue.c)
    funcD!(a)();

    // Case 2: wrong code
    double b = 1.0; funcD!(b)();
}

-- 
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