Skip to content

Commit

Permalink
apply destroying delete workaround for gcc compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
justusranvier committed Oct 21, 2022
1 parent 051fccf commit 4d832a9
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
22 changes: 10 additions & 12 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@ jobs:
strategy:
fail-fast: false
matrix:
# temporarily disable gcc
# toolchain: [gcc-10.3, gcc-11.3, gcc-12.2, clang-12, clang-13, clang-14, clang-15]
toolchain: [clang-12, clang-13, clang-14, clang-15]
toolchain: [gcc-10.3, gcc-11.3, gcc-12.2, clang-12, clang-13, clang-14, clang-15]
preset: [test01, test02, test03, test04, test05, test06, test07, test08, nopch, full]
include:
# - toolchain: gcc-10.3
# docker: 33_2
# compiler: gcc
# - toolchain: gcc-11.3
# docker: 35_2
# compiler: gcc
# - toolchain: gcc-12.2
# docker: 37_1
# compiler: gcc
- toolchain: gcc-10.3
docker: 33_2
compiler: gcc
- toolchain: gcc-11.3
docker: 35_2
compiler: gcc
- toolchain: gcc-12.2
docker: 37_1
compiler: gcc
- toolchain: clang-12
docker: 34_2
compiler: clang
Expand Down
6 changes: 4 additions & 2 deletions src/crypto/asymmetric/base/Key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ auto Key::operator=(const Key& rhs) noexcept -> Key&
if (imp_ != rhs.imp_) {
auto* old{imp_};
imp_ = rhs.imp_->clone(get_allocator());
delete old;
auto deleter = old->get_deleter();
std::invoke(deleter, old);
}

return *this;
Expand Down Expand Up @@ -170,7 +171,8 @@ auto Key::Version() const noexcept -> VersionNumber { return imp_->Version(); }
Key::~Key()
{
if (nullptr != imp_) {
delete imp_;
auto deleter = imp_->get_deleter();
std::invoke(deleter, imp_);
imp_ = nullptr;
}
}
Expand Down
8 changes: 0 additions & 8 deletions src/crypto/asymmetric/base/KeyPrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,14 +302,6 @@ auto KeyPrivate::HasPublic() const noexcept -> bool { return false; }

auto KeyPrivate::IsValid() const noexcept -> bool { return false; }

auto KeyPrivate::operator delete(
KeyPrivate* ptr,
std::destroying_delete_t) noexcept -> void
{
auto deleter = ptr->get_deleter();
std::invoke(deleter, ptr);
}

auto KeyPrivate::PreferredHash() const noexcept -> crypto::HashType
{
return HashType::Error;
Expand Down
3 changes: 0 additions & 3 deletions src/crypto/asymmetric/base/KeyPrivate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,6 @@ class KeyPrivate : virtual public internal::Key,
{
public:
static auto Blank(allocator_type alloc) noexcept -> KeyPrivate*;
static auto operator delete(
KeyPrivate* ptr,
std::destroying_delete_t) noexcept -> void;
static auto Reset(asymmetric::Key& key) noexcept -> void;

[[nodiscard]] virtual auto asEllipticCurvePrivate() const noexcept
Expand Down

0 comments on commit 4d832a9

Please sign in to comment.