From 051fbf2cc7945e0f49a3c136293ec422585cd8a7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 9 Jun 2014 01:00:56 +0300 Subject: [PATCH] Various g++/clang config_test fixes. --- test/boost_no_cxx11_hdr_typeindex.ipp | 8 ++++++++ test/boost_no_lambdas.ipp | 2 +- test/boost_no_ret_det.ipp | 7 +++++++ test/boost_no_rtti.ipp | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/test/boost_no_cxx11_hdr_typeindex.ipp b/test/boost_no_cxx11_hdr_typeindex.ipp index aa0358c7..5ebe7bc2 100644 --- a/test/boost_no_cxx11_hdr_typeindex.ipp +++ b/test/boost_no_cxx11_hdr_typeindex.ipp @@ -16,10 +16,18 @@ namespace boost_no_cxx11_hdr_typeindex { int test() { +#if defined( BOOST_NO_TYPEID ) + std::type_index * p1; + std::hash h; + (void)p1; + (void)h; + return 0; +#else std::type_index t1 = typeid(int); std::type_index t2 = typeid(double); std::hash h; return (t1 != t2) && (h(t1) != h(t2)) ? 0 : 1; +#endif } } diff --git a/test/boost_no_lambdas.ipp b/test/boost_no_lambdas.ipp index be412261..faa67d85 100644 --- a/test/boost_no_lambdas.ipp +++ b/test/boost_no_lambdas.ipp @@ -18,7 +18,7 @@ namespace boost_no_cxx11_lambdas { int test() { - (void)[](){}; + [](){}(); return 0; } diff --git a/test/boost_no_ret_det.ipp b/test/boost_no_ret_det.ipp index c2f08ac2..253e4584 100644 --- a/test/boost_no_ret_det.ipp +++ b/test/boost_no_ret_det.ipp @@ -12,12 +12,19 @@ // compilers insist on it, while other issue a // bunch of warnings if it is in fact present. +#if defined( BOOST_NO_EXCEPTIONS ) && !defined( _MSC_VER ) +# include +#endif namespace boost_no_unreachable_return_detection{ int checker() { +#if defined( BOOST_NO_EXCEPTIONS ) && !defined( _MSC_VER ) + abort(); +#else throw 0; +#endif // no return statement: we don't ever get here... } diff --git a/test/boost_no_rtti.ipp b/test/boost_no_rtti.ipp index dd8992bc..4295d70c 100644 --- a/test/boost_no_rtti.ipp +++ b/test/boost_no_rtti.ipp @@ -43,6 +43,12 @@ int check_f(const A& a) int test() { +#if defined( BOOST_NO_EXCEPTIONS ) + { + B b; + return check_f(b); + } +#else try{ B b; return check_f(b); @@ -51,6 +57,7 @@ int test() { return 1; } +#endif } }