Don't enable GCC C++0x features in non-C++0x mode.

Update tests to actually fail unless we're in C++0x mode.
Fixes #5320.
Fixes #5319.

[SVN r70019]
This commit is contained in:
John Maddock
2011-03-16 18:45:07 +00:00
parent 2edb55f8ad
commit 050da29d47
5 changed files with 17 additions and 10 deletions

View File

@ -168,7 +168,7 @@
// Variadic templates compiler:
// http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
# if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))
# if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__))
# define BOOST_HAS_VARIADIC_TMPL
# else
# define BOOST_NO_VARIADIC_TEMPLATES
@ -183,15 +183,9 @@
# define BOOST_NO_CHAR16_T
# define BOOST_NO_CHAR32_T
# define BOOST_NO_INITIALIZER_LISTS
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
//
// These appear to always be available in GCC-4.4.x regardless of
// whether we are in C++ 0x mode or not:
//
# define BOOST_NO_DEFAULTED_FUNCTIONS
# define BOOST_NO_DELETED_FUNCTIONS
#endif
#endif
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
# define BOOST_NO_SFINAE_EXPR
@ -200,11 +194,8 @@
// C++0x features in 4.5.0 and later
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
// These two appear to be always available:
# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_LAMBDAS
#endif
# define BOOST_NO_RAW_LITERALS
# define BOOST_NO_UNICODE_LITERALS
#endif

View File

@ -10,6 +10,10 @@
// TITLE: C++0x defaulted functions unavailable
// DESCRIPTION: The compiler does not support C++0x defaulted functions
#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
# error Defaulted functions aren't really supported in non-C++0x mode
#endif
namespace boost_no_defaulted_functions {
struct foo {

View File

@ -10,6 +10,10 @@
// TITLE: C++0x =delete functions unavailable
// DESCRIPTION: The compiler does not support C++0x =delete functions
#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
# error Deleted functions aren't really supported in non-C++0x mode
#endif
namespace boost_no_deleted_functions {
struct foo {

View File

@ -10,6 +10,10 @@
// TITLE: C++0x explicit conversion operators unavailable
// DESCRIPTION: The compiler does not support C++0x explicit conversion operators
#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
# error This feature isn't really available in non-C++0x mode
#endif
namespace boost_no_explicit_conversion_operators {
struct foo {

View File

@ -10,6 +10,10 @@
// TITLE: C++0x lambda feature unavailable
// DESCRIPTION: The compiler does not support the C++0x lambda feature
#if defined(__GNUC__) && !defined(__GXX_EXPERIMENTAL_CXX0X__)
# error This feature isn't really available in non-C++0x mode
#endif
namespace boost_no_lambdas {
int test()