Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/AlternativeFinder.cc

    r4d2d45f9 rd76c588  
    2828#include "Alternative.h"           // for AltList, Alternative
    2929#include "AlternativeFinder.h"
     30#include "AST/Expr.hpp"
     31#include "AST/Type.hpp"
    3032#include "Common/SemanticError.h"  // for SemanticError
    3133#include "Common/utility.h"        // for deleteAll, printAll, CodeLocation
     
    222224                        cost.incReference();
    223225                }
     226        }
     227
     228        const ast::Expr * referenceToRvalueConversion( const ast::Expr * expr, Cost & cost ) {
     229                if ( expr->result.as< ast::ReferenceType >() ) {
     230                        // cast away reference from expr
     231                        cost.incReference();
     232                        return new ast::CastExpr{ expr->location, expr, expr->result->stripReferences() };
     233                }
     234               
     235                return expr;
    224236        }
    225237
Note: See TracChangeset for help on using the changeset viewer.