Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Expr.hpp

    re67991f rb8524ca  
    4747
    4848        ParamEntry() : decl( 0 ), declptr( nullptr ), actualType( nullptr ), formalType( nullptr ), expr( nullptr ) {}
    49         ParamEntry(
    50                 UniqueId id, const Decl * declptr, const Type * actual, const Type * formal,
     49        ParamEntry( 
     50                UniqueId id, const Decl * declptr, const Type * actual, const Type * formal, 
    5151                const Expr * e )
    5252        : decl( id ), declptr( declptr ), actualType( actual ), formalType( formal ), expr( e ) {}
     
    112112                        case Empty: new(&data.resnSlots) ResnSlots{}; mode = Slots; // fallthrough
    113113                        case Slots: return data.resnSlots;
    114                         case Params: assertf(false, "Cannot return to resnSlots from Params"); abort();
     114                        case Params: assert(!"Cannot return to resnSlots from Params");
    115115                        }
    116                         assertf(false, "unreachable");
     116                        return *((ResnSlots*)nullptr);
    117117                }
    118118
     
    121121                                return data.resnSlots;
    122122                        }
    123                         assertf(false, "Mode was not already resnSlots");
    124                         abort();
     123                        assert(!"Mode was not already resnSlots");
     124                        return *((ResnSlots*)nullptr);
    125125                }
    126126
     
    131131                        case Params: return data.inferParams;
    132132                        }
    133                         assertf(false, "unreachable");
     133                        assert(!"unreachable");
     134                        return *((InferredParams*)nullptr);
    134135                }
    135136
     
    138139                                return data.inferParams;
    139140                        }
    140                         assertf(false, "Mode was not already Params");
    141                         abort();
     141                        assert(!"Mode was not already Params");
     142                        return *((InferredParams*)nullptr);
    142143                }
    143144
    144145                void set_inferParams( InferredParams && ps ) {
    145146                        switch(mode) {
    146                         case Slots:
     147                        case Slots: 
    147148                                data.resnSlots.~ResnSlots();
    148149                                // fallthrough
    149                         case Empty:
     150                        case Empty: 
    150151                                new(&data.inferParams) InferredParams{ std::move( ps ) };
    151152                                mode = Params;
     
    171172                                        data.inferParams[p.first] = std::move(p.second);
    172173                                }
    173                         } else assertf(false, "invalid mode");
     174                        } else assert(!"invalid mode");
    174175                }
    175176        };
     
    383384
    384385        ConstantExpr(
    385                 const CodeLocation & loc, const Type * ty, const std::string & r,
     386                const CodeLocation & loc, const Type * ty, const std::string & r, 
    386387                        std::optional<unsigned long long> i )
    387388        : Expr( loc, ty ), rep( r ), ival( i ) {}
     
    769770public:
    770771        ptr<Expr> expr;
    771         readonly<Decl> deleteStmt;
    772 
    773         DeletedExpr( const CodeLocation & loc, const Expr * e, const Decl * del )
     772        readonly<Node> deleteStmt;
     773
     774        DeletedExpr( const CodeLocation & loc, const Expr * e, const Node * del )
    774775        : Expr( loc, e->result ), expr( e ), deleteStmt( del ) { assert( expr->result ); }
    775776
Note: See TracChangeset for help on using the changeset viewer.