--- Comment #2 from Andrej Mitrovic <> 2012-10-04 
08:25:05 PDT ---
I've found some lead:

in enum.c:

void EnumDeclaration::semantic0(Scope *sc)
    /* This function is a hack to get around a significant problem.
     * The members of anonymous enums, like:
     *  enum { A, B, C }
     * don't get installed into the symbol table until after they are
     * semantically analyzed, yet they're supposed to go into the enclosing
     * scope's table. Hence, when forward referenced, they come out as
     * 'undefined'. The real fix is to add them in at addSymbol() time.
     * But to get code to compile, we'll just do this quick hack at the moment
     * to compile it if it doesn't depend on anything else.

    if (isdone || !scope)
    if (!isAnonymous() || memtype)
    for (size_t i = 0; i < members->dim; i++)
        EnumMember *em = (*members)[i]->isEnumMember();
        if (em && (em->type || em->value))

    // Can do it

If I remove the for loop and let semantic do its work the OP code compiles. But
I don't know the extent of this hack that's in place now, whether it's still
necessary or not.

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

Reply via email to