Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Tuples/TupleExpansion.cc

    r62423350 rd56e5bc  
    192192                        }
    193193                        ObjectDecl * finished = new ObjectDecl( toString( "_unq", id, "_finished_" ), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new BasicType( Type::Qualifiers(), BasicType::Bool ),
    194                                                                                                         new SingleInit( new ConstantExpr( Constant::from_int( 0 ) ) ) );
     194                                                                                                        new SingleInit( new ConstantExpr( Constant::from_int( 0 ) ), noDesignators ) );
    195195                        addDeclaration( finished );
    196196                        // (finished ? _unq_expr_N : (_unq_expr_N = <unqExpr->get_expr()>, finished = 1, _unq_expr_N))
     
    310310        Type * makeTupleType( const std::list< Expression * > & exprs ) {
    311311                // produce the TupleType which aggregates the types of the exprs
    312                 std::list< Type * > types;
    313                 Type::Qualifiers qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex );
     312                TupleType *tupleType = new TupleType( Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Lvalue | Type::Atomic | Type::Mutex ) );
     313                Type::Qualifiers &qualifiers = tupleType->get_qualifiers();
    314314                for ( Expression * expr : exprs ) {
    315315                        assert( expr->get_result() );
    316316                        if ( expr->get_result()->isVoid() ) {
    317317                                // if the type of any expr is void, the type of the entire tuple is void
     318                                delete tupleType;
    318319                                return new VoidType( Type::Qualifiers() );
    319320                        }
    320321                        Type * type = expr->get_result()->clone();
    321                         types.push_back( type );
     322                        tupleType->get_types().push_back( type );
    322323                        // the qualifiers on the tuple type are the qualifiers that exist on all component types
    323324                        qualifiers &= type->get_qualifiers();
    324325                } // for
    325326                if ( exprs.empty() ) qualifiers = Type::Qualifiers();
    326                 return new TupleType( qualifiers, types );
     327                return tupleType;
    327328        }
    328329
Note: See TracChangeset for help on using the changeset viewer.