rmaprath created this revision. rmaprath added reviewers: EricWF, jroelofs, mclow.lists, rengolin. rmaprath added a subscriber: cfe-commits.
The macro TEST_HAS_NO_EXCEPTIONS seems to be defined very similar to _LIBCPP_NO_EXCEPTIONS, I'm thinking of getting rid of the former as the latter is more general (defined in __config). I'm curious as to why the TEST_HAS_NO_EXCEPTIONS macro was introduced? Until very recently, we did not have any -fno-exceptions test runs AFAIK. If readability is the reason for this macro, we can instead do: ``` #define TEST_HAS_NO_EXCEPTIONS _LIBCPP_NO_EXCEPTIONS ``` No functional changes. http://reviews.llvm.org/D14616 Files: test/std/experimental/any/any.class/any.assign/copy.pass.cpp test/std/experimental/any/any.class/any.assign/value.pass.cpp test/std/experimental/any/any.class/any.cons/copy.pass.cpp test/std/experimental/any/any.class/any.cons/move.pass.cpp test/std/experimental/any/any.class/any.cons/value.pass.cpp test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp test/support/any_helpers.h test/support/test_macros.h
Index: test/support/test_macros.h =================================================================== --- test/support/test_macros.h +++ test/support/test_macros.h @@ -92,10 +92,6 @@ #define TEST_HAS_NO_RTTI #endif -#if !TEST_HAS_FEATURE(cxx_exceptions) && !defined(__cxx_exceptions) -#define TEST_HAS_NO_EXCEPTIONS -#endif - #if TEST_HAS_FEATURE(address_sanitizer) || TEST_HAS_FEATURE(memory_sanitizer) || \ TEST_HAS_FEATURE(thread_sanitizer) #define TEST_HAS_SANITIZERS Index: test/support/any_helpers.h =================================================================== --- test/support/any_helpers.h +++ test/support/any_helpers.h @@ -216,7 +216,7 @@ struct my_any_exception {}; void throwMyAnyExpression() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS throw my_any_exception(); #else assert(false && "Exceptions are disabled"); Index: test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp =================================================================== --- test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp +++ test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp @@ -71,7 +71,7 @@ template <class Type, class ConstT = Type> void checkThrows(any& a) { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS try { any_cast<Type>(a); assert(false); Index: test/std/experimental/any/any.class/any.cons/value.pass.cpp =================================================================== --- test/std/experimental/any/any.class/any.cons/value.pass.cpp +++ test/std/experimental/any/any.class/any.cons/value.pass.cpp @@ -33,7 +33,7 @@ template <class Type> void test_copy_value_throws() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS assert(Type::count == 0); { Type const t(42); @@ -55,7 +55,7 @@ void test_move_value_throws() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS assert(throws_on_move::count == 0); { throws_on_move v; Index: test/std/experimental/any/any.class/any.cons/move.pass.cpp =================================================================== --- test/std/experimental/any/any.class/any.cons/move.pass.cpp +++ test/std/experimental/any/any.class/any.cons/move.pass.cpp @@ -30,7 +30,7 @@ // not the stored object. void test_move_does_not_throw() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS assert(throws_on_move::count == 0); { throws_on_move v(42); Index: test/std/experimental/any/any.class/any.cons/copy.pass.cpp =================================================================== --- test/std/experimental/any/any.class/any.cons/copy.pass.cpp +++ test/std/experimental/any/any.class/any.cons/copy.pass.cpp @@ -25,7 +25,7 @@ template <class Type> void test_copy_throws() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS assert(Type::count == 0); { any const a((Type(42))); Index: test/std/experimental/any/any.class/any.assign/value.pass.cpp =================================================================== --- test/std/experimental/any/any.class/any.assign/value.pass.cpp +++ test/std/experimental/any/any.class/any.assign/value.pass.cpp @@ -113,7 +113,7 @@ template <class Tp, bool Move = false> void test_assign_throws() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS auto try_throw= [](any& lhs, auto&& rhs) { try { Index: test/std/experimental/any/any.class/any.assign/copy.pass.cpp =================================================================== --- test/std/experimental/any/any.class/any.assign/copy.pass.cpp +++ test/std/experimental/any/any.class/any.assign/copy.pass.cpp @@ -131,7 +131,7 @@ template <class Tp> void test_copy_assign_throws() { -#if !defined(TEST_HAS_NO_EXCEPTIONS) +#ifndef _LIBCPP_NO_EXCEPTIONS auto try_throw = [](any& lhs, any const& rhs) { try {
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits