Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Decl.hpp

    red3935da r112fe04  
    232232        AggregateDecl* set_body( bool b ) { body = b; return this; }
    233233
     234private:
     235        AggregateDecl * clone() const override = 0;
     236        MUTATE_FRIEND
     237
     238protected:
    234239        /// Produces a name for the kind of aggregate
    235240        virtual std::string typeString() const = 0;
    236 
    237 private:
    238         AggregateDecl * clone() const override = 0;
    239         MUTATE_FRIEND
    240241};
    241242
     
    255256
    256257        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     258private:
     259        StructDecl * clone() const override { return new StructDecl{ *this }; }
     260        MUTATE_FRIEND
    257261
    258262        std::string typeString() const override { return "struct"; }
    259 
    260 private:
    261         StructDecl * clone() const override { return new StructDecl{ *this }; }
    262         MUTATE_FRIEND
    263263};
    264264
     
    271271
    272272        const Decl * accept( Visitor& v ) const override { return v.visit( this ); }
     273private:
     274        UnionDecl * clone() const override { return new UnionDecl{ *this }; }
     275        MUTATE_FRIEND
    273276
    274277        std::string typeString() const override { return "union"; }
    275 
    276 private:
    277         UnionDecl * clone() const override { return new UnionDecl{ *this }; }
    278         MUTATE_FRIEND
    279278};
    280279
     
    290289
    291290        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     291private:
     292        EnumDecl * clone() const override { return new EnumDecl{ *this }; }
     293        MUTATE_FRIEND
    292294
    293295        std::string typeString() const override { return "enum"; }
    294 
    295 private:
    296         EnumDecl * clone() const override { return new EnumDecl{ *this }; }
    297         MUTATE_FRIEND
    298296
    299297        /// Map from names to enumerator values; kept private for lazy initialization
     
    309307
    310308        const Decl * accept( Visitor & v ) const override { return v.visit( this ); }
     309private:
     310        TraitDecl * clone() const override { return new TraitDecl{ *this }; }
     311        MUTATE_FRIEND
    311312
    312313        std::string typeString() const override { return "trait"; }
    313 
    314 private:
    315         TraitDecl * clone() const override { return new TraitDecl{ *this }; }
    316         MUTATE_FRIEND
    317314};
    318315
Note: See TracChangeset for help on using the changeset viewer.