Various g++/clang config_test fixes.

This commit is contained in:
Peter Dimov
2014-06-09 01:00:56 +03:00
parent 97618dc66a
commit 051fbf2cc7
4 changed files with 23 additions and 1 deletions

View File

@@ -16,10 +16,18 @@ namespace boost_no_cxx11_hdr_typeindex {
int test()
{
#if defined( BOOST_NO_TYPEID )
std::type_index * p1;
std::hash<std::type_index> h;
(void)p1;
(void)h;
return 0;
#else
std::type_index t1 = typeid(int);
std::type_index t2 = typeid(double);
std::hash<std::type_index> h;
return (t1 != t2) && (h(t1) != h(t2)) ? 0 : 1;
#endif
}
}

View File

@@ -18,7 +18,7 @@ namespace boost_no_cxx11_lambdas {
int test()
{
(void)[](){};
[](){}();
return 0;
}

View File

@@ -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 <stdlib.h>
#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...
}

View File

@@ -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
}
}