Changeset bb336a6 for src/AST


Ignore:
Timestamp:
Jul 10, 2024, 3:39:26 AM (9 days ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
dbff8ec
Parents:
550afde2
Message:

Fixed the problem when enum use another enumerator as initializer

Location:
src/AST
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Create.cpp

    r550afde2 rbb336a6  
    7676}
    7777
     78EnumDecl * asForward( EnumDecl const * decl ) {
     79        if ( !decl->body ) {
     80                return nullptr;
     81        }
     82        EnumDecl * fwd = new EnumDecl( decl->location,
     83                decl->name,
     84                decl->isCfa,
     85                vectorCopy( decl->attributes ),
     86                decl->linkage,
     87                decl->base,
     88                decl->hide
     89        );
     90        fwd->params = vectorCopy( decl->params );
     91        return fwd;
    7892}
     93
     94}
  • src/AST/Create.hpp

    r550afde2 rbb336a6  
    2424StructDecl * asForward( StructDecl const * );
    2525UnionDecl * asForward( UnionDecl const * );
     26EnumDecl * asForward( EnumDecl const * );
    2627
    2728}
Note: See TracChangeset for help on using the changeset viewer.