3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-13 04:13:01 +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

@ -315,11 +315,11 @@ class sort_size {
// of elements is at least bigger than 2^64.
SS_FINITE_VERY_BIG,
SS_INFINITE
} m_kind;
uint64_t m_size; // It is only meaningful if m_kind == SS_FINITE
} m_kind = SS_INFINITE;
uint64_t m_size = 0; // It is only meaningful if m_kind == SS_FINITE
sort_size(kind_t k, uint64_t r):m_kind(k), m_size(r) {}
public:
sort_size():m_kind(SS_INFINITE), m_size(0) {}
sort_size() = default;
sort_size(uint64_t sz):m_kind(SS_FINITE), m_size(sz) {}
explicit sort_size(rational const& r) {
if (r.is_uint64()) {

View file

@ -23,9 +23,9 @@ Notes:
#include "ast/ast_translation.h"
class converter {
unsigned m_ref_count;
unsigned m_ref_count = 0;
public:
converter():m_ref_count(0) {}
converter() = default;
virtual ~converter() = default;
void inc_ref() { ++m_ref_count; }

View file

@ -22,10 +22,10 @@ Revision History:
\brief Auxiliary structure used to cache the intermediate results of the variable substitution procedure.
*/
struct expr_delta_pair {
expr * m_node;
unsigned m_delta;
expr * m_node = nullptr;
unsigned m_delta = 0;
expr_delta_pair():m_node(nullptr), m_delta(0) {}
expr_delta_pair() = default;
expr_delta_pair(expr * n, unsigned d):m_node(n), m_delta(d) {}
unsigned hash() const { return hash_u_u(m_node->hash(), m_delta); }
bool operator==(const expr_delta_pair & e) const { return m_node == e.m_node && m_delta == e.m_delta; }

View file

@ -24,12 +24,11 @@ Revision History:
class expr;
struct expr_stat {
unsigned m_sym_count; // symbol count
unsigned m_depth; // depth
unsigned m_const_count; // constant count
unsigned m_max_var_idx;
bool m_ground;
expr_stat():m_sym_count(0), m_depth(0), m_const_count(0), m_max_var_idx(0), m_ground(true) {}
unsigned m_sym_count = 0; // symbol count
unsigned m_depth = 0; // depth
unsigned m_const_count = 0; // constant count
unsigned m_max_var_idx = 0;
bool m_ground = true;
};
/**

View file

@ -26,10 +26,10 @@ Revision History:
#include "ast/ast.h"
class expr_offset {
expr * m_expr;
unsigned m_offset;
expr * m_expr = nullptr;
unsigned m_offset = 0;
public:
expr_offset():m_expr(nullptr), m_offset(0) {}
expr_offset() = default;
expr_offset(expr * e, unsigned o):m_expr(e), m_offset(o) {}
expr * get_expr() const { return m_expr; }

View file

@ -28,8 +28,7 @@ template<typename T>
class expr_offset_map {
struct data {
T m_data;
unsigned m_timestamp;
data():m_timestamp(0) {}
unsigned m_timestamp = 0;
};
vector<svector<data> > m_map;
unsigned m_timestamp;

View file

@ -29,8 +29,7 @@ class var_offset_map {
protected:
struct data {
T m_data;
unsigned m_timestamp;
data():m_timestamp(0) {}
unsigned m_timestamp = 0;
};
svector<data> m_map;