Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    r558d13b raaeacf4  
    579579                                tgtInferParams[srcParam.first] = ParamEntry(
    580580                                        srcParam.second.decl,
     581                                        get<Declaration>().accept1(srcParam.second.declptr),
    581582                                        get<Type>().accept1(srcParam.second.actualType),
    582583                                        get<Type>().accept1(srcParam.second.formalType),
     
    20042005                                tgt[old.first] = ast::ParamEntry(
    20052006                                        old.second.decl,
     2007                                        getAccept1<ast::Decl>(old.second.declptr),
    20062008                                        getAccept1<ast::Type>(old.second.actualType),
    20072009                                        getAccept1<ast::Type>(old.second.formalType),
     
    21912193
    21922194        int isStringlikeConstantType(const Type *t) {
    2193                 const Type *referentType = nullptr;
    21942195                if ( const ArrayType * aty = dynamic_cast< const ArrayType * >( t ) ) {
    2195                         referentType = aty->base;
    2196                 } else if ( const PointerType * pty = dynamic_cast< const PointerType * >( t ) ) {
    2197                         referentType = pty->base;
    2198                 }
    2199                 if (referentType) {
    2200                         if ( const BasicType * bty = dynamic_cast< const BasicType * >( referentType ) ) {
     2196                        if ( const BasicType * bty = dynamic_cast< const BasicType * >( aty->base ) ) {
    22012197                           if ( bty->kind == BasicType::Kind::Char ) {
    22022198                                   return true;
     
    22092205        virtual void visit( ConstantExpr * old ) override final {
    22102206                ast::ConstantExpr *rslt = nullptr;
    2211                 if (isStringlikeConstantType(old->result)) {
    2212                         rslt = new ast::ConstantExpr(
    2213                                 old->location,
    2214                                 GET_ACCEPT_1(result, Type),
    2215                                 old->constant.get_value(),
    2216                                 0,
    2217                                 ast::ConstantExpr::Kind::String
    2218                         );
    2219                 } else if (isIntlikeConstantType(old->result)) {
     2207                if (isIntlikeConstantType(old->result)) {
    22202208                        rslt = new ast::ConstantExpr(
    22212209                                old->location,
     
    22312219                                old->constant.get_value(),
    22322220                                (double) old->constant.get_dval()
     2221                        );
     2222                } else if (isStringlikeConstantType(old->result)) {
     2223                        rslt = new ast::ConstantExpr(
     2224                                old->location,
     2225                                GET_ACCEPT_1(result, Type),
     2226                                old->constant.get_value(),
     2227                                0,
     2228                                ast::ConstantExpr::Kind::String
    22332229                        );
    22342230                }
Note: See TracChangeset for help on using the changeset viewer.