Changeset 63be3387 for src/AST/Decl.hpp


Ignore:
Timestamp:
Nov 14, 2022, 11:52:44 AM (3 years ago)
Author:
caparson <caparson@…>
Branches:
ADT, ast-experimental, master
Children:
7d9598d8
Parents:
b77f0e1 (diff), 19a8c40 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    rb77f0e1 r63be3387  
    105105        ptr<Init> init;
    106106        ptr<Expr> bitfieldWidth;
    107         bool enumInLine = false; // enum inline is not a real object declaration.
    108         // It is a place holder for a set of enum value (ObjectDecl)
    109         bool importValue = false; // if the value copied from somewhere else
    110107
    111108        ObjectDecl( const CodeLocation & loc, const std::string & name, const Type * type,
     
    400397};
    401398
     399/// Static Assertion `_Static_assert( ... , ... );`
    402400class StaticAssertDecl : public Decl {
    403401public:
     
    411409private:
    412410        StaticAssertDecl * clone() const override { return new StaticAssertDecl( *this ); }
     411        MUTATE_FRIEND
     412};
     413
     414/// Inline Member Declaration `inline TypeName;`
     415class InlineMemberDecl final : public DeclWithType {
     416public:
     417        ptr<Type> type;
     418
     419        InlineMemberDecl( const CodeLocation & loc, const std::string & name, const Type * type,
     420                Storage::Classes storage = {}, Linkage::Spec linkage = Linkage::Cforall,
     421                std::vector< ptr<Attribute> > && attrs = {}, Function::Specs fs = {} )
     422        : DeclWithType( loc, name, storage, linkage, std::move(attrs), fs ), type( type ) {}
     423
     424        const Type * get_type() const override { return type; }
     425        void set_type( const Type * ty ) override { type = ty; }
     426
     427        const DeclWithType * accept( Visitor& v ) const override { return v.visit( this ); }
     428private:
     429        InlineMemberDecl * clone() const override { return new InlineMemberDecl{ *this }; }
    413430        MUTATE_FRIEND
    414431};
Note: See TracChangeset for help on using the changeset viewer.