Ignore:
Timestamp:
Sep 19, 2022, 11:48:13 AM (5 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master, pthread-emulation, qualifiedEnum
Children:
4520b77e
Parents:
b0d9ff7
Message:

Fix an enumerator value bug; add basic tests for new features; save the current progress before merge

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/TypeData.cc

    rb0d9ff7 r12df6fe  
    926926        list< Declaration * >::iterator members = ret->get_members().begin();
    927927        for ( const DeclarationNode * cur = td->enumeration.constants; cur != nullptr; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ), ++members ) {
    928                 if ( ret->isTyped && cur->has_enumeratorValue() ) {
     928                if ( ret->isTyped && !ret->base && cur->has_enumeratorValue() ) {
    929929                        SemanticError( td->location, "Enumerator of enum(void) cannot have an explicit initializer value." );
    930930                } else if ( cur->has_enumeratorValue() ) {
Note: See TracChangeset for help on using the changeset viewer.