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/AST/Convert.cpp

    r786c438 r3e54399  
    305305        }
    306306
    307         const ast::Decl * visit( const ast::EnumDecl * node ) override final { // Marker: what is this for?
    308         // Called in ConverterNewToOld
     307        const ast::Decl * visit( const ast::EnumDecl * node ) override final {
    309308                if ( inCache( node ) ) return nullptr;
    310309                auto decl = new EnumDecl(
    311310                        node->name,
    312311                        get<Attribute>().acceptL( node->attributes ),
    313                         LinkageSpec::Spec( node->linkage.val )
     312                        LinkageSpec::Spec( node->linkage.val ),
     313                        get<Type>().accept1(node->base)
    314314                );
    315315                return aggregatePostamble( decl, node ); // Node info, including members, processed in aggregatePostamble
     
    27682768        }
    27692769
    2770         virtual void visit( const EnumInstType * old ) override final {
    2771                 ast::EnumInstType * ty;
     2770        virtual void visit( const EnumInstType * old ) override final { // Here is visiting the EnumInst Decl not the usage.
     2771                ast::EnumInstType * ty; 
    27722772                if ( old->baseEnum ) {
    27732773                        ty = new ast::EnumInstType{
Note: See TracChangeset for help on using the changeset viewer.