diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index fe46f896..2aec5db7 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 May 29 10:00:26 2017 +# This file was automatically generated on Mon May 29 10:27:35 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -109,6 +109,7 @@ obj cxx14_aggregate_nsdmi : test_case.cpp : TEST_BOOST_NO_CXX14_AGGREGAT obj cxx14_return_type_deduction : test_case.cpp : TEST_BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION ; obj cxx14_std_exchange : test_case.cpp : TEST_BOOST_NO_CXX14_STD_EXCHANGE ; obj cxx14_variable_templates : test_case.cpp : TEST_BOOST_NO_CXX14_VARIABLE_TEMPLATES ; +obj cxx17_fold_expressions : test_case.cpp : TEST_BOOST_NO_CXX17_FOLD_EXPRESSIONS ; obj cxx17_inline_variables : test_case.cpp : TEST_BOOST_NO_CXX17_INLINE_VARIABLES ; obj cxx17_std_apply : test_case.cpp : TEST_BOOST_NO_CXX17_STD_APPLY ; obj cxx17_std_invoke : test_case.cpp : TEST_BOOST_NO_CXX17_STD_INVOKE ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index 3de59c60..364af02e 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon May 29 10:00:26 2017 +// This file was automatically generated on Mon May 29 10:27:35 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -501,6 +501,11 @@ # error "Defect macro BOOST_NO_CXX14_VARIABLE_TEMPLATES is defined." # endif #endif +#ifdef TEST_BOOST_NO_CXX17_FOLD_EXPRESSIONS +# ifdef BOOST_NO_CXX17_FOLD_EXPRESSIONS +# error "Defect macro BOOST_NO_CXX17_FOLD_EXPRESSIONS is defined." +# endif +#endif #ifdef TEST_BOOST_NO_CXX17_INLINE_VARIABLES # ifdef BOOST_NO_CXX17_INLINE_VARIABLES # error "Defect macro BOOST_NO_CXX17_INLINE_VARIABLES is defined." diff --git a/include/boost/config/compiler/borland.hpp b/include/boost/config/compiler/borland.hpp index 45b5afd1..fa891def 100644 --- a/include/boost/config/compiler/borland.hpp +++ b/include/boost/config/compiler/borland.hpp @@ -235,6 +235,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif #if __BORLANDC__ >= 0x590 # define BOOST_HAS_TR1_HASH diff --git a/include/boost/config/compiler/clang.hpp b/include/boost/config/compiler/clang.hpp index dc020173..46ccbb68 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -293,6 +293,7 @@ // Clang 3.9+ in c++1z #if !__has_cpp_attribute(fallthrough) || __cplusplus < 201406L # define BOOST_NO_CXX17_INLINE_VARIABLES +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif #if __cplusplus < 201103L diff --git a/include/boost/config/compiler/codegear.hpp b/include/boost/config/compiler/codegear.hpp index 9aead59e..44ca8428 100644 --- a/include/boost/config/compiler/codegear.hpp +++ b/include/boost/config/compiler/codegear.hpp @@ -163,6 +163,10 @@ # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif + // // TR1 macros: // diff --git a/include/boost/config/compiler/common_edg.hpp b/include/boost/config/compiler/common_edg.hpp index a34f3f37..d49ceb68 100644 --- a/include/boost/config/compiler/common_edg.hpp +++ b/include/boost/config/compiler/common_edg.hpp @@ -145,6 +145,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif #ifdef c_plusplus // EDG has "long long" in non-strict mode diff --git a/include/boost/config/compiler/digitalmars.hpp b/include/boost/config/compiler/digitalmars.hpp index 2e48c55b..e4c5afdd 100644 --- a/include/boost/config/compiler/digitalmars.hpp +++ b/include/boost/config/compiler/digitalmars.hpp @@ -121,6 +121,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif #if (__DMC__ <= 0x840) #error "Compiler not supported or configured - please reconfigure" diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index e66c23b8..a759c4b4 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -295,6 +295,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif // // Unused attribute: diff --git a/include/boost/config/compiler/gcc_xml.hpp b/include/boost/config/compiler/gcc_xml.hpp index 9bcda105..2b47585a 100644 --- a/include/boost/config/compiler/gcc_xml.hpp +++ b/include/boost/config/compiler/gcc_xml.hpp @@ -99,6 +99,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif #define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__ diff --git a/include/boost/config/compiler/metrowerks.hpp b/include/boost/config/compiler/metrowerks.hpp index 852fa3ae..99ff0f5e 100644 --- a/include/boost/config/compiler/metrowerks.hpp +++ b/include/boost/config/compiler/metrowerks.hpp @@ -164,6 +164,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) diff --git a/include/boost/config/compiler/mpw.hpp b/include/boost/config/compiler/mpw.hpp index 7160e52e..d9544345 100644 --- a/include/boost/config/compiler/mpw.hpp +++ b/include/boost/config/compiler/mpw.hpp @@ -113,6 +113,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif // // versions check: diff --git a/include/boost/config/compiler/pathscale.hpp b/include/boost/config/compiler/pathscale.hpp index 47d7b9e6..94b3f91d 100644 --- a/include/boost/config/compiler/pathscale.hpp +++ b/include/boost/config/compiler/pathscale.hpp @@ -126,4 +126,7 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif #endif diff --git a/include/boost/config/compiler/pgi.hpp b/include/boost/config/compiler/pgi.hpp index 8999ad03..4c402ba0 100644 --- a/include/boost/config/compiler/pgi.hpp +++ b/include/boost/config/compiler/pgi.hpp @@ -159,6 +159,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif // // version check: // probably nothing to do here? diff --git a/include/boost/config/compiler/sunpro_cc.hpp b/include/boost/config/compiler/sunpro_cc.hpp index 628d237f..2453e7cf 100644 --- a/include/boost/config/compiler/sunpro_cc.hpp +++ b/include/boost/config/compiler/sunpro_cc.hpp @@ -179,6 +179,9 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif // Turn on threading support for Solaris 12. // Ticket #11972 diff --git a/include/boost/config/compiler/vacpp.hpp b/include/boost/config/compiler/vacpp.hpp index 9838008a..683c167d 100644 --- a/include/boost/config/compiler/vacpp.hpp +++ b/include/boost/config/compiler/vacpp.hpp @@ -170,3 +170,6 @@ #if !defined(__cpp_inline_variables) || (__cpp_inline_variables < 201606) # define BOOST_NO_CXX17_INLINE_VARIABLES #endif +#if !defined(__cpp_fold_expressions) || (__cpp_fold_expressions < 201603) +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS +#endif diff --git a/include/boost/config/compiler/visualc.hpp b/include/boost/config/compiler/visualc.hpp index 726fcf8e..516dc4fe 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -221,6 +221,7 @@ // C++ 17: #define BOOST_NO_CXX17_STRUCTURED_BINDINGS #define BOOST_NO_CXX17_INLINE_VARIABLES +#define BOOST_NO_CXX17_FOLD_EXPRESSIONS // // Things that don't work in clr mode: diff --git a/include/boost/config/compiler/xlcpp.hpp b/include/boost/config/compiler/xlcpp.hpp index f8161110..b267f49b 100644 --- a/include/boost/config/compiler/xlcpp.hpp +++ b/include/boost/config/compiler/xlcpp.hpp @@ -249,6 +249,7 @@ // Clang 3.9+ in c++1z #if !__has_cpp_attribute(fallthrough) || __cplusplus < 201406L # define BOOST_NO_CXX17_INLINE_VARIABLES +# define BOOST_NO_CXX17_FOLD_EXPRESSIONS #endif #if !__has_feature(cxx_thread_local) diff --git a/include/boost/config/compiler/xlcpp_zos.hpp b/include/boost/config/compiler/xlcpp_zos.hpp index 846c837a..c554903a 100644 --- a/include/boost/config/compiler/xlcpp_zos.hpp +++ b/include/boost/config/compiler/xlcpp_zos.hpp @@ -152,6 +152,7 @@ #define BOOST_NO_CXX14_BINARY_LITERALS #define BOOST_NO_CXX17_STRUCTURED_BINDINGS #define BOOST_NO_CXX17_INLINE_VARIABLES +#define BOOST_NO_CXX17_FOLD_EXPRESSIONS // ------------------------------------- diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index b8270835..78f4db2a 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 May 29 10:00:26 2017 +# This file was automatically generated on Mon May 29 10:27:35 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -316,6 +316,9 @@ test-suite "BOOST_NO_CXX14_STD_EXCHANGE" : test-suite "BOOST_NO_CXX14_VARIABLE_TEMPLATES" : [ run ../no_cxx14_var_templ_pass.cpp ] [ compile-fail ../no_cxx14_var_templ_fail.cpp ] ; +test-suite "BOOST_NO_CXX17_FOLD_EXPRESSIONS" : +[ run ../no_cxx17_fold_expressions_pass.cpp ] +[ compile-fail ../no_cxx17_fold_expressions_fail.cpp ] ; test-suite "BOOST_NO_CXX17_INLINE_VARIABLES" : [ run ../no_cxx17_inline_variables_pass.cpp ] [ compile-fail ../no_cxx17_inline_variables_fail.cpp ] ; diff --git a/test/boost_no_cxx17_fold_expressions.ipp b/test/boost_no_cxx17_fold_expressions.ipp new file mode 100644 index 00000000..7566a066 --- /dev/null +++ b/test/boost_no_cxx17_fold_expressions.ipp @@ -0,0 +1,27 @@ +/* +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_CXX17_FOLD_EXPRESSIONS +// TITLE: C++17 fold expressions +// DESCRIPTION: C++17 fold expressions are not supported. + +namespace boost_no_cxx17_fold_expressions { + +template +auto sum(Args&&... args) +{ + return (args + ... + 0); +} + +int test() +{ + return sum(1, -1, 1, 1, -1, -1); +} + +} /* boost_no_cxx17_fold_expressions */ diff --git a/test/config_info.cpp b/test/config_info.cpp index 9beeb65f..3fe9d9df 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1067,6 +1067,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION); PRINT_MACRO(BOOST_NO_CXX14_STD_EXCHANGE); PRINT_MACRO(BOOST_NO_CXX14_VARIABLE_TEMPLATES); + PRINT_MACRO(BOOST_NO_CXX17_FOLD_EXPRESSIONS); PRINT_MACRO(BOOST_NO_CXX17_INLINE_VARIABLES); PRINT_MACRO(BOOST_NO_CXX17_STD_APPLY); PRINT_MACRO(BOOST_NO_CXX17_STD_INVOKE); @@ -1160,6 +1161,7 @@ void print_boost_macros() + // END GENERATED BLOCK diff --git a/test/config_test.cpp b/test/config_test.cpp index 4bc52a0e..93e838a6 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon May 29 10:00:26 2017 +// This file was automatically generated on Mon May 29 10:27:35 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -332,6 +332,11 @@ namespace boost_no_cxx14_std_exchange = empty_boost; #else namespace boost_no_cxx14_variable_templates = empty_boost; #endif +#ifndef BOOST_NO_CXX17_FOLD_EXPRESSIONS +#include "boost_no_cxx17_fold_expressions.ipp" +#else +namespace boost_no_cxx17_fold_expressions = empty_boost; +#endif #ifndef BOOST_NO_CXX17_INLINE_VARIABLES #include "boost_no_cxx17_inline_variables.ipp" #else @@ -1461,6 +1466,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX14_VARIABLE_TEMPLATES at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx17_fold_expressions::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX17_FOLD_EXPRESSIONS at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx17_inline_variables::test()) { std::cerr << "Failed test for BOOST_NO_CXX17_INLINE_VARIABLES at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_cxx17_fold_expressions_fail.cpp b/test/no_cxx17_fold_expressions_fail.cpp new file mode 100644 index 00000000..db22b152 --- /dev/null +++ b/test/no_cxx17_fold_expressions_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon May 29 10:27:35 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_CXX17_FOLD_EXPRESSIONS +// This file should not compile, if it does then +// BOOST_NO_CXX17_FOLD_EXPRESSIONS should not be defined. +// See file boost_no_cxx17_fold_expressions.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_CXX17_FOLD_EXPRESSIONS +#include "boost_no_cxx17_fold_expressions.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_fold_expressions::test(); +} + diff --git a/test/no_cxx17_fold_expressions_pass.cpp b/test/no_cxx17_fold_expressions_pass.cpp new file mode 100644 index 00000000..bc2feeab --- /dev/null +++ b/test/no_cxx17_fold_expressions_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon May 29 10:27:35 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_CXX17_FOLD_EXPRESSIONS +// This file should compile, if it does not then +// BOOST_NO_CXX17_FOLD_EXPRESSIONS should be defined. +// See file boost_no_cxx17_fold_expressions.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_CXX17_FOLD_EXPRESSIONS +#include "boost_no_cxx17_fold_expressions.ipp" +#else +namespace boost_no_cxx17_fold_expressions = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_fold_expressions::test(); +} +