From: Martin Quinson Date: Tue, 4 Jun 2019 09:57:18 +0000 (+0200) Subject: Hide the destructor of resource::Model X-Git-Tag: v3.22.4~9 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/981908668a67f1ea5a668df4dc219fdfd73f8ff4 Hide the destructor of resource::Model If "~Model() = default" is in the header file, the compilation fails with the following message: /usr/include/simgrid/kernel/resource/Model.hpp:35:11: required from here /usr/include/c++/6/bits/unique_ptr.h:74:22: error: invalid application of 'sizeof' to incomplete type 'simgrid::kernel::lmm::System' static_assert(sizeof(_Tp)>0, That's too bad because simgrid::kernel::lmm::System is not a public type. This fails in particular when compiling simgrid-FMI. Hiding the destructor in the cpp as done with this commit works better because lmm::System is visible from Model.cpp --- diff --git a/include/simgrid/kernel/resource/Model.hpp b/include/simgrid/kernel/resource/Model.hpp index 91da47c174..a45f4ef5e8 100644 --- a/include/simgrid/kernel/resource/Model.hpp +++ b/include/simgrid/kernel/resource/Model.hpp @@ -32,7 +32,7 @@ public: Model(const Model&) = delete; Model& operator=(const Model&) = delete; - virtual ~Model() = default; + virtual ~Model(); /** @brief Get the set of [actions](@ref Action) in *inited* state */ Action::StateSet* get_inited_action_set() { return &inited_action_set_; } diff --git a/src/kernel/resource/Model.cpp b/src/kernel/resource/Model.cpp index 5eb87c9a83..635f0b9ebc 100644 --- a/src/kernel/resource/Model.cpp +++ b/src/kernel/resource/Model.cpp @@ -13,6 +13,7 @@ namespace kernel { namespace resource { Model::Model(Model::UpdateAlgo algo) : update_algorithm_(algo) {} +Model::~Model() = default; Action::ModifiedSet* Model::get_modified_set() const {