Changeset 41b24c8 for src/AST/Init.hpp


Ignore:
Timestamp:
May 16, 2019, 4:23:47 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
acd80b4
Parents:
e61207e7 (diff), c671112 (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/Init.hpp

    re61207e7 r41b24c8  
    2323#include "Visitor.hpp"
    2424
     25// Must be included in *all* AST classes; should be #undef'd at the end of the file
     26#define MUTATE_FRIEND template<typename node_t> friend node_t * mutate(const node_t * node);
     27
    2528namespace ast {
    2629
     
    4043private:
    4144        Designation* clone() const override { return new Designation{ *this }; }
     45        MUTATE_FRIEND
    4246};
    4347
     
    5559private:
    5660        Init * clone() const override = 0;
     61        MUTATE_FRIEND
    5762};
    5863
     
    6974private:
    7075        SingleInit * clone() const override { return new SingleInit{ *this }; }
    71 
    72         /// Must be copied in ALL derived classes
    73         template<typename node_t>
    74         friend node_t * mutate(const node_t * node);
     76        MUTATE_FRIEND
    7577};
    7678
     
    9799private:
    98100        ListInit * clone() const override { return new ListInit{ *this }; }
    99 
    100         /// Must be copied in ALL derived classes
    101         template<typename node_t>
    102         friend node_t * mutate(const node_t * node);
     101        MUTATE_FRIEND
    103102};
    104103
     
    120119private:
    121120        ConstructorInit * clone() const override { return new ConstructorInit{ *this }; }
    122 
    123         /// Must be copied in ALL derived classes
    124         template<typename node_t>
    125         friend node_t * mutate(const node_t * node);
     121        MUTATE_FRIEND
    126122};
    127123
    128124}
     125
     126#undef MUTATE_FRIEND
    129127
    130128// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.