Ignore:
Timestamp:
Jul 17, 2017, 3:25:58 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
795d450
Parents:
7ebaa56
Message:

Fix TupleAssignment? code for references

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SynTree/ReferenceType.cc

    r7ebaa56 re6cee92  
    1919
    2020ReferenceType::ReferenceType( const Type::Qualifiers &tq, Type *base, const std::list< Attribute * > & attributes )
    21   : Type( tq, attributes ), base( base ) {
     21        : Type( tq, attributes ), base( base ) {
     22        assertf( base, "Reference Type with a null base created." );
    2223}
    2324
    2425ReferenceType::ReferenceType( const ReferenceType &other )
    25   : Type( other ), base( maybeClone( other.base ) ) {
     26        : Type( other ), base( maybeClone( other.base ) ) {
    2627}
    2728
    2829ReferenceType::~ReferenceType() {
    29   delete base;
     30        delete base;
     31}
     32
     33int ReferenceType::referenceDepth() const {
     34        return base->referenceDepth()+1;
    3035}
    3136
    3237void ReferenceType::print( std::ostream &os, int indent ) const {
    33   Type::print( os, indent );
    34   os << "reference to ";
    35   if ( base ) {
    36     base->print( os, indent );
    37   } // if
     38        Type::print( os, indent );
     39        os << "reference to ";
     40        if ( base ) {
     41                base->print( os, indent );
     42        } // if
    3843}
    3944
Note: See TracChangeset for help on using the changeset viewer.