From dbaffa9169d3a41fcd3d420af55e3a87d86fc3af Mon Sep 17 00:00:00 2001 From: Bo Rydberg <2945606+bolry@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:36:14 +0100 Subject: [PATCH] Update C++26 deprecated constructs to ensure future standard compliance (#1267) * Update C++26 deprecated constructs to ensure future standard compliance I replaced std::is_trivial with a combination of std::is_trivially_default_constructible and std::is_trivially_copyable. Additionally, I added the required comma before the ellipsis in variadic functions to match updated language specifications. * Some additional is_trivial related changes not found directly when compiling tests in C++26 --------- Co-authored-by: John Wellbelove --- include/etl/generators/type_traits_generator.h | 4 ++-- include/etl/type_traits.h | 4 ++-- test/test_successor.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/etl/generators/type_traits_generator.h b/include/etl/generators/type_traits_generator.h index 68c937f8..1588544f 100644 --- a/include/etl/generators/type_traits_generator.h +++ b/include/etl/generators/type_traits_generator.h @@ -1227,11 +1227,11 @@ typedef integral_constant true_type; /// is_pod ///\ingroup type_traits template - struct is_pod : std::integral_constant::value && std::is_trivial::value> {}; + struct is_pod : std::integral_constant::value && std::is_trivially_default_constructible::value && std::is_trivially_copyable::value> {}; #if ETL_USING_CPP17 template - inline constexpr bool is_pod_v = std::is_standard_layout_v && std::is_trivial_v; + inline constexpr bool is_pod_v = std::is_standard_layout_v && std::is_trivially_default_constructible_v && std::is_trivially_copyable_v; #endif #if defined(ETL_COMPILER_GCC) diff --git a/include/etl/type_traits.h b/include/etl/type_traits.h index 26cd6aef..524b74eb 100644 --- a/include/etl/type_traits.h +++ b/include/etl/type_traits.h @@ -1215,11 +1215,11 @@ typedef integral_constant true_type; /// is_pod ///\ingroup type_traits template - struct is_pod : std::integral_constant::value && std::is_trivial::value> {}; + struct is_pod : std::integral_constant::value && std::is_trivially_default_constructible::value && std::is_trivially_copyable::value> {}; #if ETL_USING_CPP17 template - inline constexpr bool is_pod_v = std::is_standard_layout_v && std::is_trivial_v; + inline constexpr bool is_pod_v = std::is_standard_layout_v && std::is_trivially_default_constructible_v && std::is_trivially_copyable_v; #endif #if defined(ETL_COMPILER_GCC) diff --git a/test/test_successor.cpp b/test/test_successor.cpp index 2e42c0d1..ebbd1300 100644 --- a/test/test_successor.cpp +++ b/test/test_successor.cpp @@ -39,7 +39,7 @@ namespace { } - SuccessorBase(SuccessorBase& successors...) + SuccessorBase(SuccessorBase& successors, ...) : successor(successors) { } @@ -55,7 +55,7 @@ namespace { } - SuccessorSameBase1(SuccessorBase& successors...) + SuccessorSameBase1(SuccessorBase& successors, ...) : SuccessorBase(successors) , value(0) {