Ignore:
Timestamp:
Jul 27, 2017, 2:04:55 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:
175ad32
Parents:
00e80b6
Message:

Fix tuple assignment for tuple expression LHS by adding reference cast to every component

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleAssignment.cc

    r00e80b6 r7d49b72  
    203203                        }
    204204                }
     205
     206                for ( ResolvExpr::Alternative & alt : lhs ) {
     207                        // every LHS value must be a reference - some come in with a cast expression, if it doesn't just cast to reference here.
     208                        // TODO: can this somehow be merge with the cast code directly above?
     209                        if ( ! dynamic_cast< ReferenceType * >( alt.expr->get_result() ) ) {
     210                                alt.expr = new CastExpr( alt.expr, new ReferenceType( Type::Qualifiers(), alt.expr->get_result()->clone() ) );
     211                        }
     212                }
    205213        }
    206214
Note: See TracChangeset for help on using the changeset viewer.