Ignore:
Timestamp:
Feb 3, 2025, 11:46:55 AM (11 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
54f70c6
Parents:
bbbff10
Message:

I set out to do a enum rework. It ended up being much the same and I unwound the core rework. But I hope the new names are a bit clearer and other minor fixes are helpful, so I am keeping those.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ResolveTypeof.cpp

    rbbbff10 r90e683b  
    6262                        // replace basetypeof(<enum>) by int
    6363                        auto enumInst = newType.as< ast::EnumInstType >();
    64                         if ( enumInst && (!enumInst->base || !enumInst->base->isCfa) ) {
     64                        if ( enumInst && (!enumInst->base || enumInst->base->is_c_enum() ) ) {
    6565                                newType = new ast::BasicType(
    6666                                        ast::BasicKind::SignedInt, newType->qualifiers, copy(newType->attributes) );
     
    144144
    145145        auto enumInst = decl->type.as<ast::EnumInstType>();
    146         if ( enumInst && enumInst->base->isCfa ) {
     146        if ( enumInst && !enumInst->base->is_c_enum() ) {
    147147                if ( auto init = decl->init.as<ast::SingleInit>() ) {
    148148                        if ( auto initExpr = init->value.as<ast::ConstantExpr>() ) {
    149149                                if ( initExpr->result.as<ast::ZeroType>() ) {
    150                                         auto newInit = new ast::SingleInit( init->location, 
     150                                        auto newInit = new ast::SingleInit( init->location,
    151151                                                ast::UntypedExpr::createCall( init->location, "lowerBound", {} )
    152152                                        );
Note: See TracChangeset for help on using the changeset viewer.