Don <> changed:

           What    |Removed                     |Added
           Keywords|                            |patch
            Summary|forward declaration of enum |Regression(2.040): forward
                   |not supported               |declaration of enum not
                   |                            |supported

--- Comment #4 from Don <> 2010-08-06 02:23:31 PDT ---
The fix to bug 1160 was what originally fixed it (in toBasetype(), do full
semantic on the enum type when forward referenced); the fix to bug 3723 broke
it again (in toBasetype(), only do semantic on the type, not on the full enum).
In this situation, it does actually does the need the full semantic to be run.

Although this test case passes in D1, I'm not convinced that D1 is correct (it
doesn't check for forward references at all).
PATCH: mtype.c, line 6340.

int TypeEnum::isZeroInit(Loc loc)
+    if (!sym->defaultval && sym->scope)
+    {   // Enum is forward referenced. We need to resolve the whole thing.
+        sym->semantic(NULL);
+    }
    if (!sym->defaultval)
#ifdef DEBUG
        printf("3: ");
        error(loc, "enum %s is forward referenced", sym->toChars());
        return 0;
    return sym->defaultval->isBool(FALSE);

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

Reply via email to