[Issue 5025] ICE(cast.c) shared struct literal

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 29 07:21:54 PST 2010


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
         OS/Version|Linux                       |All


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-11-29 07:20:25 PST ---
Applies to any struct which contains a non-trivial type: delegate, pointer,
class, or dynamic array.
There are a few other cases where it applies, not just shared.
---
struct Bug5025 {
    int[] d;
}

shared Bug5025 b5025 = Bug5025();

const shared Bug5025 b5025a = Bug5025();

inout(Bug5025) bug5025c(inout Bug5025 xxx)
{
    return Bug5025();
}
-----------
PATCH
cast.c line 429.
-----------


        m = MATCHconst;
        for (int i = 0; i < elements->dim; i++)
        {   Expression *e = (Expression *)elements->data[i];
            Type *te = e->type;

-            if (t->mod == 0)
-                te = te->mutableOf();
-            else
-            {   assert(t->mod == MODimmutable);
-                te = te->invariantOf();
-            }

+            te = te->castMod(t->mod);

            MATCH m2 = e->implicitConvTo(te);
            //printf("\t%s => %s, match = %d\n", e->toChars(), te->toChars(),
m2);
            if (m2 < m)

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