Ignore:
Timestamp:
Jun 29, 2024, 5:02:06 AM (10 days ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
4117761
Parents:
7552fde
Message:

Fix the bug that C style enum cannot to use as an lvalue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CommonType.cpp

    r7552fde r5ccc733  
    386386                } else if ( const ast::EnumInstType * enumInst = dynamic_cast< const ast::EnumInstType * >( type2 ) ) {
    387387                        const ast::EnumDecl* enumDecl = enumInst->base;
    388                         if ( !enumDecl->base ) {
     388                        if ( !enumDecl->isCfa ) {
    389389                                ast::BasicKind kind = commonTypes[ basic->kind ][ ast::BasicKind::SignedInt ];
    390390                                if (
     
    642642                        const ast::EnumDecl* argDecl = argAsEnumInst->base;
    643643                        if (argDecl->isSubTypeOf(paramDecl)) result = param;
    644                 } else if ( param->base && !param->base->isTyped ) {
     644                } else if ( param->base && !param->base->isCfa ) {
    645645                        auto basicType = new ast::BasicType( ast::BasicKind::UnsignedInt );
    646646                        result = commonType( basicType, type2, tenv, need, have, open, widen);
Note: See TracChangeset for help on using the changeset viewer.