[Issue 3021] D1 CTFE and enums produces error '... constant expression expected'

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 25 04:18:40 PDT 2009


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugdbug at yahoo.com.au




--- Comment #1 from Don <clugdbug at yahoo.com.au>  2009-08-25 04:18:40 PDT ---
Patch for the first case: enum.c, EnumDeclaration::semantic, line 109

        assert(e->dyncast() == DYNCAST_EXPRESSION);
        e = e->semantic(sce);
-        e = e->optimize(WANTvalue);
+        e = e->optimize(WANTvalue | WANTinterpret);
        // Need to copy it because we're going to change the type
        e = e->copy();
        e = e->implicitCastTo(sc, memtype);
-        e = e->optimize(WANTvalue);
+        e = e->optimize(WANTvalue | WANTinterpret);
        number = e->toInteger();
        e->type = t;

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