3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-29 03:48:51 +00:00

Use "override" keyword where needed. (#9892)

This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings.

The PR adds
```
  "-Wsuggest-override"
  "-Winconsistent-missing-override"
 ```
 to the CLANG_ONLY_WARNINGS.  This exposes a relatively small number of places where method overrides did not use the "override" keyword.  The PR fixes those.
 
(In cmd_util.h, I also made the *_CMD macros be uniform in not ending the class they define with a semicolon; the invocation of the macro can add the semicolon.)
This commit is contained in:
davedets 2026-06-18 12:36:14 -07:00 committed by GitHub
parent 3bf4d2b53d
commit 99a8a922ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 59 additions and 38 deletions

View file

@ -185,12 +185,12 @@ class asserted_formulas {
public: \
FUNCTOR m_functor; \
NAME(asserted_formulas& af):simplify_fmls(af, MSG), m_functor ARG {} \
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { \
m_functor(j.fml(), n, p); \
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { \
m_functor(j.fml(), n, p); \
} \
virtual void post_op() { if (REDUCE) af.reduce_and_solve(); } \
virtual bool should_apply() const { return APP; } \
}; \
void post_op() override { if (REDUCE) af.reduce_and_solve(); } \
bool should_apply() const override { return APP; } \
};
#define MK_SIMPLIFIERF(NAME, FUNCTOR, MSG, APP, REDUCE) MK_SIMPLIFIERA(NAME, FUNCTOR, MSG, APP, (af.m), REDUCE)