]> https://gitweb.dealii.org/ - dealii.git/commit
Fix the MPI window functions with clang. 13975/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 14 Jun 2022 20:23:48 +0000 (16:23 -0400)
committerDavid Wells <drwells@email.unc.edu>
Tue, 14 Jun 2022 20:35:14 +0000 (16:35 -0400)
commitacc25427270be8bb5b3cb7f3a86b90df29a35220
tree64e4494f2e30eb6936d53a217ebedc48e527e702
parent9c9671466f02f6eb4692eabd8f6a37880ed7f3bf
Fix the MPI window functions with clang.

libc++ defines std::unique_ptr::reset() as

    _LIBCPP_INLINE_VISIBILITY
    void reset(nullptr_t = nullptr) _NOEXCEPT {
      pointer __tmp = __ptr_.first();
      __ptr_.first() = nullptr;
      if (__tmp)
        __ptr_.second()(__tmp);
    }

The result of this is that aligned_vector->elements.get() is nullptr at the
point at which we call the deleter - hence this deleter won't work correctly.

We can work around this by avoiding std::unique_ptr::get() and just using our
own member variables or ptr, which are guaranteed to be valid since they will
not be set to nullptr by std::unique_ptr::reset().
include/deal.II/base/aligned_vector.h

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.