Ignore:
Timestamp:
Mar 10, 2022, 2:03:43 AM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
f238fcc2
Parents:
786c438
Message:

The compiler now will add a cast to base type for the usage of type enum; but it will fail because of violating some restrictions for the auto-gen functions. Need to investiage more

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r786c438 r3e54399  
    11381138                        declsToAddBefore.push_back( new UnionDecl( aggDecl->name, noAttributes, tyDecl->linkage ) );
    11391139                } else if ( EnumInstType * enumDecl = dynamic_cast< EnumInstType * >( designatorType ) ) {
    1140                         declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage ) );
     1140                        // declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage, enumDecl->baseEnum->base ) );
     1141                        if (enumDecl->baseEnum) {
     1142                                declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage, enumDecl->baseEnum->base ) );
     1143                        } else {
     1144                                declsToAddBefore.push_back( new EnumDecl( enumDecl->name, noAttributes, tyDecl->linkage ) );
     1145                        }
    11411146                } // if
    11421147                return tyDecl->clone();
Note: See TracChangeset for help on using the changeset viewer.