@@ -1009,7 +1009,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
1009
1009
1010
1010
ASR::ttype_t * get_type_from_var_annotation (std::string var_annotation,
1011
1011
const Location& loc, Vec<ASR::dimension_t >& dims,
1012
- AST::expr_t ** m_args=nullptr , size_t n_args=0 ,
1012
+ AST::expr_t ** m_args=nullptr , [[maybe_unused]] size_t n_args=0 ,
1013
1013
bool raise_error=true , ASR::abiType abi=ASR::abiType::Source,
1014
1014
bool is_argument=false ) {
1015
1015
ASR::ttype_t * type = nullptr ;
@@ -2416,7 +2416,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
2416
2416
result = left_value >> right_value;
2417
2417
break ;
2418
2418
}
2419
- default : { LCOMPILERS_ASSERT ( false ); } // should never happen
2419
+ default : { throw SemanticError ( " ICE: Unknown binary operator " , loc ); } // should never happen
2420
2420
}
2421
2421
value = ASR::down_cast<ASR::expr_t >(ASR::make_UnsignedIntegerConstant_t (
2422
2422
al, loc, result, dest_type));
@@ -2458,7 +2458,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
2458
2458
case (ASR::binopType::Mul): { result = left_value * right_value; break ; }
2459
2459
case (ASR::binopType::Div): { result = left_value / right_value; break ; }
2460
2460
case (ASR::binopType::Pow): { result = std::pow (left_value, right_value); break ; }
2461
- default : { LCOMPILERS_ASSERT ( false ); }
2461
+ default : { throw SemanticError ( " ICE: Unknown binary operator " , loc ); }
2462
2462
}
2463
2463
value = ASR::down_cast<ASR::expr_t >(ASR::make_RealConstant_t (
2464
2464
al, loc, result, dest_type));
@@ -3289,7 +3289,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
3289
3289
void visit_NamedExpr (const AST::NamedExpr_t &x) {
3290
3290
this ->visit_expr (*x.m_target );
3291
3291
ASR::expr_t *target = ASRUtils::EXPR (tmp);
3292
- ASR::ttype_t *target_type = ASRUtils::expr_type (target);
3292
+ [[maybe_unused]] ASR::ttype_t *target_type = ASRUtils::expr_type (target);
3293
3293
this ->visit_expr (*x.m_value );
3294
3294
ASR::expr_t *value = ASRUtils::EXPR (tmp);
3295
3295
ASR::ttype_t *value_type = ASRUtils::expr_type (value);
0 commit comments