Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |patch

--- Comment #6 from Don <>  2009-09-01 08:24:13 PDT ---
And here's a patch.
Cause: The initializer is used in declaration.c, VarDeclaration::semantic().
We see the lines:
            Expression *e = init->toExpression();
            if (!e)
            init = init->semantic(sc, type);
            e = init->toExpression();
            if (!e)
The initializer is supposed to return NULL if the initializer semantic hasn't
been run yet. But the array initializer doesn't -- it prints an error, and
returns an ErrorExp instead! It never has a chance.

PATCH: init.c, last lines of ArrayInitializer::toExpression() (around line

    delete elements;
-   error(loc, "array initializers as expressions are not allowed");
-   return new ErrorExp();
+    return NULL;

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to