Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r70019 - in trunk: boost/config/compiler libs/config/test
From: john_at_[hidden]
Date: 2011-03-16 14:45:08


Author: johnmaddock
Date: 2011-03-16 14:45:07 EDT (Wed, 16 Mar 2011)
New Revision: 70019
URL: http://svn.boost.org/trac/boost/changeset/70019

Log:
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.
Text files modified:
   trunk/boost/config/compiler/gcc.hpp | 11 +----------
   trunk/libs/config/test/boost_no_defaulted_functions.ipp | 4 ++++
   trunk/libs/config/test/boost_no_deleted_functions.ipp | 4 ++++
   trunk/libs/config/test/boost_no_explicit_cvt_ops.ipp | 4 ++++
   trunk/libs/config/test/boost_no_lambdas.ipp | 4 ++++
   5 files changed, 17 insertions(+), 10 deletions(-)

Modified: trunk/boost/config/compiler/gcc.hpp
==============================================================================
--- trunk/boost/config/compiler/gcc.hpp (original)
+++ trunk/boost/config/compiler/gcc.hpp 2011-03-16 14:45:07 EDT (Wed, 16 Mar 2011)
@@ -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

Modified: trunk/libs/config/test/boost_no_defaulted_functions.ipp
==============================================================================
--- trunk/libs/config/test/boost_no_defaulted_functions.ipp (original)
+++ trunk/libs/config/test/boost_no_defaulted_functions.ipp 2011-03-16 14:45:07 EDT (Wed, 16 Mar 2011)
@@ -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 {

Modified: trunk/libs/config/test/boost_no_deleted_functions.ipp
==============================================================================
--- trunk/libs/config/test/boost_no_deleted_functions.ipp (original)
+++ trunk/libs/config/test/boost_no_deleted_functions.ipp 2011-03-16 14:45:07 EDT (Wed, 16 Mar 2011)
@@ -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 {

Modified: trunk/libs/config/test/boost_no_explicit_cvt_ops.ipp
==============================================================================
--- trunk/libs/config/test/boost_no_explicit_cvt_ops.ipp (original)
+++ trunk/libs/config/test/boost_no_explicit_cvt_ops.ipp 2011-03-16 14:45:07 EDT (Wed, 16 Mar 2011)
@@ -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 {

Modified: trunk/libs/config/test/boost_no_lambdas.ipp
==============================================================================
--- trunk/libs/config/test/boost_no_lambdas.ipp (original)
+++ trunk/libs/config/test/boost_no_lambdas.ipp 2011-03-16 14:45:07 EDT (Wed, 16 Mar 2011)
@@ -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()


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk