From 1fae23252c0ea024f15012fc1ec20f0ff4c36209 Mon Sep 17 00:00:00 2001 From: Romain Geissler Date: Thu, 7 May 2026 10:26:58 +0000 Subject: [PATCH] Stop using the now deprecated std::is_trivial. std::is_trivial is deprecated in C++26. Using gcc 15 and C++26 yields this warning: /data/mwrep/res/mdw/SIOTF/internal/osp/aws_sdk/25-0-0-1/include/aws/core/utils/memory/AWSMemory.h: In function 'Aws::UniquePtr Aws::MakeUnique(const char*, ArgTypes&& ...)': /data/mwrep/res/mdw/SIOTF/internal/osp/aws_sdk/25-0-0-1/include/aws/core/utils/memory/AWSMemory.h:307:56: error: 'template struct std::is_trivial' is deprecated: use 'is_trivially_default_constructible && is_triviall y_copyable' instead [-Werror=deprecated-declarations] 307 | static_assert(!std::is_array::value || std::is_trivial::value, | ^~~~~~~~~~ So do as gcc suggests, and replace it by a combination of is_trivially_default_constructible and is_trivially_copyable. --- .../include/aws/core/utils/memory/AWSMemory.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h b/src/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h index 16960f0a4659..6ffecd0f861c 100644 --- a/src/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h +++ b/src/aws-cpp-sdk-core/include/aws/core/utils/memory/AWSMemory.h @@ -304,7 +304,7 @@ namespace Aws template UniquePtr MakeUnique(const char* allocationTag, ArgTypes&&... args) { - static_assert(!std::is_array::value || std::is_trivial::value, + static_assert(!std::is_array::value || (std::is_trivially_default_constructible::value && std::is_trivially_copyable::value), "This wrapper/function is not designed to support non-trivial arrays."); return UniquePtr(Aws::New(allocationTag, std::forward(args)...)); } @@ -312,7 +312,7 @@ namespace Aws template, typename ...ArgTypes> UniquePtrSafeDeleted MakeUniqueSafeDeleted(const char* allocationTag, ArgTypes&&... args) { - static_assert(!std::is_array::value || std::is_trivial::value, + static_assert(!std::is_array::value || (std::is_trivially_default_constructible::value && std::is_trivially_copyable::value), "This wrapper/function is not designed to support non-trivial arrays."); return UniquePtrSafeDeleted(Aws::New(allocationTag, std::forward(args)...), D());