From c6007aa780470b5b04eefb6860bb7b29aa883f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org> Date: Tue, 17 May 2022 23:17:06 +0200 Subject: [PATCH] C++17 modernization: use [[fallthrough]] attribute This disables warnings when -Wimplicit-fallthrough is used (enabled by -Wextra). --- src/SymbolTable.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SymbolTable.cc b/src/SymbolTable.cc index 0900016f..b352ea95 100644 --- a/src/SymbolTable.cc +++ b/src/SymbolTable.cc @@ -368,7 +368,7 @@ SymbolTable::writeOutput(ostream &output) const noexcept(false) break; case AuxVarType::unaryOp: output << "M_.aux_vars(" << i+1 << ").unary_op = '" << aux_vars[i].get_unary_op() << "';" << endl; - // NB: Fallback! + [[fallthrough]]; case AuxVarType::diff: if (aux_vars[i].get_orig_symb_id()) output << "M_.aux_vars(" << i+1 << ").orig_index = " << getTypeSpecificID(*aux_vars[i].get_orig_symb_id())+1 << ";" << endl @@ -1031,7 +1031,7 @@ SymbolTable::writeJsonOutput(ostream &output) const break; case AuxVarType::unaryOp: output << R"(, "unary_op": ")" << aux_vars[i].get_unary_op() << R"(")"; - // NB: Fallback! + [[fallthrough]]; case AuxVarType::diff: if (aux_vars[i].get_orig_symb_id()) output << R"(, "orig_index": )" << getTypeSpecificID(*aux_vars[i].get_orig_symb_id())+1 -- GitLab