From 0deb8556765c4681cb328ba1a4e1c2193a09bbdb Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Thu, 4 Sep 2025 12:52:35 +0100 Subject: [PATCH] Disabled constexpr const container tests for C++11 --- support/Release notes.txt | 3 ++- test/test_const_map_ext_constexpr.cpp | 4 ++++ test/test_const_multimap_ext_constexpr.cpp | 4 ++++ test/test_const_multiset.cpp | 8 ++++---- test/test_const_multiset_constexpr.cpp | 12 ++++++++---- test/test_const_multiset_ext.cpp | 8 ++++---- test/test_const_multiset_ext_constexpr.cpp | 14 +++++++++----- test/test_const_set.cpp | 8 ++++---- test/test_const_set_constexpr.cpp | 12 ++++++++---- test/test_const_set_ext.cpp | 8 ++++---- test/test_const_set_ext_constexpr.cpp | 12 ++++++++---- test/vs2022/etl.vcxproj | 1 + test/vs2022/etl.vcxproj.filters | 3 +++ 13 files changed, 63 insertions(+), 34 deletions(-) diff --git a/support/Release notes.txt b/support/Release notes.txt index f2f5105a..9c6b95b9 100644 --- a/support/Release notes.txt +++ b/support/Release notes.txt @@ -5,10 +5,11 @@ Updates: #1170 Place a typed pointer instead of a bool into etl::typed_storage Modified the storage used by etl::typed_storage to be a union, along the lines of etl::optional. Added etl::typed_storage_ext to wrap external storage. + +Fixes: #1176 Fix GCC __builtin_memcpy errors when compiling with -O2 optimisation #1180 Duplicate definition of const_reference in etl::const_set_ext - =============================================================================== 20.43.0 diff --git a/test/test_const_map_ext_constexpr.cpp b/test/test_const_map_ext_constexpr.cpp index 845f9185..c1735fff 100644 --- a/test/test_const_map_ext_constexpr.cpp +++ b/test/test_const_map_ext_constexpr.cpp @@ -41,6 +41,8 @@ SOFTWARE. #include "data.h" +#if ETL_USING_CPP14 + namespace { static constexpr size_t Max_Size = 10UL; @@ -1711,3 +1713,5 @@ namespace } }; } + +#endif diff --git a/test/test_const_multimap_ext_constexpr.cpp b/test/test_const_multimap_ext_constexpr.cpp index 0c059c90..9425e42b 100644 --- a/test/test_const_multimap_ext_constexpr.cpp +++ b/test/test_const_multimap_ext_constexpr.cpp @@ -41,6 +41,8 @@ SOFTWARE. #include "data.h" +#if ETL_USING_CPP14 + namespace { static constexpr size_t Max_Size = 10UL; @@ -1509,3 +1511,5 @@ namespace } }; } + +#endif diff --git a/test/test_const_multiset.cpp b/test/test_const_multiset.cpp index 4e444495..ae97994b 100644 --- a/test/test_const_multiset.cpp +++ b/test/test_const_multiset.cpp @@ -86,10 +86,10 @@ namespace } // Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN diff --git a/test/test_const_multiset_constexpr.cpp b/test/test_const_multiset_constexpr.cpp index d9cba6f7..af7fcb71 100644 --- a/test/test_const_multiset_constexpr.cpp +++ b/test/test_const_multiset_constexpr.cpp @@ -37,6 +37,8 @@ SOFTWARE. #include "data.h" +#if ETL_USING_CPP14 + namespace { static constexpr size_t Max_Size = 10UL; @@ -86,10 +88,10 @@ namespace } // Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN @@ -1324,3 +1326,5 @@ namespace } }; } + +#endif diff --git a/test/test_const_multiset_ext.cpp b/test/test_const_multiset_ext.cpp index 44780f81..a05fef54 100644 --- a/test/test_const_multiset_ext.cpp +++ b/test/test_const_multiset_ext.cpp @@ -87,10 +87,10 @@ namespace } // Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN diff --git a/test/test_const_multiset_ext_constexpr.cpp b/test/test_const_multiset_ext_constexpr.cpp index 6d58c18b..e04d79b7 100644 --- a/test/test_const_multiset_ext_constexpr.cpp +++ b/test/test_const_multiset_ext_constexpr.cpp @@ -38,6 +38,8 @@ SOFTWARE. #include "data.h" +#if ETL_USING_CPP14 + namespace { static constexpr size_t Max_Size = 10UL; @@ -86,11 +88,11 @@ namespace return (lhs.k == rhs.k); } - //// Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + // Equality operator for Key != Key + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN @@ -1421,3 +1423,5 @@ namespace } }; } + +#endif diff --git a/test/test_const_set.cpp b/test/test_const_set.cpp index 6e3ec66b..c923a3e2 100644 --- a/test/test_const_set.cpp +++ b/test/test_const_set.cpp @@ -84,10 +84,10 @@ namespace } // Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN diff --git a/test/test_const_set_constexpr.cpp b/test/test_const_set_constexpr.cpp index f8f7c467..c126bddf 100644 --- a/test/test_const_set_constexpr.cpp +++ b/test/test_const_set_constexpr.cpp @@ -33,6 +33,8 @@ SOFTWARE. #include #include +#if ETL_USING_CPP14 + #include "etl/const_set.h" namespace @@ -84,10 +86,10 @@ namespace } // Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN @@ -1433,3 +1435,5 @@ namespace } }; } + +#endif diff --git a/test/test_const_set_ext.cpp b/test/test_const_set_ext.cpp index 7f613308..b96fffb4 100644 --- a/test/test_const_set_ext.cpp +++ b/test/test_const_set_ext.cpp @@ -90,10 +90,10 @@ namespace } // Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN diff --git a/test/test_const_set_ext_constexpr.cpp b/test/test_const_set_ext_constexpr.cpp index 13ce5216..8362e8ea 100644 --- a/test/test_const_set_ext_constexpr.cpp +++ b/test/test_const_set_ext_constexpr.cpp @@ -41,6 +41,8 @@ SOFTWARE. #include "data.h" +#if ETL_USING_CPP14 + namespace { static constexpr size_t Max_Size = 10UL; @@ -90,10 +92,10 @@ namespace } // Equality operator for Key != Key - //constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept - //{ - // return !(lhs.k == rhs.k); - //} + constexpr bool operator !=(const Key& lhs, const Key& rhs) noexcept + { + return !(lhs.k == rhs.k); + } #define TEST_GREATER_THAN #ifdef TEST_GREATER_THAN @@ -1568,3 +1570,5 @@ namespace } }; } + +#endif diff --git a/test/vs2022/etl.vcxproj b/test/vs2022/etl.vcxproj index de73f599..8a6a48f0 100644 --- a/test/vs2022/etl.vcxproj +++ b/test/vs2022/etl.vcxproj @@ -11367,6 +11367,7 @@ + diff --git a/test/vs2022/etl.vcxproj.filters b/test/vs2022/etl.vcxproj.filters index 21a0fa75..e36573c9 100644 --- a/test/vs2022/etl.vcxproj.filters +++ b/test/vs2022/etl.vcxproj.filters @@ -3883,6 +3883,9 @@ Resource Files\CI + + ETL\Arduino +