Ignore:
Timestamp:
Sep 1, 2022, 1:27:52 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
12df6fe
Parents:
def751f
Message:

Fix up the QualifiedNameExpr?. It should now work on both old AST and new AST. There are some known bugs to fix so make all-tests will fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/Declaration.h

    rdef751f rb0d9ff7  
    145145        virtual void printShort( std::ostream & os, Indenter indent = {} ) const override;
    146146
    147         // TODO: Move to the right place
    148147        void checkAssignedValue() const;
    149148};
     
    338337        typedef AggregateDecl Parent;
    339338  public:
     339        bool isTyped;
     340        Type * base;
     341
    340342        EnumDecl( const std::string & name,
    341343         const std::list< Attribute * > & attributes = std::list< class Attribute * >(),
    342           LinkageSpec::Spec linkage = LinkageSpec::Cforall,
    343           Type * baseType = nullptr ) : Parent( name, attributes, linkage ) , base( baseType ){}
    344         EnumDecl( const EnumDecl & other ) : Parent( other ), base( other.base ) {}
    345 
     344          bool isTyped = false, LinkageSpec::Spec linkage = LinkageSpec::Cforall,
     345          Type * baseType = nullptr )
     346          : Parent( name, attributes, linkage ),isTyped(isTyped), base( baseType ) {}
     347        EnumDecl( const EnumDecl & other )
     348          : Parent( other ), isTyped( other.isTyped), base( other.base ) {}
    346349        bool valueOf( Declaration * enumerator, long long int & value );
    347 
    348350        virtual EnumDecl * clone() const override { return new EnumDecl( *this ); }
    349351        virtual void accept( Visitor & v ) override { v.visit( this ); }
    350352        virtual void accept( Visitor & v ) const override { v.visit( this ); }
    351353        virtual Declaration * acceptMutator( Mutator & m )  override { return m.mutate( this ); }
    352         Type * base;
    353         std::unordered_map< std::string, long long int > enumValues;
     354
     355        std::unordered_map< std::string, long long int > enumValues; // This attribute is unused
    354356        virtual void print( std::ostream & os, Indenter indent = {} ) const override final;
    355357  private:
Note: See TracChangeset for help on using the changeset viewer.