3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-14 04:41:48 +00:00

Remove redundant default constructors when they're the only constructor (#8461)

* Initial plan

* Modernize C++ constructors to use C++11 default member initialization - Phase 1

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>

* Fix theory_pb.h struct definition - move reset() back inside struct

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>

* Modernize C++ constructors to use C++11 default member initialization - Phase 2

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>

* Fix opt_solver.h - revert rational initialization (complex type)

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>

* Modernize C++ constructors to use C++11 default member initialization - Phase 3

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>

* Fix sparse_matrix.h - explicitly initialize union member in default constructor

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>

* Remove unnecessary default constructors when they're the only constructor

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
This commit is contained in:
Copilot 2026-02-01 16:51:26 -08:00 committed by GitHub
parent 04ec450b02
commit 23c531a4c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 82 additions and 101 deletions

View file

@ -116,15 +116,13 @@ namespace sat {
};
struct prefix {
unsigned m_prefix;
unsigned m_length;
prefix(): m_prefix(0), m_length(0) {}
unsigned m_prefix = 0;
unsigned m_length = 0;
};
struct lit_info {
double m_lookahead_reward;
unsigned m_double_lookahead;
lit_info(): m_lookahead_reward(0), m_double_lookahead(0) {}
double m_lookahead_reward = 0;
unsigned m_double_lookahead = 0;
};
struct stats {

View file

@ -29,10 +29,10 @@ namespace euf {
class ackerman {
struct inference : dll_base<inference>{
expr* a, *b, *c;
expr* a = nullptr, *b = nullptr, *c = nullptr;
unsigned m_count{ 0 };
bool is_cc;
inference(): a(nullptr), b(nullptr), c(nullptr), is_cc(false) {}
bool is_cc = false;
inference() = default;
inference(app* a, app* b): a(a), b(b), c(nullptr), is_cc(true) {}
inference(expr* a, expr* b, expr* c): a(a), b(b), c(c), is_cc(false) {}
};

View file

@ -30,14 +30,13 @@ namespace sat {
};
class constraint_base {
extension* m_ex;
extension* m_ex = nullptr;
unsigned m_mem[0];
static size_t ext_size() {
return sizeof(((constraint_base*)nullptr)->m_ex);
}
public:
constraint_base(): m_ex(nullptr) {}
void* mem() { return m_mem; }
static size_t obj_size(size_t sz) {