From 9fc6cca6011b0fa1f219c90399c018cdcf3206c1 Mon Sep 17 00:00:00 2001 From: mutouyun Date: Tue, 1 Mar 2022 10:48:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BF=AE=E6=AD=A3gcc?= =?UTF-8?q?=E4=B8=8Evc=E5=9C=A8destroy=E6=97=B6=E7=9A=84=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E8=A1=8C=E4=B8=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libipc/utility/construct.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libipc/utility/construct.h b/src/libipc/utility/construct.h index ad21ffd..888cdbd 100644 --- a/src/libipc/utility/construct.h +++ b/src/libipc/utility/construct.h @@ -45,7 +45,7 @@ auto construct(void *p, A &&... args) template void *destroy(T *p) noexcept { -#if defined(LIBIPC_CPP_17) +#if defined(LIBIPC_CPP_17) && !defined(LIBIPC_CC_GNUC) std::destroy_at(p); #else p->~T(); @@ -57,7 +57,7 @@ template void *destroy(T (*p)[N]) noexcept { #if defined(LIBIPC_CPP_20) std::destroy_at(p); -#elif defined(LIBIPC_CPP_17) +#elif defined(LIBIPC_CPP_17) && !defined(LIBIPC_CC_GNUC) std::destroy(std::begin(*p), std::end(*p)); #else for (auto &elem : *p) destroy(std::addressof(elem));