Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    r10a1225 r9d6e7fa9  
    232232        AggregateDecl* set_body( bool b ) { body = b; return this; }
    233233
    234 private:
    235         AggregateDecl * clone() const override = 0;
    236         MUTATE_FRIEND
    237 
    238 protected:
    239234        /// Produces a name for the kind of aggregate
    240235        virtual std::string typeString() const = 0;
     236
     237private:
     238        AggregateDecl * clone() const override = 0;
     239        MUTATE_FRIEND
    241240};
    242241
     
    256255
    257256        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     257
     258        std::string typeString() const override { return "struct"; }
     259
    258260private:
    259261        StructDecl * clone() const override { return new StructDecl{ *this }; }
    260262        MUTATE_FRIEND
    261 
    262         std::string typeString() const override { return "struct"; }
    263263};
    264264
     
    271271
    272272        const Decl * accept( Visitor& v ) const override { return v.visit( this ); }
     273
     274        std::string typeString() const override { return "union"; }
     275
    273276private:
    274277        UnionDecl * clone() const override { return new UnionDecl{ *this }; }
    275278        MUTATE_FRIEND
    276 
    277         std::string typeString() const override { return "union"; }
    278279};
    279280
     
    286287
    287288        /// gets the integer value for this enumerator, returning true iff value found
    288         bool valueOf( Decl* enumerator, long long& value ) const;
    289 
    290         const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     289        bool valueOf( const Decl * enumerator, long long& value ) const;
     290
     291        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     292
     293        std::string typeString() const override { return "enum"; }
     294
    291295private:
    292296        EnumDecl * clone() const override { return new EnumDecl{ *this }; }
    293297        MUTATE_FRIEND
    294 
    295         std::string typeString() const override { return "enum"; }
    296298
    297299        /// Map from names to enumerator values; kept private for lazy initialization
     
    307309
    308310        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     311
     312        std::string typeString() const override { return "trait"; }
     313
    309314private:
    310315        TraitDecl * clone() const override { return new TraitDecl{ *this }; }
    311316        MUTATE_FRIEND
    312 
    313         std::string typeString() const override { return "trait"; }
    314317};
    315318
     
    329332class StaticAssertDecl : public Decl {
    330333public:
    331         ptr<Expr> condition;
     334        ptr<Expr> cond;
    332335        ptr<ConstantExpr> msg;   // string literal
    333336
    334337        StaticAssertDecl( const CodeLocation & loc, const Expr * condition, const ConstantExpr * msg )
    335         : Decl( loc, "", {}, {} ), condition( condition ), msg( msg ) {}
     338        : Decl( loc, "", {}, {} ), cond( condition ), msg( msg ) {}
    336339
    337340        const StaticAssertDecl * accept( Visitor &v ) const override { return v.visit( this ); }
Note: See TracChangeset for help on using the changeset viewer.