From 3e4ad14dfe840e2e1c8be9cf5c92c811e7671232 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 18 Oct 2024 09:44:56 +0100 Subject: [PATCH] GCC compatibility updates --- include/etl/type_list.h | 2 +- test/CMakeLists.txt | 2 ++ test/test_delegate.cpp | 4 +++- test/test_function_traits.cpp | 7 ++++--- test/test_type_list.cpp | 1 - 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/etl/type_list.h b/include/etl/type_list.h index 0d145b59..4c70480c 100644 --- a/include/etl/type_list.h +++ b/include/etl/type_list.h @@ -125,7 +125,7 @@ namespace etl template struct nth_type> { - ETL_STATIC_ASSERT(false, "etl::nth_type invoked for empty etl::type_list"); + //ETL_STATIC_ASSERT(false, "etl::nth_type invoked for empty etl::type_list"); }; //*************************************************************************** diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index ce9e2a66..8a357d56 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -143,6 +143,7 @@ add_executable(etl_tests test_fsm.cpp test_function.cpp test_functional.cpp + test_function_traits.cpp test_gamma.cpp test_hash.cpp test_hfsm.cpp @@ -283,6 +284,7 @@ add_executable(etl_tests test_to_u8string.cpp test_to_wstring.cpp test_type_def.cpp + test_type_list.cpp test_type_lookup.cpp test_type_select.cpp test_type_traits.cpp diff --git a/test/test_delegate.cpp b/test/test_delegate.cpp index c0f3f77a..612a2d94 100644 --- a/test/test_delegate.cpp +++ b/test/test_delegate.cpp @@ -261,8 +261,10 @@ namespace Object object_static; const Object const_object_static; +#if ETL_USING_CPP17 Functor functor_static; const FunctorConst const_functor_static; +#endif } namespace @@ -677,7 +679,7 @@ namespace } #endif -#if !defined(ETL_COMPILER_GCC) +#if !(defined(ETL_COMPILER_GCC) && (__GNUC__ <= 8)) //************************************************************************* TEST_FIXTURE(SetupFixture, test_member_operator_void_compile_time) { diff --git a/test/test_function_traits.cpp b/test/test_function_traits.cpp index 575f0a35..8355f793 100644 --- a/test/test_function_traits.cpp +++ b/test/test_function_traits.cpp @@ -47,7 +47,7 @@ namespace //***************************************************************************** int free_int(int i, int j) { - return 0; + return i + j; } //***************************************************************************** @@ -71,18 +71,19 @@ namespace // int int member_int(int i, int j) { - return 0; + return i + j; } int member_int_const(int i, int j) const { - return 0; + return i + j; } //******************************************* // static static void member_static(int j) { + (void)j; } }; } diff --git a/test/test_type_list.cpp b/test/test_type_list.cpp index 39c674d2..38570804 100644 --- a/test/test_type_list.cpp +++ b/test/test_type_list.cpp @@ -39,7 +39,6 @@ namespace //************************************************************************* TEST(test_type_list_nth_type) { - using tl0 = etl::type_list<>; using tl1 = etl::type_list; using tl2 = etl::type_list; using tl3 = etl::type_list;