diff --git a/include/EASTL/internal/config.h b/include/EASTL/internal/config.h index f51c344b..cc5aa042 100644 --- a/include/EASTL/internal/config.h +++ b/include/EASTL/internal/config.h @@ -105,8 +105,8 @@ /////////////////////////////////////////////////////////////////////////////// #ifndef EASTL_VERSION - #define EASTL_VERSION "3.05.03" - #define EASTL_VERSION_N 30503 + #define EASTL_VERSION "3.05.04" + #define EASTL_VERSION_N 30504 #endif diff --git a/include/EASTL/internal/hashtable.h b/include/EASTL/internal/hashtable.h index 57b23ed8..3c5a1e41 100644 --- a/include/EASTL/internal/hashtable.h +++ b/include/EASTL/internal/hashtable.h @@ -186,8 +186,8 @@ namespace eastl // contains the cached hashed value or not. #define ENABLE_IF_HAS_HASHCODE(T, RT) typename eastl::enable_if::value, RT>::type* #define ENABLE_IF_HASHCODE_U32(T, RT) typename eastl::enable_if::value, RT>::type - #define ENABLE_IF_TRUETYPE(T) typename eastl::enable_if::type* - #define DISABLE_IF_TRUETYPE(T) typename eastl::enable_if::type* + #define ENABLE_IF_TRUETYPE(T) typename eastl::enable_if::type* + #define DISABLE_IF_TRUETYPE(T) typename eastl::enable_if::type* /// node_iterator_base @@ -1230,11 +1230,11 @@ namespace eastl void DoFreeBuckets(node_type** pBucketArray, size_type n); #if EASTL_MOVE_SEMANTICS_ENABLED && EASTL_VARIADIC_TEMPLATES_ENABLED - template - eastl::pair DoInsertValue(BoolConstantT, Args&&... args, ENABLE_IF_TRUETYPE(BoolConstantT) = 0); + template + eastl::pair DoInsertValue(BoolConstantT, Args&&... args); - template - iterator DoInsertValue(BoolConstantT, Args&&... args, DISABLE_IF_TRUETYPE(BoolConstantT) = 0); + template + iterator DoInsertValue(BoolConstantT, Args&&... args); template node_type* DoAllocateNode(Args&&... args); @@ -1989,9 +1989,9 @@ namespace eastl #if EASTL_MOVE_SEMANTICS_ENABLED && EASTL_VARIADIC_TEMPLATES_ENABLED template - template + template eastl::pair::iterator, bool> - hashtable::DoInsertValue(BoolConstantT, Args&&... args, ENABLE_IF_TRUETYPE(BoolConstantT)) // true_type means bUniqueKeys is true. + hashtable::DoInsertValue(BoolConstantT, Args&&... args) // true_type means bUniqueKeys is true. { // Adds the value to the hash table if not already present. // If already present then the existing value is returned via an iterator/bool pair. @@ -2059,9 +2059,9 @@ namespace eastl template - template + template typename hashtable::iterator - hashtable::DoInsertValue(BoolConstantT, Args&&... args, DISABLE_IF_TRUETYPE(BoolConstantT)) // false_type means bUniqueKeys is false. + hashtable::DoInsertValue(BoolConstantT, Args&&... args) // false_type means bUniqueKeys is false. { const eastl::pair bRehash = mRehashPolicy.GetRehashRequired((uint32_t)mnBucketCount, (uint32_t)mnElementCount, (uint32_t)1); diff --git a/include/EASTL/list.h b/include/EASTL/list.h index c0a8eb99..0b41491e 100644 --- a/include/EASTL/list.h +++ b/include/EASTL/list.h @@ -57,6 +57,7 @@ #pragma warning(disable: 4530) // C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc #pragma warning(disable: 4345) // Behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized #pragma warning(disable: 4571) // catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught. + #pragma warning(disable: 4623) // default constructor was implicitly defined as deleted #endif EA_DISABLE_SN_WARNING(828); // The EDG SN compiler has a bug in its handling of variadic template arguments and mistakenly reports "parameter "args" was never referenced" diff --git a/test/packages/EATest/include/EATest/EATest.h b/test/packages/EATest/include/EATest/EATest.h index 16958af7..5069fc21 100644 --- a/test/packages/EATest/include/EATest/EATest.h +++ b/test/packages/EATest/include/EATest/EATest.h @@ -343,27 +343,69 @@ namespace EA #define EATEST_VERIFY_F(bExpression, pFormat, ...) EA::UnitTest::TestInternal::EATEST_VERIFY_F_IMP((bExpression), nErrorCount, __FILE__, __LINE__, pFormat, __VA_ARGS__) #endif - /// EATEST_VERIFY_THROW - /// EATEST_VERIFY_NOTHROW - /// - /// This macro confirms whether or not an expression throws or doesn't throw. If it's not the case that EASTL_EXCEPTIONS_ENABLED - /// the provided expression will not be evaluated. - /// - /// See EATEST_VERIFY for details about error reporting and the _MSG variants - #if EASTL_EXCEPTIONS_ENABLED - #define EATEST_VERIFY_THROW(expression) {bool isNoThrow; try{ {expression;} isNoThrow=true; }catch(...){isNoThrow=false;} EATEST_VERIFY(!isNoThrow); } - #define EATEST_VERIFY_NOTHROW(expression) {bool isNoThrow; try{ {expression;} isNoThrow=true; }catch(...){isNoThrow=false;} EATEST_VERIFY(isNoThrow); } - #define EATEST_VERIFY_THROW_MSG(expression, msg) {bool isNoThrow; try{ {expression;} isNoThrow=true; }catch(...){isNoThrow=false;} EATEST_VERIFY_MSG(!isNoThrow, msg); } - #define EATEST_VERIFY_NOTHROW_MSG(expression, msg) {bool isNoThrow; try{ {expression;} isNoThrow=true; }catch(...){isNoThrow=false;} EATEST_VERIFY_MSG(isNoThrow, msg); } - #else - #define EATEST_VERIFY_THROW(expression) - #define EATEST_VERIFY_NOTHROW(expression) - #define EATEST_VERIFY_THROW_MSG(expression, msg) - #define EATEST_VERIFY_NOTHROW_MSG(expression, msg) - #endif - - - /////////////////////////////////////////////////////////////////////// + /// EATEST_VERIFY_THROW + /// EATEST_VERIFY_NOTHROW + /// + /// This macro confirms whether or not an expression throws or doesn't throw. + /// + /// See EATEST_VERIFY for details about error reporting and the _MSG variants + #if !defined(EA_COMPILER_NO_EXCEPTIONS) + + #define EATEST_VERIFY_IMPL(expression) \ + bool EA_PREPROCESSOR_JOIN(isThrow, __LINE__) = false; \ + try \ + { \ + (expression); \ + } \ + catch (...) \ + { \ + EA_PREPROCESSOR_JOIN(isThrow, __LINE__) = true; \ + } + + #define EATEST_VERIFY_THROW(expression) \ + do \ + { \ + { \ + EATEST_VERIFY_IMPL(expression) \ + EATEST_VERIFY(EA_PREPROCESSOR_JOIN(isThrow, __LINE__)); \ + } \ + } while (false) + + #define EATEST_VERIFY_NOTHROW(expression) \ + do \ + { \ + { \ + EATEST_VERIFY_IMPL(expression) \ + EATEST_VERIFY(!EA_PREPROCESSOR_JOIN(isThrow, __LINE__)); \ + } \ + } while (false) + + #define EATEST_VERIFY_THROW_MSG(expression, msg) \ + do \ + { \ + { \ + EATEST_VERIFY_IMPL(expression) \ + EATEST_VERIFY_MSG(EA_PREPROCESSOR_JOIN(isThrow, __LINE__), msg); \ + } \ + } while (false) + + #define EATEST_VERIFY_NOTHROW_MSG(expression, msg) \ + do \ + { \ + { \ + EATEST_VERIFY_IMPL(expression) \ + EATEST_VERIFY_MSG(!EA_PREPROCESSOR_JOIN(isThrow, __LINE__), msg); \ + } \ + } while (false) + #else + #define EATEST_VERIFY_THROW(expression) + #define EATEST_VERIFY_NOTHROW(expression) + #define EATEST_VERIFY_THROW_MSG(expression, msg) + #define EATEST_VERIFY_NOTHROW_MSG(expression, msg) + #endif + + + /////////////////////////////////////////////////////////////////////// /// GetSystemTimeMicroseconds /// /// While this function could be used for basic benchmarking, the diff --git a/test/source/TestList.cpp b/test/source/TestList.cpp index 53760224..49296c07 100644 --- a/test/source/TestList.cpp +++ b/test/source/TestList.cpp @@ -65,6 +65,11 @@ namespace bool operator==(const C& rhs) { return mC == rhs.mC; } int mC; }; + + struct D + { + D() = delete; + }; } @@ -90,6 +95,12 @@ int TestList() int nErrorCount = 0; + { + // test T with a deleted default-ctor + eastl::list dlist; + + } + EATEST_VERIFY(TestObject::IsClear()); TestObject::Reset();