diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index dcdcd7eb..a96bfcd1 100644 --- a/checks/Jamfile.v2 +++ b/checks/Jamfile.v2 @@ -1,6 +1,6 @@ # # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Mon Dec 12 19:37:08 2016 +# This file was automatically generated on Sat Feb 4 00:49:07 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -116,6 +116,7 @@ run-simple TEST_BOOST_NO_CXX11_INLINE_NAMESPACES : cxx11_inline_namespac run-simple TEST_BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS : cxx11_non_public_defaulted_functions ; run-simple TEST_BOOST_NO_CXX11_NUMERIC_LIMITS : cxx11_numeric_limits ; run-simple TEST_BOOST_NO_CXX11_REF_QUALIFIERS : cxx11_ref_qualifiers ; +run-simple TEST_BOOST_NO_CXX11_SFINAE_EXPR : cxx11_sfinae_expr ; run-simple TEST_BOOST_NO_CXX11_SMART_PTR : cxx11_smart_ptr ; run-simple TEST_BOOST_NO_CXX11_STD_ALIGN : cxx11_std_align ; run-simple TEST_BOOST_NO_CXX11_THREAD_LOCAL : cxx11_thread_local ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index dbfaa653..9dbb9638 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon Dec 12 19:37:08 2016 +// This file was automatically generated on Sat Feb 4 00:49:07 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -397,6 +397,10 @@ namespace test = boost_no_cxx11_numeric_limits; # include "../test/boost_no_cxx11_ref_qualifiers.ipp" namespace test = boost_no_cxx11_ref_qualifiers; #endif +#ifdef TEST_BOOST_NO_CXX11_SFINAE_EXPR +# include "../test/boost_no_cxx11_sfinae_expr.ipp" +namespace test = boost_no_cxx11_sfinae_expr; +#endif #ifdef TEST_BOOST_NO_CXX11_SMART_PTR # include "../test/boost_no_cxx11_smart_ptr.ipp" namespace test = boost_no_cxx11_smart_ptr; diff --git a/doc/macro_reference.qbk b/doc/macro_reference.qbk index b1d30e4a..4ff0999e 100644 --- a/doc/macro_reference.qbk +++ b/doc/macro_reference.qbk @@ -692,6 +692,9 @@ r-value references. [[`BOOST_NO_CXX11_SCOPED_ENUMS`][The compiler does not support scoped enumerations (`enum class`). ]] +[[`BOOST_NO_CXX11_SFINAE_EXPR`][The compiler does not support +usage of C++11 SFINAE with arbitrary expressions. +]] [[`BOOST_NO_CXX11_SMART_PTR`][The standard library header has no shared_ptr and unique_ptr.]] [[`BOOST_NO_CXX11_STATIC_ASSERT`][The compiler does not support `static_assert`. diff --git a/include/boost/config/compiler/borland.hpp b/include/boost/config/compiler/borland.hpp index ccd930ea..b749496e 100644 --- a/include/boost/config/compiler/borland.hpp +++ b/include/boost/config/compiler/borland.hpp @@ -185,6 +185,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS // UTF-8 still not supported #define BOOST_NO_CXX11_VARIADIC_TEMPLATES diff --git a/include/boost/config/compiler/codegear.hpp b/include/boost/config/compiler/codegear.hpp index e2f6061b..3c5262fe 100644 --- a/include/boost/config/compiler/codegear.hpp +++ b/include/boost/config/compiler/codegear.hpp @@ -112,6 +112,7 @@ #define BOOST_NO_CXX11_RAW_LITERALS #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS #define BOOST_NO_CXX11_VARIADIC_TEMPLATES diff --git a/include/boost/config/compiler/common_edg.hpp b/include/boost/config/compiler/common_edg.hpp index c09faeb0..eab93784 100644 --- a/include/boost/config/compiler/common_edg.hpp +++ b/include/boost/config/compiler/common_edg.hpp @@ -95,6 +95,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/cray.hpp b/include/boost/config/compiler/cray.hpp index 837f8152..eab52877 100644 --- a/include/boost/config/compiler/cray.hpp +++ b/include/boost/config/compiler/cray.hpp @@ -39,6 +39,7 @@ #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_RANGE_BASED_FOR diff --git a/include/boost/config/compiler/digitalmars.hpp b/include/boost/config/compiler/digitalmars.hpp index c344aae0..e371a68e 100644 --- a/include/boost/config/compiler/digitalmars.hpp +++ b/include/boost/config/compiler/digitalmars.hpp @@ -71,6 +71,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index e319d049..c82cbc7e 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -253,6 +253,7 @@ #if (BOOST_GCC_VERSION < 40800) || !defined(BOOST_GCC_CXX11) # define BOOST_NO_CXX11_ALIGNAS # define BOOST_NO_CXX11_THREAD_LOCAL +# define BOOST_NO_CXX11_SFINAE_EXPR #endif // C++0x features in 4.8.1 and later diff --git a/include/boost/config/compiler/gcc_xml.hpp b/include/boost/config/compiler/gcc_xml.hpp index b56c7862..63b08ac4 100644 --- a/include/boost/config/compiler/gcc_xml.hpp +++ b/include/boost/config/compiler/gcc_xml.hpp @@ -46,6 +46,7 @@ # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST # define BOOST_NO_CXX11_SCOPED_ENUMS # define BOOST_NO_SFINAE_EXPR +# define BOOST_NO_CXX11_SFINAE_EXPR # define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS # define BOOST_NO_CXX11_LAMBDAS # define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS diff --git a/include/boost/config/compiler/hp_acc.hpp b/include/boost/config/compiler/hp_acc.hpp index a773b8c4..9df18eaf 100644 --- a/include/boost/config/compiler/hp_acc.hpp +++ b/include/boost/config/compiler/hp_acc.hpp @@ -114,6 +114,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/intel.hpp b/include/boost/config/compiler/intel.hpp index bf3f7d49..f55189a0 100644 --- a/include/boost/config/compiler/intel.hpp +++ b/include/boost/config/compiler/intel.hpp @@ -415,6 +415,11 @@ template<> struct assert_intrinsic_wchar_t {}; # undef BOOST_NO_SFINAE_EXPR #endif +// BOOST_NO_CXX11_SFINAE_EXPR +#if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40800)) && !defined(_MSC_VER) +# undef BOOST_NO_CXX11_SFINAE_EXPR +#endif + // BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #if (BOOST_INTEL_CXX_VERSION >= 1500) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40500)) && (!defined(_MSC_VER) || (_MSC_FULL_VER >= 180020827)) // This is available in earlier Intel releases, but breaks Multiprecision: diff --git a/include/boost/config/compiler/metrowerks.hpp b/include/boost/config/compiler/metrowerks.hpp index 3c5e2286..8d42563c 100644 --- a/include/boost/config/compiler/metrowerks.hpp +++ b/include/boost/config/compiler/metrowerks.hpp @@ -113,6 +113,7 @@ #define BOOST_NO_CXX11_RAW_LITERALS #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/mpw.hpp b/include/boost/config/compiler/mpw.hpp index 084f9e15..1b8d39ea 100644 --- a/include/boost/config/compiler/mpw.hpp +++ b/include/boost/config/compiler/mpw.hpp @@ -62,6 +62,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES #define BOOST_NO_CXX11_UNICODE_LITERALS diff --git a/include/boost/config/compiler/pathscale.hpp b/include/boost/config/compiler/pathscale.hpp index a5e65af4..016ad5a4 100644 --- a/include/boost/config/compiler/pathscale.hpp +++ b/include/boost/config/compiler/pathscale.hpp @@ -37,6 +37,7 @@ # define BOOST_NO_CXX11_TEMPLATE_ALIASES # define BOOST_NO_CXX11_STATIC_ASSERT # define BOOST_NO_SFINAE_EXPR +# define BOOST_NO_CXX11_SFINAE_EXPR # define BOOST_NO_CXX11_SCOPED_ENUMS # define BOOST_NO_CXX11_RVALUE_REFERENCES # define BOOST_NO_CXX11_RANGE_BASED_FOR diff --git a/include/boost/config/compiler/pgi.hpp b/include/boost/config/compiler/pgi.hpp index fa2d5e40..af700514 100644 --- a/include/boost/config/compiler/pgi.hpp +++ b/include/boost/config/compiler/pgi.hpp @@ -88,6 +88,7 @@ #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_SWPRINTF #define BOOST_NO_CXX11_TEMPLATE_ALIASES diff --git a/include/boost/config/compiler/sunpro_cc.hpp b/include/boost/config/compiler/sunpro_cc.hpp index ac259fce..cdd30b14 100644 --- a/include/boost/config/compiler/sunpro_cc.hpp +++ b/include/boost/config/compiler/sunpro_cc.hpp @@ -141,6 +141,7 @@ // # define BOOST_HAS_LONG_LONG +#define BOOST_NO_CXX11_SFINAE_EXPR // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) diff --git a/include/boost/config/compiler/vacpp.hpp b/include/boost/config/compiler/vacpp.hpp index 3fbed9fa..b75a1bd1 100644 --- a/include/boost/config/compiler/vacpp.hpp +++ b/include/boost/config/compiler/vacpp.hpp @@ -114,6 +114,7 @@ # define BOOST_NO_CXX11_SCOPED_ENUMS #endif #define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX #if ! __IBMCPP_STATIC_ASSERT # define BOOST_NO_CXX11_STATIC_ASSERT diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 78c50e51..ef58626a 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -218,6 +218,8 @@ // #define BOOST_NO_TWO_PHASE_NAME_LOOKUP +#define BOOST_NO_CXX11_SFINAE_EXPR + // // Things that don't work in clr mode: // diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 57605714..8916f75c 100644 --- a/test/all/Jamfile.v2 +++ b/test/all/Jamfile.v2 @@ -1,7 +1,7 @@ # # Regression test Jamfile for boost configuration setup. # *** DO NOT EDIT THIS FILE BY HAND *** -# This file was automatically generated on Mon Dec 12 19:37:08 2016 +# This file was automatically generated on Sat Feb 4 00:49:07 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -313,6 +313,9 @@ test-suite "BOOST_NO_CXX11_NUMERIC_LIMITS" : test-suite "BOOST_NO_CXX11_REF_QUALIFIERS" : [ run ../no_cxx11_ref_qualifiers_pass.cpp ] [ compile-fail ../no_cxx11_ref_qualifiers_fail.cpp ] ; +test-suite "BOOST_NO_CXX11_SFINAE_EXPR" : +[ run ../no_cxx11_sfinae_expr_pass.cpp ] +[ compile-fail ../no_cxx11_sfinae_expr_fail.cpp ] ; test-suite "BOOST_NO_CXX11_SMART_PTR" : [ run ../no_cxx11_smart_ptr_pass.cpp ] [ compile-fail ../no_cxx11_smart_ptr_fail.cpp ] ; diff --git a/test/boost_no_cxx11_sfinae_expr.ipp b/test/boost_no_cxx11_sfinae_expr.ipp new file mode 100644 index 00000000..8adfdea3 --- /dev/null +++ b/test/boost_no_cxx11_sfinae_expr.ipp @@ -0,0 +1,48 @@ +/* +Copyright 2017 Glen Joseph Fernandes +(glenjofe@gmail.com) + +Distributed under Boost Software License, Version 1.0. +(See accompanying file LICENSE_1_0.txt or copy at +http://www.boost.org/LICENSE_1_0.txt) +*/ + +// MACRO: BOOST_NO_CXX11_SFINAE_EXPR +// TITLE: C++11 SFINAE for expressions +// DESCRIPTION: C++11 SFINAE for expressions not supported. + +namespace boost_no_cxx11_sfinae_expr { + +template +struct ignore { + typedef void type; +}; + +template +T& object(); + +template +struct trait { + static const int value = 0; +}; + +template +struct trait())>::type> { + static const int value = 1; +}; + +template +struct result { + static const int value = T::value; +}; + +class type { + void operator&() const { } +}; + +int test() +{ + return result >::value; +} + +} /* boost_no_cxx11_sfinae_expr */ diff --git a/test/config_info.cpp b/test/config_info.cpp index 53251d28..f8184dc0 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1053,6 +1053,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX11_REF_QUALIFIERS); PRINT_MACRO(BOOST_NO_CXX11_RVALUE_REFERENCES); PRINT_MACRO(BOOST_NO_CXX11_SCOPED_ENUMS); + PRINT_MACRO(BOOST_NO_CXX11_SFINAE_EXPR); PRINT_MACRO(BOOST_NO_CXX11_SMART_PTR); PRINT_MACRO(BOOST_NO_CXX11_STATIC_ASSERT); PRINT_MACRO(BOOST_NO_CXX11_STD_ALIGN); @@ -1149,6 +1150,7 @@ void print_boost_macros() + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index 77f4511c..3a1af676 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon Dec 12 19:37:08 2016 +// This file was automatically generated on Sat Feb 4 00:49:07 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -242,6 +242,11 @@ namespace boost_no_cxx11_numeric_limits = empty_boost; #else namespace boost_no_cxx11_ref_qualifiers = empty_boost; #endif +#ifndef BOOST_NO_CXX11_SFINAE_EXPR +#include "boost_no_cxx11_sfinae_expr.ipp" +#else +namespace boost_no_cxx11_sfinae_expr = empty_boost; +#endif #ifndef BOOST_NO_CXX11_SMART_PTR #include "boost_no_cxx11_smart_ptr.ipp" #else @@ -1501,6 +1506,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX11_REF_QUALIFIERS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx11_sfinae_expr::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX11_SFINAE_EXPR at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx11_smart_ptr::test()) { std::cerr << "Failed test for BOOST_NO_CXX11_SMART_PTR at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx11_sfinae_expr_fail.cpp b/test/no_cxx11_sfinae_expr_fail.cpp new file mode 100644 index 00000000..1613f16e --- /dev/null +++ b/test/no_cxx11_sfinae_expr_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Sat Feb 4 00:49:07 2017 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_SFINAE_EXPR +// This file should not compile, if it does then +// BOOST_NO_CXX11_SFINAE_EXPR should not be defined. +// See file boost_no_cxx11_sfinae_expr.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifdef BOOST_NO_CXX11_SFINAE_EXPR +#include "boost_no_cxx11_sfinae_expr.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_sfinae_expr::test(); +} + diff --git a/test/no_cxx11_sfinae_expr_pass.cpp b/test/no_cxx11_sfinae_expr_pass.cpp new file mode 100644 index 00000000..15d988b0 --- /dev/null +++ b/test/no_cxx11_sfinae_expr_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Sat Feb 4 00:49:07 2017 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-4. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + + +// Test file for macro BOOST_NO_CXX11_SFINAE_EXPR +// This file should compile, if it does not then +// BOOST_NO_CXX11_SFINAE_EXPR should be defined. +// See file boost_no_cxx11_sfinae_expr.ipp for details + +// Must not have BOOST_ASSERT_CONFIG set; it defeats +// the objective of this file: +#ifdef BOOST_ASSERT_CONFIG +# undef BOOST_ASSERT_CONFIG +#endif + +#include +#include "test.hpp" + +#ifndef BOOST_NO_CXX11_SFINAE_EXPR +#include "boost_no_cxx11_sfinae_expr.ipp" +#else +namespace boost_no_cxx11_sfinae_expr = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx11_sfinae_expr::test(); +} +