Enable -Wunused-parameter
As a consequence, add many [[maybe_unused]] attributes for legitimate cases (mainly in virtual functions).master
parent
a6b5d40d4b
commit
c3fc5b1dd7
|
@ -43,7 +43,7 @@ esac
|
|||
# Use C++ for testing headers
|
||||
AC_LANG([C++])
|
||||
|
||||
AM_CXXFLAGS="-std=gnu++20 -Wall -Wno-dangling-else -Wextra -Wno-unused-parameter -Wold-style-cast"
|
||||
AM_CXXFLAGS="-std=gnu++20 -Wall -Wno-dangling-else -Wextra -Wold-style-cast"
|
||||
AC_SUBST([AM_CXXFLAGS])
|
||||
|
||||
# If default 'ar' is not available, try to find one with a host prefix (see ticket #145)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -804,36 +804,36 @@ DataTree::isSymbolUsed(int symb_id) const
|
|||
}
|
||||
|
||||
int
|
||||
DataTree::getDerivID(int symb_id, int lag) const noexcept(false)
|
||||
DataTree::getDerivID([[maybe_unused]] int symb_id, [[maybe_unused]] int lag) const noexcept(false)
|
||||
{
|
||||
throw UnknownDerivIDException();
|
||||
}
|
||||
|
||||
SymbolType
|
||||
DataTree::getTypeByDerivID(int deriv_id) const noexcept(false)
|
||||
DataTree::getTypeByDerivID([[maybe_unused]] int deriv_id) const noexcept(false)
|
||||
{
|
||||
throw UnknownDerivIDException();
|
||||
}
|
||||
|
||||
int
|
||||
DataTree::getLagByDerivID(int deriv_id) const noexcept(false)
|
||||
DataTree::getLagByDerivID([[maybe_unused]] int deriv_id) const noexcept(false)
|
||||
{
|
||||
throw UnknownDerivIDException();
|
||||
}
|
||||
|
||||
int
|
||||
DataTree::getSymbIDByDerivID(int deriv_id) const noexcept(false)
|
||||
DataTree::getSymbIDByDerivID([[maybe_unused]] int deriv_id) const noexcept(false)
|
||||
{
|
||||
throw UnknownDerivIDException();
|
||||
}
|
||||
|
||||
void
|
||||
DataTree::addAllParamDerivId(set<int> &deriv_id_set)
|
||||
DataTree::addAllParamDerivId([[maybe_unused]] set<int> &deriv_id_set)
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
DataTree::getDynJacobianCol(int deriv_id) const noexcept(false)
|
||||
DataTree::getDynJacobianCol([[maybe_unused]] int deriv_id) const noexcept(false)
|
||||
{
|
||||
throw UnknownDerivIDException();
|
||||
}
|
||||
|
|
403
src/ExprNode.cc
403
src/ExprNode.cc
File diff suppressed because it is too large
Load Diff
|
@ -1025,9 +1025,9 @@ ModelTree::computeBlockTemporaryTerms()
|
|||
}
|
||||
|
||||
void
|
||||
ModelTree::additionalBlockTemporaryTerms(int blk,
|
||||
vector<vector<temporary_terms_t>> &blocks_temporary_terms,
|
||||
map<expr_t, tuple<int, int, int>> &reference_count) const
|
||||
ModelTree::additionalBlockTemporaryTerms([[maybe_unused]] int blk,
|
||||
[[maybe_unused]] vector<vector<temporary_terms_t>> &blocks_temporary_terms,
|
||||
[[maybe_unused]] map<expr_t, tuple<int, int, int>> &reference_count) const
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ InitParamStatement::InitParamStatement(int symb_id_arg,
|
|||
}
|
||||
|
||||
void
|
||||
InitParamStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
InitParamStatement::checkPass(ModFileStructure &mod_file_struct, [[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
if (symbol_table.getName(symb_id) == "dsge_prior_weight")
|
||||
mod_file_struct.dsge_prior_weight_initialized = true;
|
||||
|
@ -46,7 +46,7 @@ InitParamStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolid
|
|||
}
|
||||
|
||||
void
|
||||
InitParamStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
InitParamStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename, bool minimal_workspace) const
|
||||
{
|
||||
int id = symbol_table.getTypeSpecificID(symb_id) + 1;
|
||||
output << "M_.params(" << id << ") = ";
|
||||
|
@ -184,7 +184,8 @@ InitValStatement::InitValStatement(const init_values_t &init_values_arg,
|
|||
}
|
||||
|
||||
void
|
||||
InitValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
InitValStatement::checkPass([[maybe_unused]] ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
set<int> exogs = getUninitializedVariables(SymbolType::exogenous);
|
||||
set<int> endogs = getUninitializedVariables(SymbolType::endogenous);
|
||||
|
@ -210,7 +211,8 @@ InitValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidat
|
|||
}
|
||||
|
||||
void
|
||||
InitValStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
InitValStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% INITVAL instructions" << endl
|
||||
|
@ -248,7 +250,8 @@ EndValStatement::EndValStatement(const init_values_t &init_values_arg,
|
|||
}
|
||||
|
||||
void
|
||||
EndValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
EndValStatement::checkPass([[maybe_unused]] ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
set<int> exogs = getUninitializedVariables(SymbolType::exogenous);
|
||||
set<int> endogs = getUninitializedVariables(SymbolType::endogenous);
|
||||
|
@ -274,7 +277,8 @@ EndValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidati
|
|||
}
|
||||
|
||||
void
|
||||
EndValStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
EndValStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% ENDVAL instructions" << endl
|
||||
|
@ -304,7 +308,8 @@ EndValLearntInStatement::EndValLearntInStatement(int learnt_in_period_arg,
|
|||
}
|
||||
|
||||
void
|
||||
EndValLearntInStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
EndValLearntInStatement::checkPass(ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
mod_file_struct.endval_learnt_in_present = true;
|
||||
}
|
||||
|
@ -325,7 +330,8 @@ EndValLearntInStatement::typeToString(LearntEndValType type)
|
|||
}
|
||||
|
||||
void
|
||||
EndValLearntInStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
EndValLearntInStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "M_.learnt_endval = [ M_.learnt_endval;" << endl;
|
||||
for (auto [type, symb_id, value] : learnt_end_values)
|
||||
|
@ -373,7 +379,8 @@ HistValStatement::HistValStatement(hist_values_t hist_values_arg,
|
|||
}
|
||||
|
||||
void
|
||||
HistValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
HistValStatement::checkPass([[maybe_unused]] ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
if (all_values_required)
|
||||
{
|
||||
|
@ -409,7 +416,8 @@ HistValStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidat
|
|||
}
|
||||
|
||||
void
|
||||
HistValStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
HistValStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% HISTVAL instructions" << endl
|
||||
|
@ -474,7 +482,8 @@ InitvalFileStatement::InitvalFileStatement(OptionsList options_list_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
InitvalFileStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
InitvalFileStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% INITVAL_FILE statement" << endl
|
||||
|
@ -502,7 +511,8 @@ HistvalFileStatement::HistvalFileStatement(OptionsList options_list_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
HistvalFileStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
HistvalFileStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% HISTVAL_FILE statement" << endl
|
||||
|
@ -532,7 +542,8 @@ HomotopyStatement::HomotopyStatement(homotopy_values_t homotopy_values_arg,
|
|||
}
|
||||
|
||||
void
|
||||
HomotopyStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
HomotopyStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% HOMOTOPY_SETUP instructions" << endl
|
||||
|
@ -586,7 +597,8 @@ SaveParamsAndSteadyStateStatement::SaveParamsAndSteadyStateStatement(string file
|
|||
}
|
||||
|
||||
void
|
||||
SaveParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
SaveParamsAndSteadyStateStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "save_params_and_steady_state('" << filename << "');" << endl;
|
||||
}
|
||||
|
@ -635,7 +647,8 @@ LoadParamsAndSteadyStateStatement::LoadParamsAndSteadyStateStatement(const strin
|
|||
}
|
||||
|
||||
void
|
||||
LoadParamsAndSteadyStateStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
LoadParamsAndSteadyStateStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
for (const auto &[id, value] : content)
|
||||
{
|
||||
|
|
|
@ -103,7 +103,8 @@ ShocksStatement::ShocksStatement(bool overwrite_arg,
|
|||
}
|
||||
|
||||
void
|
||||
ShocksStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
ShocksStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% SHOCKS instructions" << endl
|
||||
|
@ -301,7 +302,8 @@ ShocksStatement::writeCovarAndCorrShocks(ostream &output) const
|
|||
}
|
||||
|
||||
void
|
||||
ShocksStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
ShocksStatement::checkPass(ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
/* Error out if variables are not of the right type. This must be done here
|
||||
and not at parsing time (see #448).
|
||||
|
@ -406,7 +408,8 @@ MShocksStatement::MShocksStatement(bool overwrite_arg,
|
|||
}
|
||||
|
||||
void
|
||||
MShocksStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
MShocksStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "%" << endl
|
||||
<< "% MSHOCKS instructions" << endl
|
||||
|
@ -440,13 +443,15 @@ ShocksSurpriseStatement::ShocksSurpriseStatement(bool overwrite_arg,
|
|||
}
|
||||
|
||||
void
|
||||
ShocksSurpriseStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
ShocksSurpriseStatement::checkPass(ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
mod_file_struct.shocks_surprise_present = true;
|
||||
}
|
||||
|
||||
void
|
||||
ShocksSurpriseStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
ShocksSurpriseStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
if (overwrite)
|
||||
output << "M_.surprise_shocks = [" << endl;
|
||||
|
@ -502,7 +507,8 @@ ShocksLearntInStatement::ShocksLearntInStatement(int learnt_in_period_arg, bool
|
|||
}
|
||||
|
||||
void
|
||||
ShocksLearntInStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
ShocksLearntInStatement::checkPass(ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
mod_file_struct.shocks_learnt_in_present = true;
|
||||
}
|
||||
|
@ -523,7 +529,8 @@ ShocksLearntInStatement::typeToString(LearntShockType type)
|
|||
}
|
||||
|
||||
void
|
||||
ShocksLearntInStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
ShocksLearntInStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
if (overwrite)
|
||||
output << "if ~isempty(M_.learnt_shocks)" << endl
|
||||
|
@ -596,7 +603,9 @@ ConditionalForecastPathsStatement::computePathLength(const AbstractShocksStateme
|
|||
}
|
||||
|
||||
void
|
||||
ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
ConditionalForecastPathsStatement::writeOutput(ostream &output,
|
||||
[[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
assert(path_length > 0);
|
||||
output << "constrained_vars_ = [];" << endl
|
||||
|
@ -655,7 +664,8 @@ MomentCalibration::MomentCalibration(constraints_t constraints_arg,
|
|||
}
|
||||
|
||||
void
|
||||
MomentCalibration::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
MomentCalibration::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "options_.endogenous_prior_restrictions.moment = {" << endl;
|
||||
for (const auto &c : constraints)
|
||||
|
@ -706,7 +716,8 @@ IrfCalibration::IrfCalibration(constraints_t constraints_arg,
|
|||
}
|
||||
|
||||
void
|
||||
IrfCalibration::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
IrfCalibration::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
options_list.writeOutput(output);
|
||||
|
||||
|
@ -763,7 +774,8 @@ ShockGroupsStatement::ShockGroupsStatement(group_t shock_groups_arg, string name
|
|||
}
|
||||
|
||||
void
|
||||
ShockGroupsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
ShockGroupsStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
int i = 1;
|
||||
for (auto it = shock_groups.begin(); it != shock_groups.end(); ++it)
|
||||
|
@ -833,7 +845,8 @@ Init2shocksStatement::Init2shocksStatement(vector<pair<int, int>> init2shocks_ar
|
|||
}
|
||||
|
||||
void
|
||||
Init2shocksStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
Init2shocksStatement::checkPass([[maybe_unused]] ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
for (size_t i = 0; i < init2shocks.size(); i++)
|
||||
for (size_t j = i + 1; j < init2shocks.size(); j++)
|
||||
|
@ -847,7 +860,8 @@ Init2shocksStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsol
|
|||
}
|
||||
|
||||
void
|
||||
Init2shocksStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
Init2shocksStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "M_.init2shocks." << name << " = {" << endl;
|
||||
for (const auto &[id1, id2] : init2shocks)
|
||||
|
@ -879,7 +893,8 @@ HeteroskedasticShocksStatement::HeteroskedasticShocksStatement(bool overwrite_ar
|
|||
}
|
||||
|
||||
void
|
||||
HeteroskedasticShocksStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
HeteroskedasticShocksStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
// NB: The first initialization of the fields is done in ModFile::writeMOutput()
|
||||
if (overwrite)
|
||||
|
|
|
@ -60,7 +60,8 @@ SigmaeStatement::determineMatrixForm(const matrix_t &matrix) noexcept(false)
|
|||
}
|
||||
|
||||
void
|
||||
SigmaeStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
SigmaeStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << "M_.Sigma_e = [..." << endl;
|
||||
for (size_t ir = 0; ir < matrix.size(); ir++)
|
||||
|
|
|
@ -25,12 +25,13 @@
|
|||
#include <utility>
|
||||
|
||||
void
|
||||
Statement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
|
||||
Statement::checkPass([[maybe_unused]] ModFileStructure &mod_file_struct,
|
||||
[[maybe_unused]] WarningConsolidation &warnings)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Statement::computingPass(const ModFileStructure &mod_file_struct)
|
||||
Statement::computingPass([[maybe_unused]] const ModFileStructure &mod_file_struct)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -40,7 +41,8 @@ NativeStatement::NativeStatement(string native_statement_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
NativeStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
NativeStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
using namespace boost::xpressive;
|
||||
string date_regex = R"((-?\d+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[SsHh][1-2])))";
|
||||
|
@ -104,7 +106,8 @@ VerbatimStatement::VerbatimStatement(string verbatim_statement_arg) :
|
|||
}
|
||||
|
||||
void
|
||||
VerbatimStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
|
||||
VerbatimStatement::writeOutput(ostream &output, [[maybe_unused]] const string &basename,
|
||||
[[maybe_unused]] bool minimal_workspace) const
|
||||
{
|
||||
output << verbatim_statement << endl;
|
||||
}
|
||||
|
|
|
@ -1893,7 +1893,7 @@ StaticModel::getTypeByDerivID(int deriv_id) const noexcept(false)
|
|||
}
|
||||
|
||||
int
|
||||
StaticModel::getLagByDerivID(int deriv_id) const noexcept(false)
|
||||
StaticModel::getLagByDerivID([[maybe_unused]] int deriv_id) const noexcept(false)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -1910,7 +1910,7 @@ StaticModel::getSymbIDByDerivID(int deriv_id) const noexcept(false)
|
|||
}
|
||||
|
||||
int
|
||||
StaticModel::getDerivID(int symb_id, int lag) const noexcept(false)
|
||||
StaticModel::getDerivID(int symb_id, [[maybe_unused]] int lag) const noexcept(false)
|
||||
{
|
||||
if (symbol_table.getType(symb_id) == SymbolType::endogenous)
|
||||
return symbol_table.getTypeSpecificID(symb_id);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
using namespace macro;
|
||||
|
||||
void
|
||||
Eval::interpret(ostream &output, Environment &env, vector<filesystem::path> &paths)
|
||||
Eval::interpret(ostream &output, Environment &env, [[maybe_unused]] vector<filesystem::path> &paths)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ Include::interpret(ostream &output, Environment &env, vector<filesystem::path> &
|
|||
}
|
||||
|
||||
void
|
||||
IncludePath::interpret(ostream &output, Environment &env, vector<filesystem::path> &paths)
|
||||
IncludePath::interpret([[maybe_unused]] ostream &output, Environment &env, vector<filesystem::path> &paths)
|
||||
{
|
||||
using namespace filesystem;
|
||||
try
|
||||
|
@ -131,7 +131,7 @@ IncludePath::interpret(ostream &output, Environment &env, vector<filesystem::pat
|
|||
}
|
||||
|
||||
void
|
||||
Define::interpret(ostream &output, Environment &env, vector<filesystem::path> &paths)
|
||||
Define::interpret([[maybe_unused]] ostream &output, Environment &env, [[maybe_unused]] vector<filesystem::path> &paths)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -154,7 +154,7 @@ Define::interpret(ostream &output, Environment &env, vector<filesystem::path> &p
|
|||
}
|
||||
|
||||
void
|
||||
Echo::interpret(ostream &output, Environment &env, vector<filesystem::path> &paths)
|
||||
Echo::interpret(ostream &output, Environment &env, [[maybe_unused]] vector<filesystem::path> &paths)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -173,7 +173,7 @@ Echo::interpret(ostream &output, Environment &env, vector<filesystem::path> &pat
|
|||
}
|
||||
|
||||
void
|
||||
Error::interpret(ostream &output, Environment &env, vector<filesystem::path> &paths)
|
||||
Error::interpret([[maybe_unused]] ostream &output, Environment &env, [[maybe_unused]] vector<filesystem::path> &paths)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -191,7 +191,7 @@ Error::interpret(ostream &output, Environment &env, vector<filesystem::path> &pa
|
|||
}
|
||||
|
||||
void
|
||||
EchoMacroVars::interpret(ostream &output, Environment &env, vector<filesystem::path> &paths)
|
||||
EchoMacroVars::interpret(ostream &output, Environment &env, [[maybe_unused]] vector<filesystem::path> &paths)
|
||||
{
|
||||
if (save)
|
||||
env.print(output, vars, location.begin.line, true);
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace macro
|
|||
TextNode(string text_arg, Tokenizer::location location_arg) :
|
||||
Directive(move(location_arg)), text{move(text_arg)} { }
|
||||
void
|
||||
interpret(ostream &output, Environment &env, vector<filesystem::path> &paths) override
|
||||
interpret(ostream &output, [[maybe_unused]] Environment &env, [[maybe_unused]] vector<filesystem::path> &paths) override
|
||||
{
|
||||
output << text;
|
||||
}
|
||||
|
|
|
@ -306,7 +306,7 @@ String::is_equal(const BaseTypePtr &btp) const
|
|||
}
|
||||
|
||||
BoolPtr
|
||||
String::cast_bool(Environment &env) const
|
||||
String::cast_bool([[maybe_unused]] Environment &env) const
|
||||
{
|
||||
auto f = [](const char &a, const char &b) { return (tolower(a) == tolower(b)); };
|
||||
|
||||
|
@ -331,7 +331,7 @@ String::cast_bool(Environment &env) const
|
|||
}
|
||||
|
||||
RealPtr
|
||||
String::cast_real(Environment &env) const
|
||||
String::cast_real([[maybe_unused]] Environment &env) const
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
@ -131,27 +131,27 @@ namespace macro
|
|||
explicit BaseType(Tokenizer::location location_arg = Tokenizer::location()) :
|
||||
Expression(move(location_arg)) { }
|
||||
virtual codes::BaseType getType() const noexcept = 0;
|
||||
BaseTypePtr eval(Environment &env) override { return shared_from_this(); }
|
||||
BaseTypePtr eval([[maybe_unused]] Environment &env) override { return shared_from_this(); }
|
||||
public:
|
||||
virtual BaseTypePtr plus(const BaseTypePtr &bt) const { throw StackTrace("Operator + does not exist for this type"); }
|
||||
virtual BaseTypePtr plus([[maybe_unused]] const BaseTypePtr &bt) const { throw StackTrace("Operator + does not exist for this type"); }
|
||||
virtual BaseTypePtr unary_plus() const { throw StackTrace("Unary operator + does not exist for this type"); }
|
||||
virtual BaseTypePtr minus(const BaseTypePtr &bt) const { throw StackTrace("Operator - does not exist for this type"); }
|
||||
virtual BaseTypePtr minus([[maybe_unused]] const BaseTypePtr &bt) const { throw StackTrace("Operator - does not exist for this type"); }
|
||||
virtual BaseTypePtr unary_minus() const { throw StackTrace("Unary operator - does not exist for this type"); }
|
||||
virtual BaseTypePtr times(const BaseTypePtr &bt) const { throw StackTrace("Operator * does not exist for this type"); }
|
||||
virtual BaseTypePtr divide(const BaseTypePtr &bt) const { throw StackTrace("Operator / does not exist for this type"); }
|
||||
virtual BaseTypePtr power(const BaseTypePtr &btp) const { throw StackTrace("Operator ^ does not exist for this type"); }
|
||||
virtual BoolPtr is_less(const BaseTypePtr &btp) const { throw StackTrace("Operator < does not exist for this type"); }
|
||||
virtual BoolPtr is_greater(const BaseTypePtr &btp) const { throw StackTrace("Operator > does not exist for this type"); }
|
||||
virtual BoolPtr is_less_equal(const BaseTypePtr &btp) const { throw StackTrace("Operator <= does not exist for this type"); }
|
||||
virtual BoolPtr is_greater_equal(const BaseTypePtr &btp) const { throw StackTrace("Operator >= does not exist for this type"); }
|
||||
virtual BaseTypePtr times([[maybe_unused]] const BaseTypePtr &bt) const { throw StackTrace("Operator * does not exist for this type"); }
|
||||
virtual BaseTypePtr divide([[maybe_unused]] const BaseTypePtr &bt) const { throw StackTrace("Operator / does not exist for this type"); }
|
||||
virtual BaseTypePtr power([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator ^ does not exist for this type"); }
|
||||
virtual BoolPtr is_less([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator < does not exist for this type"); }
|
||||
virtual BoolPtr is_greater([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator > does not exist for this type"); }
|
||||
virtual BoolPtr is_less_equal([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator <= does not exist for this type"); }
|
||||
virtual BoolPtr is_greater_equal([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator >= does not exist for this type"); }
|
||||
virtual BoolPtr is_equal(const BaseTypePtr &btp) const = 0;
|
||||
virtual BoolPtr is_different(const BaseTypePtr &btp) const final;
|
||||
virtual BoolPtr logical_and(const ExpressionPtr &ep, Environment &env) const { throw StackTrace("Operator && does not exist for this type"); }
|
||||
virtual BoolPtr logical_or(const ExpressionPtr &ep, Environment &env) const { throw StackTrace("Operator || does not exist for this type"); }
|
||||
virtual BoolPtr logical_and([[maybe_unused]] const ExpressionPtr &ep, [[maybe_unused]] Environment &env) const { throw StackTrace("Operator && does not exist for this type"); }
|
||||
virtual BoolPtr logical_or([[maybe_unused]] const ExpressionPtr &ep, [[maybe_unused]] Environment &env) const { throw StackTrace("Operator || does not exist for this type"); }
|
||||
virtual BoolPtr logical_not() const { throw StackTrace("Operator ! does not exist for this type"); }
|
||||
virtual ArrayPtr set_union(const BaseTypePtr &btp) const { throw StackTrace("Operator | does not exist for this type"); }
|
||||
virtual ArrayPtr set_intersection(const BaseTypePtr &btp) const { throw StackTrace("Operator & does not exist for this type"); }
|
||||
virtual BoolPtr contains(const BaseTypePtr &btp) const { throw StackTrace("Second argument of `in` operator must be an array"); }
|
||||
virtual ArrayPtr set_union([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator | does not exist for this type"); }
|
||||
virtual ArrayPtr set_intersection([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator & does not exist for this type"); }
|
||||
virtual BoolPtr contains([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Second argument of `in` operator must be an array"); }
|
||||
virtual RealPtr length() const { throw StackTrace("Operator `length` does not exist for this type"); }
|
||||
virtual BoolPtr isempty() const { throw StackTrace("Operator `isempty` does not exist for this type"); }
|
||||
virtual BoolPtr isboolean() const noexcept { return make_shared<Bool>(false, location); }
|
||||
|
@ -160,9 +160,9 @@ namespace macro
|
|||
virtual BoolPtr isstring() const noexcept { return make_shared<Bool>(false, location); }
|
||||
virtual BoolPtr istuple() const noexcept { return make_shared<Bool>(false, location); }
|
||||
virtual BoolPtr isarray() const noexcept { return make_shared<Bool>(false, location); }
|
||||
virtual RealPtr max(const BaseTypePtr &btp) const { throw StackTrace("Operator `max` does not exist for this type"); }
|
||||
virtual RealPtr min(const BaseTypePtr &btp) const { throw StackTrace("Operator `min` does not exist for this type"); }
|
||||
virtual RealPtr mod(const BaseTypePtr &btp) const { throw StackTrace("Operator `mod` does not exist for this type"); }
|
||||
virtual RealPtr max([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator `max` does not exist for this type"); }
|
||||
virtual RealPtr min([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator `min` does not exist for this type"); }
|
||||
virtual RealPtr mod([[maybe_unused]] const BaseTypePtr &btp) const { throw StackTrace("Operator `mod` does not exist for this type"); }
|
||||
virtual RealPtr exp() const { throw StackTrace("Operator `exp` does not exist for this type"); }
|
||||
virtual RealPtr ln() const { throw StackTrace("Operator `ln` does not exist for this type"); }
|
||||
virtual RealPtr log10() const { throw StackTrace("Operator `log10` does not exist for this type"); }
|
||||
|
@ -189,15 +189,15 @@ namespace macro
|
|||
virtual RealPtr lgamma() const { throw StackTrace("Operator `lgamma` does not exist for this type"); }
|
||||
virtual RealPtr round() const { throw StackTrace("Operator `round` does not exist for this type"); }
|
||||
virtual RealPtr normpdf() const { throw StackTrace("Operator `normpdf` does not exist for this type"); }
|
||||
virtual RealPtr normpdf(const BaseTypePtr &btp1, const BaseTypePtr &btp2) const { throw StackTrace("Operator `normpdf` does not exist for this type"); }
|
||||
virtual RealPtr normpdf([[maybe_unused]] const BaseTypePtr &btp1, [[maybe_unused]] const BaseTypePtr &btp2) const { throw StackTrace("Operator `normpdf` does not exist for this type"); }
|
||||
virtual RealPtr normcdf() const { throw StackTrace("Operator `normcdf` does not exist for this type"); }
|
||||
virtual RealPtr normcdf(const BaseTypePtr &btp1, const BaseTypePtr &btp2) const { throw StackTrace("Operator `normcdf` does not exist for this type"); }
|
||||
virtual BoolPtr cast_bool(Environment &env) const { throw StackTrace("This type cannot be cast to a boolean"); }
|
||||
virtual RealPtr cast_real(Environment &env) const { throw StackTrace("This type cannot be cast to a real"); }
|
||||
virtual RealPtr normcdf([[maybe_unused]] const BaseTypePtr &btp1, [[maybe_unused]] const BaseTypePtr &btp2) const { throw StackTrace("Operator `normcdf` does not exist for this type"); }
|
||||
virtual BoolPtr cast_bool([[maybe_unused]] Environment &env) const { throw StackTrace("This type cannot be cast to a boolean"); }
|
||||
virtual RealPtr cast_real([[maybe_unused]] Environment &env) const { throw StackTrace("This type cannot be cast to a real"); }
|
||||
virtual StringPtr cast_string() const { throw StackTrace("This type cannot be cast to a string"); }
|
||||
virtual TuplePtr cast_tuple() const { throw StackTrace("This type cannot be cast to a tuple"); }
|
||||
virtual ArrayPtr cast_array() const { throw StackTrace("This type cannot be cast to an array"); }
|
||||
virtual BoolPtr defined(const Environment &env) const { throw StackTrace("Operator `defined` does not exist for this type"); }
|
||||
virtual BoolPtr defined([[maybe_unused]] const Environment &env) const { throw StackTrace("Operator `defined` does not exist for this type"); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ namespace macro
|
|||
value{value_arg} { }
|
||||
codes::BaseType getType() const noexcept override { return codes::BaseType::Bool; }
|
||||
string to_string() const noexcept override { return value ? "true" : "false"; }
|
||||
void print(ostream &output, bool matlab_output = false) const noexcept override { output << to_string(); }
|
||||
void print(ostream &output, [[maybe_unused]] bool matlab_output = false) const noexcept override { output << to_string(); }
|
||||
ExpressionPtr clone() const noexcept override { return make_shared<Bool>(value, location); }
|
||||
public:
|
||||
operator bool() const { return value; }
|
||||
|
@ -221,8 +221,8 @@ namespace macro
|
|||
BoolPtr logical_or(const ExpressionPtr &ep, Environment &env) const override;
|
||||
BoolPtr logical_not() const override;
|
||||
BoolPtr isboolean() const noexcept override { return make_shared<Bool>(true, location); }
|
||||
BoolPtr cast_bool(Environment &env) const override { return make_shared<Bool>(value); }
|
||||
RealPtr cast_real(Environment &env) const override { return value ? make_shared<Real>(1) : make_shared<Real>(0); }
|
||||
BoolPtr cast_bool([[maybe_unused]] Environment &env) const override { return make_shared<Bool>(value); }
|
||||
RealPtr cast_real([[maybe_unused]] Environment &env) const override { return value ? make_shared<Real>(1) : make_shared<Real>(0); }
|
||||
StringPtr cast_string() const override { return make_shared<String>(this->to_string()); }
|
||||
TuplePtr
|
||||
cast_tuple() const override
|
||||
|
@ -260,7 +260,7 @@ namespace macro
|
|||
strs << setprecision(15) << value;
|
||||
return strs.str();
|
||||
}
|
||||
void print(ostream &output, bool matlab_output = false) const noexcept override { output << to_string(); }
|
||||
void print(ostream &output, [[maybe_unused]] bool matlab_output = false) const noexcept override { output << to_string(); }
|
||||
ExpressionPtr clone() const noexcept override { return make_shared<Real>(value, location); }
|
||||
public:
|
||||
operator double() const { return value; }
|
||||
|
@ -328,8 +328,8 @@ namespace macro
|
|||
return normcdf(make_shared<Real>(0), make_shared<Real>(1));
|
||||
}
|
||||
RealPtr normcdf(const BaseTypePtr &btp1, const BaseTypePtr &btp2) const override;
|
||||
BoolPtr cast_bool(Environment &env) const override { return make_shared<Bool>(static_cast<bool>(value)); }
|
||||
RealPtr cast_real(Environment &env) const override { return make_shared<Real>(value); }
|
||||
BoolPtr cast_bool([[maybe_unused]] Environment &env) const override { return make_shared<Bool>(static_cast<bool>(value)); }
|
||||
RealPtr cast_real([[maybe_unused]] Environment &env) const override { return make_shared<Real>(value); }
|
||||
StringPtr cast_string() const override { return make_shared<String>(this->to_string()); }
|
||||
TuplePtr
|
||||
cast_tuple() const override
|
||||
|
@ -479,7 +479,7 @@ namespace macro
|
|||
retval += inc->to_string() + ":";
|
||||
return retval + end->to_string() + "]";
|
||||
}
|
||||
void print(ostream &output, bool matlab_output = false) const noexcept override { output << to_string(); }
|
||||
void print(ostream &output, [[maybe_unused]] bool matlab_output = false) const noexcept override { output << to_string(); }
|
||||
BaseTypePtr eval(Environment &env) override;
|
||||
ExpressionPtr
|
||||
clone() const noexcept override
|
||||
|
@ -490,7 +490,7 @@ namespace macro
|
|||
}
|
||||
public:
|
||||
BoolPtr
|
||||
is_equal(const BaseTypePtr &btp) const override
|
||||
is_equal([[maybe_unused]] const BaseTypePtr &btp) const override
|
||||
{
|
||||
throw StackTrace("Internal error: Range: Should not arrive here: is_equal");
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ namespace macro
|
|||
Tokenizer::location location_arg) :
|
||||
Expression(move(location_arg)), name{move(name_arg)}, indices{move(indices_arg)} { }
|
||||
string to_string() const noexcept override { return name; }
|
||||
void print(ostream &output, bool matlab_output = false) const noexcept override { output << name; }
|
||||
void print(ostream &output, [[maybe_unused]] bool matlab_output = false) const noexcept override { output << name; }
|
||||
BaseTypePtr eval(Environment &env) override;
|
||||
ExpressionPtr
|
||||
clone() const noexcept override
|
||||
|
@ -536,7 +536,7 @@ namespace macro
|
|||
Expression(move(location_arg)), name{move(name_arg)}, args{move(args_arg)} { }
|
||||
string to_string() const noexcept override;
|
||||
void
|
||||
print(ostream &output, bool matlab_output = false) const noexcept override
|
||||
print(ostream &output, [[maybe_unused]] bool matlab_output = false) const noexcept override
|
||||
{
|
||||
printName(output); printArgs(output);
|
||||
}
|
||||
|
@ -640,7 +640,7 @@ namespace macro
|
|||
Tokenizer::location location_arg) :
|
||||
Expression(move(location_arg)),
|
||||
c_expr{move(c_expr_arg)}, c_vars{move(c_vars_arg)}, c_set{move(c_set_arg)} { }
|
||||
Comprehension(bool filter_only_arg,
|
||||
Comprehension([[maybe_unused]] bool filter_only_arg,
|
||||
ExpressionPtr c_vars_arg,
|
||||
ExpressionPtr c_set_arg,
|
||||
ExpressionPtr c_when_arg,
|
||||
|
|
Loading…
Reference in New Issue