This is an automated email from the ASF dual-hosted git repository.

pitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new e746bd381c GH-49872: [C++] Remove deprecated std::is_trivial (#49871)
e746bd381c is described below

commit e746bd381ce5becb8769229d0144db9278ae7626
Author: Fedor Osetrov <[email protected]>
AuthorDate: Mon Apr 27 17:17:05 2026 +0300

    GH-49872: [C++] Remove deprecated std::is_trivial (#49871)
    
    Resolves https://github.com/apache/arrow/issues/49872
    
    ### Rationale for this change
    
    `std::is_trivial` is deprecated since C++26, so it leads to warning when 
building app with Apache Arrow and new C++ standard
    
    ### What changes are included in this PR?
    
    This PR applies suggestion from libc++ code: 
`'is_trivial<std::shared_ptr<arrow::io::ReadableFile>>' is deprecated: Consider 
using is_trivially_copyable<T>::value && 
is_trivially_default_constructible<T>::value instead`
    
    ### Are these changes tested?
    
    Tested with CI
    
    ### Are there any user-facing changes?
    
    Changes allow user to build with warning as error flags
    * GitHub Issue: #49872
    
    Authored-by: Fedor Osetrov <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 cpp/src/arrow/util/aligned_storage.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/cpp/src/arrow/util/aligned_storage.h 
b/cpp/src/arrow/util/aligned_storage.h
index 5888065070..891e3f0296 100644
--- a/cpp/src/arrow/util/aligned_storage.h
+++ b/cpp/src/arrow/util/aligned_storage.h
@@ -30,7 +30,8 @@ namespace internal {
 template <typename T>
 class AlignedStorage {
  public:
-  static constexpr bool can_memcpy = std::is_trivial<T>::value;
+  static constexpr bool can_memcpy = std::is_trivially_copyable<T>::value &&
+                                     
std::is_trivially_default_constructible<T>::value;
 
   constexpr T* get() noexcept {
     return arrow::internal::launder(reinterpret_cast<T*>(&data_));

Reply via email to