From 4464cf9f478ea47a1ee3d57943928bf58ef9fcb8 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Wed, 21 Apr 2010 08:49:21 +0000 Subject: [PATCH] Update some of the C++0x tests so they don't catch "fake" implementations. Update config for VC10 accordingly. Normalise use of BOOST_HAS_RVALUE_REFS - fixes #4112. [SVN r61453] --- include/boost/config/compiler/visualc.hpp | 6 +++--- include/boost/config/suffix.hpp | 7 +++++++ test/boost_no_char16_t.ipp | 3 ++- test/boost_no_char32_t.ipp | 2 +- test/boost_no_initializer_lists.ipp | 7 +++++++ 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 46c9ef0b..2238f476 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -162,13 +162,12 @@ #define BOOST_NO_LAMBDAS #define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_STATIC_ASSERT -#define BOOST_NO_CHAR16_T -#define BOOST_NO_CHAR32_T -#define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_NULLPTR #endif // _MSC_VER < 1600 // C++0x features not supported by any versions +#define BOOST_NO_CHAR16_T +#define BOOST_NO_CHAR32_T #define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR #define BOOST_NO_DEFAULTED_FUNCTIONS @@ -177,6 +176,7 @@ #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXTERN_TEMPLATE #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_RAW_LITERALS #define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index a61a0cb5..13fd8007 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -314,6 +314,13 @@ # define BOOST_NO_INITIALIZER_LISTS #endif +// +// Set BOOST_HAS_RVALUE_REFS when BOOST_NO_RVALUE_REFERENCES is not defined +// +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_HAS_RVALUE_REFS) +#define BOOST_HAS_RVALUE_REFS +#endif + // BOOST_HAS_ABI_HEADERS // This macro gets set if we have headers that fix the ABI, // and prevent ODR violations when linking to external libraries: diff --git a/test/boost_no_char16_t.ipp b/test/boost_no_char16_t.ipp index b519b825..6b8956da 100644 --- a/test/boost_no_char16_t.ipp +++ b/test/boost_no_char16_t.ipp @@ -1,3 +1,4 @@ + // (C) Copyright Beman Dawes 2008 // Use, modification and distribution are subject to the @@ -14,7 +15,7 @@ namespace boost_no_char16_t { int test() { - char16_t c; + const char16_t* p = u"abc"; return 0; } diff --git a/test/boost_no_char32_t.ipp b/test/boost_no_char32_t.ipp index 4bd05407..cee99a64 100644 --- a/test/boost_no_char32_t.ipp +++ b/test/boost_no_char32_t.ipp @@ -14,7 +14,7 @@ namespace boost_no_char32_t { int test() { - char32_t c; + const char32_t* p = U"abc"; return 0; } diff --git a/test/boost_no_initializer_lists.ipp b/test/boost_no_initializer_lists.ipp index 31f03bd0..4bc96a28 100644 --- a/test/boost_no_initializer_lists.ipp +++ b/test/boost_no_initializer_lists.ipp @@ -11,11 +11,18 @@ // DESCRIPTION: If the compiler does not support C++0x initializer lists #include +#include namespace boost_no_initializer_lists { +void f(std::initializer_list) +{ +} + int test() { + std::vector v{"once", "upon", "a", "time"}; // See C++ std 8.5.4 + f( { 1, 2, 3, 4 } ); std::initializer_list x = { 1, 2 }; return 0; }