diff --git a/.clang-format b/.clang-format index cd9c21f50bbf31eba425bcdb8fab3dd3bfd4d442..2187512295d8fe5672fbf31fdd60cdc0559efdcc 100644 --- a/.clang-format +++ b/.clang-format @@ -11,9 +11,11 @@ BreakInheritanceList: AfterColon Cpp11BracedListStyle: true DeriveLineEnding: false IndentPPDirectives: AfterHash +InsertNewlineAtEOF: true PackConstructorInitializers: NextLine PPIndentWidth: 1 PointerAlignment: Left +RemoveSemicolon: true SpaceAfterTemplateKeyword: false SpaceBeforeParens: ControlStatements SpaceBeforeCpp11BracedList: true diff --git a/src/ComputingTasks.hh b/src/ComputingTasks.hh index 2e4df64a6f732cc75e3495a801a66d360e8dec20..fb1e2bd2e655a0a8af17a27fd8fc499b030e2edc 100644 --- a/src/ComputingTasks.hh +++ b/src/ComputingTasks.hh @@ -524,7 +524,7 @@ public: blockName() const override { return "estimated_params"; - }; + } void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override; void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override; void writeJsonOutput(ostream& output) const override; @@ -542,7 +542,7 @@ public: blockName() const override { return "estimated_params_init"; - }; + } void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override; void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override; void writeJsonOutput(ostream& output) const override; @@ -557,7 +557,7 @@ public: blockName() const override { return "estimated_params_bounds"; - }; + } void checkPass(ModFileStructure& mod_file_struct, WarningConsolidation& warnings) override; void writeOutput(ostream& output, const string& basename, bool minimal_workspace) const override; void writeJsonOutput(ostream& output) const override; diff --git a/src/Configuration.hh b/src/Configuration.hh index 2e13fe76d72031c66538f1a5b1a69a95d8179ef8..1fd2cd06034b2f941558fba4c060e9a53411a2c4 100644 --- a/src/Configuration.hh +++ b/src/Configuration.hh @@ -47,7 +47,7 @@ private: get_paths() const { return paths; - }; + } private: map<string, vector<string>> paths; diff --git a/src/DynamicModel.hh b/src/DynamicModel.hh index 2cbcc2cfa2d35b3e43809bfb9f2caaed15ea22ff..5d3f388307ce3ceb63b4eccbec29b5012a2443af 100644 --- a/src/DynamicModel.hh +++ b/src/DynamicModel.hh @@ -713,7 +713,7 @@ public: { return tuple {static_only_equations, static_only_equations_lineno, static_only_complementarity_conditions, static_only_equations_equation_tags}; - }; + } //! Returns true if a parameter was used in the model block with a lead or lag bool ParamUsedWithLeadLag() const; diff --git a/src/ExprNode.hh b/src/ExprNode.hh index dfdb04bb5f76b7efd55a751c9f7dc388bd7452a2..c99788748363a213341a6c2745812b7eab8d530c 100644 --- a/src/ExprNode.hh +++ b/src/ExprNode.hh @@ -283,7 +283,7 @@ protected: min_cost(bool is_matlab) { return is_matlab ? min_cost_matlab : min_cost_c; - }; + } //! Initializes data member non_null_derivatives virtual void prepareForDerivation() = 0; diff --git a/src/ModelTree.hh b/src/ModelTree.hh index 4198c299f2554824f4525e059f8f6db7c1bcfb3c..97363ff985695aa0d8ce176b6f03445ebfbc182c 100644 --- a/src/ModelTree.hh +++ b/src/ModelTree.hh @@ -211,7 +211,7 @@ protected: getRecursiveSize() const { return size - mfs_size; - }; + } }; // Whether block decomposition has been successfully computed @@ -559,7 +559,7 @@ protected: { return equation_type_and_normalized_equation[eq_idx_block2orig[blocks[blk].first_equation + eq]] .first; - }; + } //! Return true if the equation has been normalized bool isBlockEquationRenormalized(int blk, int eq) const @@ -567,44 +567,44 @@ protected: return equation_type_and_normalized_equation[eq_idx_block2orig[blocks[blk].first_equation + eq]] .first == EquationType::evaluateRenormalized; - }; + } //! Return the expr_t of equation belonging to the block BinaryOpNode* getBlockEquationExpr(int blk, int eq) const { return equations[eq_idx_block2orig[blocks[blk].first_equation + eq]]; - }; + } //! Return the expr_t of renormalized equation belonging to the block BinaryOpNode* getBlockEquationRenormalizedExpr(int blk, int eq) const { return equation_type_and_normalized_equation[eq_idx_block2orig[blocks[blk].first_equation + eq]] .second; - }; + } //! Return the original number of equation belonging to the block int getBlockEquationID(int blk, int eq) const { return eq_idx_block2orig[blocks[blk].first_equation + eq]; - }; + } //! Return the original number of variable belonging to the block int getBlockVariableID(int blk, int var) const { return endo_idx_block2orig[blocks[blk].first_equation + var]; - }; + } //! Return the position of an equation (given by its original index) inside its block int getBlockInitialEquationID(int blk, int eq) const { return eq_idx_orig2block[eq] - blocks[blk].first_equation; - }; + } //! Return the position of a variable (given by its original index) inside its block int getBlockInitialVariableID(int blk, int var) const { return endo_idx_orig2block[var] - blocks[blk].first_equation; - }; + } //! Initialize equation_reordered & variable_reordered void initializeVariablesAndEquations(); diff --git a/src/Statement.hh b/src/Statement.hh index e67525cb23bfd8c3265ad5a1f8a9a70a4d2627ae..e542e7999c46c12a1c024714aca6688d04f96c52 100644 --- a/src/Statement.hh +++ b/src/Statement.hh @@ -315,7 +315,8 @@ public: /* Applies a variant visitor to the value of the option with that name. Throws UnknownOptionException if there is no option with that name. */ template<class Visitor> - requires invocable<Visitor, OptionValue> decltype(auto) + requires invocable<Visitor, OptionValue> + decltype(auto) visit(const string& name, Visitor&& vis) const { auto it = options.find(name); diff --git a/src/SymbolList.hh b/src/SymbolList.hh index 9c96beb06de7159d08d2c8d377de8f12931535ce..5cf58eb1dd850e9d683d1e8a285ff9e9f9f052e6 100644 --- a/src/SymbolList.hh +++ b/src/SymbolList.hh @@ -63,7 +63,7 @@ public: empty() const { return symbols.empty(); - }; + } //! Return the list of symbols [[nodiscard]] vector<string> getSymbols() const; }; diff --git a/src/SymbolTable.hh b/src/SymbolTable.hh index 3a3a1a3e43cf6b645f3110981ac8fd4493ede553..14eb6ca59bccaa938a843f6c37e27fa266fe5b7c 100644 --- a/src/SymbolTable.hh +++ b/src/SymbolTable.hh @@ -352,7 +352,7 @@ public: AuxVarsSize() const { return aux_vars.size(); - }; + } //! Tests if symbol already exists [[nodiscard]] inline bool exists(const string& name) const; //! Get symbol name (by ID) diff --git a/src/WarningConsolidation.hh b/src/WarningConsolidation.hh index 1285ffdb69fdcd52b611187e18682b1123580550..c806bb41ae77a939638e3db363764fed5d36f163 100644 --- a/src/WarningConsolidation.hh +++ b/src/WarningConsolidation.hh @@ -62,7 +62,7 @@ public: numWarnings() const { return num_warnings; - }; + } }; WarningConsolidation&