Changeset 8b34df0 for src


Ignore:
Timestamp:
Jun 17, 2019, 1:08:35 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
aba20d2
Parents:
120a28c3
Message:

Removed incorrect copying in InferredParameters? conversion

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r120a28c3 r8b34df0  
    576576                if ( srcInferred.mode == ast::Expr::InferUnion::Params ) {
    577577                        const ast::InferredParams &srcParams = srcInferred.inferParams();
    578                         for (auto srcParam : srcParams) {
    579                                 tgtInferParams[srcParam.first] = ParamEntry(
     578                        for (auto & srcParam : srcParams) {
     579                                auto res = tgtInferParams.emplace(srcParam.first, ParamEntry(
    580580                                        srcParam.second.decl,
    581581                                        get<Declaration>().accept1(srcParam.second.declptr),
     
    583583                                        get<Type>().accept1(srcParam.second.formalType),
    584584                                        get<Expression>().accept1(srcParam.second.expr)
    585                                 );
     585                                ));
     586                                assert(res.second);
    586587                        }
    587588                } else if ( srcInferred.mode == ast::Expr::InferUnion::Slots  ) {
     
    20022003                if ( !oldInferParams.empty() ) {
    20032004                        ast::InferredParams &tgt = newInferred.inferParams();
    2004                         for (auto old : oldInferParams) {
     2005                        for (auto & old : oldInferParams) {
    20052006                                tgt[old.first] = ast::ParamEntry(
    20062007                                        old.second.decl,
Note: See TracChangeset for help on using the changeset viewer.