diff --git a/src/ParsingDriver.cc b/src/ParsingDriver.cc index 0aea25ad..58c1902f 100644 --- a/src/ParsingDriver.cc +++ b/src/ParsingDriver.cc @@ -2902,6 +2902,15 @@ ParsingDriver::add_erf(expr_t arg1) expr_t ParsingDriver::add_steady_state(expr_t arg1) { + // Forbid exogenous variables, see dynare#825 + set r; + arg1->collectVariables(SymbolType::exogenous, r); + if (r.size() > 0) + error("Exogenous variables are not allowed in the context of the STEADY_STATE() operator."); + arg1->collectVariables(SymbolType::exogenousDet, r); + if (r.size() > 0) + error("Exogenous deterministic variables are not allowed in the context of the STEADY_STATE() operator."); + return data_tree->AddSteadyState(arg1); }