Ignore:
Timestamp:
Feb 26, 2024, 3:49:23 AM (8 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
a4da45e
Parents:
c17dc80
Message:

Add EnumPosType? to type system

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CommonType.cc

    rc17dc80 r0522ebe  
    397397                                        result = new ast::BasicType{ kind, basic->qualifiers | type2->qualifiers };
    398398                                }
     399                        }
     400                } else if ( const ast::EnumPosType * pos = dynamic_cast< const ast::EnumPosType * >( type2 ) ) {
     401                        ast::BasicType::Kind kind = commonTypes[ basic->kind ][ ast::BasicType::SignedInt ];
     402                        if (
     403                                ( ( kind == basic->kind && basic->qualifiers >= type2->qualifiers )
     404                                        || widen.first )
     405                                && ( ( kind != basic->kind && basic->qualifiers <= type2->qualifiers )
     406                                        || widen.second )
     407                        ) {
     408                                result = new ast::BasicType{ kind, basic->qualifiers | type2->qualifiers };
    399409                        }
    400410                }
Note: See TracChangeset for help on using the changeset viewer.