diff --git a/appveyor.yml b/appveyor.yml index 5023f41b..190d6fa9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,12 @@ platform: environment: matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=32 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + ARGS: --toolset=msvc-14.1 address-model=64 cxxflags=-std:c++latest - ARGS: --toolset=msvc-9.0 address-model=32 - ARGS: --toolset=msvc-10.0 address-model=32 - ARGS: --toolset=msvc-11.0 address-model=32 @@ -23,6 +29,7 @@ environment: - ARGS: --toolset=msvc-14.0 address-model=32 - ARGS: --toolset=msvc-12.0 address-model=64 - ARGS: --toolset=msvc-14.0 address-model=64 + - ARGS: --toolset=msvc-14.0 address-model=64 cxxflags=-std:c++latest - ARGS: --toolset=gcc address-model=64 PATH: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin;%PATH% - ARGS: --toolset=gcc address-model=64 cxxflags=-std=gnu++1z @@ -44,14 +51,11 @@ install: - git submodule update --init libs/type_traits - bootstrap - b2 headers - - dir - + build: off test_script: - - dir - cd libs\config\test - ..\..\..\b2 config_info_travis_install %ARGS% - - dir - config_info_travis - ..\..\..\b2 -j3 %ARGS% diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index 961501c3..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 Sun May 28 10:05:49 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,8 +109,11 @@ 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 ; +obj cxx17_structured_bindings : test_case.cpp : TEST_BOOST_NO_CXX17_STRUCTURED_BINDINGS ; obj cxx98_binders : test_case.cpp : TEST_BOOST_NO_CXX98_BINDERS ; obj cxx98_function_base : test_case.cpp : TEST_BOOST_NO_CXX98_FUNCTION_BASE ; obj cxx98_random_shuffle : test_case.cpp : TEST_BOOST_NO_CXX98_RANDOM_SHUFFLE ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index 76a12223..364af02e 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Sun May 28 10:05:49 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,16 @@ # 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." +# endif +#endif #ifdef TEST_BOOST_NO_CXX17_STD_APPLY # ifdef BOOST_NO_CXX17_STD_APPLY # error "Defect macro BOOST_NO_CXX17_STD_APPLY is defined." @@ -511,6 +521,11 @@ # error "Defect macro BOOST_NO_CXX17_STD_INVOKE is defined." # endif #endif +#ifdef TEST_BOOST_NO_CXX17_STRUCTURED_BINDINGS +# ifdef BOOST_NO_CXX17_STRUCTURED_BINDINGS +# error "Defect macro BOOST_NO_CXX17_STRUCTURED_BINDINGS is defined." +# endif +#endif #ifdef TEST_BOOST_NO_CXX98_BINDERS # ifdef BOOST_NO_CXX98_BINDERS # error "Defect macro BOOST_NO_CXX98_BINDERS is defined." diff --git a/include/boost/config/compiler/borland.hpp b/include/boost/config/compiler/borland.hpp index b749496e..fa891def 100644 --- a/include/boost/config/compiler/borland.hpp +++ b/include/boost/config/compiler/borland.hpp @@ -228,6 +228,17 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 175229c6..46ccbb68 100644 --- a/include/boost/config/compiler/clang.hpp +++ b/include/boost/config/compiler/clang.hpp @@ -27,6 +27,10 @@ #define __has_attribute(x) 0 #endif +#ifndef __has_cpp_attribute +#define __has_cpp_attribute(x) 0 +#endif + #if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS) # define BOOST_NO_EXCEPTIONS #endif @@ -282,6 +286,16 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif + +// 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 #define BOOST_NO_CXX11_SFINAE_EXPR #endif diff --git a/include/boost/config/compiler/codegear.hpp b/include/boost/config/compiler/codegear.hpp index 3c5262fe..44ca8428 100644 --- a/include/boost/config/compiler/codegear.hpp +++ b/include/boost/config/compiler/codegear.hpp @@ -154,6 +154,19 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif + +#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 + // // TR1 macros: // diff --git a/include/boost/config/compiler/common_edg.hpp b/include/boost/config/compiler/common_edg.hpp index eab93784..d49ceb68 100644 --- a/include/boost/config/compiler/common_edg.hpp +++ b/include/boost/config/compiler/common_edg.hpp @@ -138,6 +138,17 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 // However, some libraries have insufficient "long long" support diff --git a/include/boost/config/compiler/digitalmars.hpp b/include/boost/config/compiler/digitalmars.hpp index e371a68e..e4c5afdd 100644 --- a/include/boost/config/compiler/digitalmars.hpp +++ b/include/boost/config/compiler/digitalmars.hpp @@ -114,6 +114,17 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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" #endif diff --git a/include/boost/config/compiler/gcc.hpp b/include/boost/config/compiler/gcc.hpp index c82cbc7e..da05a63e 100644 --- a/include/boost/config/compiler/gcc.hpp +++ b/include/boost/config/compiler/gcc.hpp @@ -288,6 +288,21 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 __GNUC__ >= 7 +# define BOOST_FALLTHROUGH __attribute__((fallthrough)) +#endif + // // Unused attribute: #if __GNUC__ >= 4 diff --git a/include/boost/config/compiler/gcc_xml.hpp b/include/boost/config/compiler/gcc_xml.hpp index 63b08ac4..2b47585a 100644 --- a/include/boost/config/compiler/gcc_xml.hpp +++ b/include/boost/config/compiler/gcc_xml.hpp @@ -92,6 +92,17 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 8d42563c..99ff0f5e 100644 --- a/include/boost/config/compiler/metrowerks.hpp +++ b/include/boost/config/compiler/metrowerks.hpp @@ -157,6 +157,17 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 1b8d39ea..d9544345 100644 --- a/include/boost/config/compiler/mpw.hpp +++ b/include/boost/config/compiler/mpw.hpp @@ -106,6 +106,17 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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: // we don't support MPW prior to version 8.9: diff --git a/include/boost/config/compiler/pathscale.hpp b/include/boost/config/compiler/pathscale.hpp index 709f8cf8..94b3f91d 100644 --- a/include/boost/config/compiler/pathscale.hpp +++ b/include/boost/config/compiler/pathscale.hpp @@ -118,4 +118,15 @@ #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304) # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif + +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 af700514..4c402ba0 100644 --- a/include/boost/config/compiler/pgi.hpp +++ b/include/boost/config/compiler/pgi.hpp @@ -151,6 +151,17 @@ #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304) # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif + +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 cdd30b14..2453e7cf 100644 --- a/include/boost/config/compiler/sunpro_cc.hpp +++ b/include/boost/config/compiler/sunpro_cc.hpp @@ -172,6 +172,17 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 #if (__SUNPRO_CC >= 0x5140) && defined(__SunOS_5_12) && !defined(BOOST_HAS_THREADS) diff --git a/include/boost/config/compiler/vacpp.hpp b/include/boost/config/compiler/vacpp.hpp index b75a1bd1..683c167d 100644 --- a/include/boost/config/compiler/vacpp.hpp +++ b/include/boost/config/compiler/vacpp.hpp @@ -162,3 +162,14 @@ #if !defined(__cpp_variable_templates) || (__cpp_variable_templates < 201304) # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif + +// C++17 +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif +#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 f51f0e1d..c0557de7 100644 --- a/include/boost/config/compiler/visualc.hpp +++ b/include/boost/config/compiler/visualc.hpp @@ -194,7 +194,6 @@ // #if (_MSC_VER < 1910) # define BOOST_NO_CXX14_AGGREGATE_NSDMI -# define BOOST_NO_CXX14_CONSTEXPR #endif // MSVC including version 14 has not yet completely @@ -218,6 +217,12 @@ // #define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_CXX11_SFINAE_EXPR +// C++ 14: +# define BOOST_NO_CXX14_CONSTEXPR +// 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 2aaafc3b..b267f49b 100644 --- a/include/boost/config/compiler/xlcpp.hpp +++ b/include/boost/config/compiler/xlcpp.hpp @@ -23,6 +23,10 @@ #define __has_extension __has_feature #endif +#ifndef __has_cpp_attribute +#define __has_cpp_attribute(x) 0 +#endif + #if !__has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS) # define BOOST_NO_EXCEPTIONS #endif @@ -238,6 +242,16 @@ # define BOOST_NO_CXX14_VARIABLE_TEMPLATES #endif +#if !defined(__cpp_structured_bindings) || (__cpp_structured_bindings < 201606) +# define BOOST_NO_CXX17_STRUCTURED_BINDINGS +#endif + +// 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) # define BOOST_NO_CXX11_THREAD_LOCAL #endif diff --git a/include/boost/config/compiler/xlcpp_zos.hpp b/include/boost/config/compiler/xlcpp_zos.hpp index 7f6d2ad0..c554903a 100644 --- a/include/boost/config/compiler/xlcpp_zos.hpp +++ b/include/boost/config/compiler/xlcpp_zos.hpp @@ -150,6 +150,9 @@ #define BOOST_NO_CXX14_DECLTYPE_AUTO #define BOOST_NO_CXX14_CONSTEXPR #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/include/boost/config/workaround.hpp b/include/boost/config/workaround.hpp new file mode 100644 index 00000000..0ce8108c --- /dev/null +++ b/include/boost/config/workaround.hpp @@ -0,0 +1,277 @@ +// Copyright David Abrahams 2002. +// Distributed under 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) +#ifndef BOOST_CONFIG_WORKAROUND_HPP +#define BOOST_CONFIG_WORKAROUND_HPP + +// Compiler/library version workaround macro +// +// Usage: +// +// #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) +// // workaround for eVC4 and VC6 +// ... // workaround code here +// #endif +// +// When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the +// first argument must be undefined or expand to a numeric +// value. The above expands to: +// +// (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300 +// +// When used for workarounds that apply to the latest known version +// and all earlier versions of a compiler, the following convention +// should be observed: +// +// #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301)) +// +// The version number in this case corresponds to the last version in +// which the workaround was known to have been required. When +// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro +// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates +// the workaround for any version of the compiler. When +// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or +// error will be issued if the compiler version exceeds the argument +// to BOOST_TESTED_AT(). This can be used to locate workarounds which +// may be obsoleted by newer versions. + +#ifndef BOOST_STRICT_CONFIG + +#include + +#ifndef __BORLANDC__ +#define __BORLANDC___WORKAROUND_GUARD 1 +#else +#define __BORLANDC___WORKAROUND_GUARD 0 +#endif +#ifndef __CODEGEARC__ +#define __CODEGEARC___WORKAROUND_GUARD 1 +#else +#define __CODEGEARC___WORKAROUND_GUARD 0 +#endif +#ifndef _MSC_VER +#define _MSC_VER_WORKAROUND_GUARD 1 +#else +#define _MSC_VER_WORKAROUND_GUARD 0 +#endif +#ifndef _MSC_FULL_VER +#define _MSC_FULL_VER_WORKAROUND_GUARD 1 +#else +#define _MSC_FULL_VER_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_MSVC +#define BOOST_MSVC_WORKAROUND_GUARD 1 +#else +#define BOOST_MSVC_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_MSVC_FULL_VER +#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 1 +#else +#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC__ +#define __GNUC___WORKAROUND_GUARD 1 +#else +#define __GNUC___WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC_MINOR__ +#define __GNUC_MINOR___WORKAROUND_GUARD 1 +#else +#define __GNUC_MINOR___WORKAROUND_GUARD 0 +#endif +#ifndef __GNUC_PATCHLEVEL__ +#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 1 +#else +#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_GCC +#define BOOST_GCC_WORKAROUND_GUARD 1 +#else +#define BOOST_GCC_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_XLCPP_ZOS +#define BOOST_XLCPP_ZOS_WORKAROUND_GUARD 1 +#else +#define BOOST_XLCPP_ZOS_WORKAROUND_GUARD 0 +#endif +#ifndef __IBMCPP__ +#define __IBMCPP___WORKAROUND_GUARD 1 +#else +#define __IBMCPP___WORKAROUND_GUARD 0 +#endif +#ifndef __SUNPRO_CC +#define __SUNPRO_CC_WORKAROUND_GUARD 1 +#else +#define __SUNPRO_CC_WORKAROUND_GUARD 0 +#endif +#ifndef __DECCXX_VER +#define __DECCXX_VER_WORKAROUND_GUARD 1 +#else +#define __DECCXX_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __MWERKS__ +#define __MWERKS___WORKAROUND_GUARD 1 +#else +#define __MWERKS___WORKAROUND_GUARD 0 +#endif +#ifndef __EDG__ +#define __EDG___WORKAROUND_GUARD 1 +#else +#define __EDG___WORKAROUND_GUARD 0 +#endif +#ifndef __EDG_VERSION__ +#define __EDG_VERSION___WORKAROUND_GUARD 1 +#else +#define __EDG_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef __HP_aCC +#define __HP_aCC_WORKAROUND_GUARD 1 +#else +#define __HP_aCC_WORKAROUND_GUARD 0 +#endif +#ifndef __hpxstd98 +#define __hpxstd98_WORKAROUND_GUARD 1 +#else +#define __hpxstd98_WORKAROUND_GUARD 0 +#endif +#ifndef _CRAYC +#define _CRAYC_WORKAROUND_GUARD 1 +#else +#define _CRAYC_WORKAROUND_GUARD 0 +#endif +#ifndef __DMC__ +#define __DMC___WORKAROUND_GUARD 1 +#else +#define __DMC___WORKAROUND_GUARD 0 +#endif +#ifndef MPW_CPLUS +#define MPW_CPLUS_WORKAROUND_GUARD 1 +#else +#define MPW_CPLUS_WORKAROUND_GUARD 0 +#endif +#ifndef __COMO__ +#define __COMO___WORKAROUND_GUARD 1 +#else +#define __COMO___WORKAROUND_GUARD 0 +#endif +#ifndef __COMO_VERSION__ +#define __COMO_VERSION___WORKAROUND_GUARD 1 +#else +#define __COMO_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef __INTEL_COMPILER +#define __INTEL_COMPILER_WORKAROUND_GUARD 1 +#else +#define __INTEL_COMPILER_WORKAROUND_GUARD 0 +#endif +#ifndef __ICL +#define __ICL_WORKAROUND_GUARD 1 +#else +#define __ICL_WORKAROUND_GUARD 0 +#endif +#ifndef _COMPILER_VERSION +#define _COMPILER_VERSION_WORKAROUND_GUARD 1 +#else +#define _COMPILER_VERSION_WORKAROUND_GUARD 0 +#endif + +#ifndef _RWSTD_VER +#define _RWSTD_VER_WORKAROUND_GUARD 1 +#else +#define _RWSTD_VER_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_RWSTD_VER +#define BOOST_RWSTD_VER_WORKAROUND_GUARD 1 +#else +#define BOOST_RWSTD_VER_WORKAROUND_GUARD 0 +#endif +#ifndef __GLIBCPP__ +#define __GLIBCPP___WORKAROUND_GUARD 1 +#else +#define __GLIBCPP___WORKAROUND_GUARD 0 +#endif +#ifndef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC +#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 1 +#else +#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 0 +#endif +#ifndef __SGI_STL_PORT +#define __SGI_STL_PORT_WORKAROUND_GUARD 1 +#else +#define __SGI_STL_PORT_WORKAROUND_GUARD 0 +#endif +#ifndef _STLPORT_VERSION +#define _STLPORT_VERSION_WORKAROUND_GUARD 1 +#else +#define _STLPORT_VERSION_WORKAROUND_GUARD 0 +#endif +#ifndef __LIBCOMO_VERSION__ +#define __LIBCOMO_VERSION___WORKAROUND_GUARD 1 +#else +#define __LIBCOMO_VERSION___WORKAROUND_GUARD 0 +#endif +#ifndef _CPPLIB_VER +#define _CPPLIB_VER_WORKAROUND_GUARD 1 +#else +#define _CPPLIB_VER_WORKAROUND_GUARD 0 +#endif + +#ifndef BOOST_INTEL_CXX_VERSION +#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 1 +#else +#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_INTEL_WIN +#define BOOST_INTEL_WIN_WORKAROUND_GUARD 1 +#else +#define BOOST_INTEL_WIN_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_DINKUMWARE_STDLIB +#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 1 +#else +#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 0 +#endif +#ifndef BOOST_INTEL +#define BOOST_INTEL_WORKAROUND_GUARD 1 +#else +#define BOOST_INTEL_WORKAROUND_GUARD 0 +#endif +// Always define to zero, if it's used it'll be defined my MPL: +#define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 + +#define BOOST_WORKAROUND(symbol, test) \ + ((symbol ## _WORKAROUND_GUARD + 0 == 0) && \ + (symbol != 0) && (1 % (( (symbol test) ) + 1))) +// ^ ^ ^ ^ +// The extra level of parenthesis nesting above, along with the +// BOOST_OPEN_PAREN indirection below, is required to satisfy the +// broken preprocessor in MWCW 8.3 and earlier. +// +// The basic mechanism works as follows: +// (symbol test) + 1 => if (symbol test) then 2 else 1 +// 1 % ((symbol test) + 1) => if (symbol test) then 1 else 0 +// +// The complication with % is for cooperation with BOOST_TESTED_AT(). +// When "test" is BOOST_TESTED_AT(x) and +// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined, +// +// symbol test => if (symbol <= x) then 1 else -1 +// (symbol test) + 1 => if (symbol <= x) then 2 else 0 +// 1 % ((symbol test) + 1) => if (symbol <= x) then 1 else divide-by-zero +// + +#ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS +# define BOOST_OPEN_PAREN ( +# define BOOST_TESTED_AT(value) > value) ?(-1): BOOST_OPEN_PAREN 1 +#else +# define BOOST_TESTED_AT(value) != ((value)-(value)) +#endif + +#else + +#define BOOST_WORKAROUND(symbol, test) 0 + +#endif + +#endif // BOOST_CONFIG_WORKAROUND_HPP diff --git a/include/boost/detail/workaround.hpp b/include/boost/detail/workaround.hpp index 1aaa5aed..fb961158 100644 --- a/include/boost/detail/workaround.hpp +++ b/include/boost/detail/workaround.hpp @@ -3,275 +3,8 @@ // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef WORKAROUND_DWA2002126_HPP -# define WORKAROUND_DWA2002126_HPP +#define WORKAROUND_DWA2002126_HPP -// Compiler/library version workaround macro -// -// Usage: -// -// #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) -// // workaround for eVC4 and VC6 -// ... // workaround code here -// #endif -// -// When BOOST_STRICT_CONFIG is defined, expands to 0. Otherwise, the -// first argument must be undefined or expand to a numeric -// value. The above expands to: -// -// (BOOST_MSVC) != 0 && (BOOST_MSVC) < 1300 -// -// When used for workarounds that apply to the latest known version -// and all earlier versions of a compiler, the following convention -// should be observed: -// -// #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1301)) -// -// The version number in this case corresponds to the last version in -// which the workaround was known to have been required. When -// BOOST_DETECT_OUTDATED_WORKAROUNDS is not the defined, the macro -// BOOST_TESTED_AT(x) expands to "!= 0", which effectively activates -// the workaround for any version of the compiler. When -// BOOST_DETECT_OUTDATED_WORKAROUNDS is defined, a compiler warning or -// error will be issued if the compiler version exceeds the argument -// to BOOST_TESTED_AT(). This can be used to locate workarounds which -// may be obsoleted by newer versions. - -# ifndef BOOST_STRICT_CONFIG - -#include - -#ifndef __BORLANDC__ -#define __BORLANDC___WORKAROUND_GUARD 1 -#else -#define __BORLANDC___WORKAROUND_GUARD 0 -#endif -#ifndef __CODEGEARC__ -#define __CODEGEARC___WORKAROUND_GUARD 1 -#else -#define __CODEGEARC___WORKAROUND_GUARD 0 -#endif -#ifndef _MSC_VER -#define _MSC_VER_WORKAROUND_GUARD 1 -#else -#define _MSC_VER_WORKAROUND_GUARD 0 -#endif -#ifndef _MSC_FULL_VER -#define _MSC_FULL_VER_WORKAROUND_GUARD 1 -#else -#define _MSC_FULL_VER_WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_MSVC -#define BOOST_MSVC_WORKAROUND_GUARD 1 -#else -#define BOOST_MSVC_WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_MSVC_FULL_VER -#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 1 -#else -#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 0 -#endif -#ifndef __GNUC__ -#define __GNUC___WORKAROUND_GUARD 1 -#else -#define __GNUC___WORKAROUND_GUARD 0 -#endif -#ifndef __GNUC_MINOR__ -#define __GNUC_MINOR___WORKAROUND_GUARD 1 -#else -#define __GNUC_MINOR___WORKAROUND_GUARD 0 -#endif -#ifndef __GNUC_PATCHLEVEL__ -#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 1 -#else -#define __GNUC_PATCHLEVEL___WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_GCC -#define BOOST_GCC_WORKAROUND_GUARD 1 -#else -#define BOOST_GCC_WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_XLCPP_ZOS -#define BOOST_XLCPP_ZOS_WORKAROUND_GUARD 1 -#else -#define BOOST_XLCPP_ZOS_WORKAROUND_GUARD 0 -#endif -#ifndef __IBMCPP__ -#define __IBMCPP___WORKAROUND_GUARD 1 -#else -#define __IBMCPP___WORKAROUND_GUARD 0 -#endif -#ifndef __SUNPRO_CC -#define __SUNPRO_CC_WORKAROUND_GUARD 1 -#else -#define __SUNPRO_CC_WORKAROUND_GUARD 0 -#endif -#ifndef __DECCXX_VER -#define __DECCXX_VER_WORKAROUND_GUARD 1 -#else -#define __DECCXX_VER_WORKAROUND_GUARD 0 -#endif -#ifndef __MWERKS__ -#define __MWERKS___WORKAROUND_GUARD 1 -#else -#define __MWERKS___WORKAROUND_GUARD 0 -#endif -#ifndef __EDG__ -#define __EDG___WORKAROUND_GUARD 1 -#else -#define __EDG___WORKAROUND_GUARD 0 -#endif -#ifndef __EDG_VERSION__ -#define __EDG_VERSION___WORKAROUND_GUARD 1 -#else -#define __EDG_VERSION___WORKAROUND_GUARD 0 -#endif -#ifndef __HP_aCC -#define __HP_aCC_WORKAROUND_GUARD 1 -#else -#define __HP_aCC_WORKAROUND_GUARD 0 -#endif -#ifndef __hpxstd98 -#define __hpxstd98_WORKAROUND_GUARD 1 -#else -#define __hpxstd98_WORKAROUND_GUARD 0 -#endif -#ifndef _CRAYC -#define _CRAYC_WORKAROUND_GUARD 1 -#else -#define _CRAYC_WORKAROUND_GUARD 0 -#endif -#ifndef __DMC__ -#define __DMC___WORKAROUND_GUARD 1 -#else -#define __DMC___WORKAROUND_GUARD 0 -#endif -#ifndef MPW_CPLUS -#define MPW_CPLUS_WORKAROUND_GUARD 1 -#else -#define MPW_CPLUS_WORKAROUND_GUARD 0 -#endif -#ifndef __COMO__ -#define __COMO___WORKAROUND_GUARD 1 -#else -#define __COMO___WORKAROUND_GUARD 0 -#endif -#ifndef __COMO_VERSION__ -#define __COMO_VERSION___WORKAROUND_GUARD 1 -#else -#define __COMO_VERSION___WORKAROUND_GUARD 0 -#endif -#ifndef __INTEL_COMPILER -#define __INTEL_COMPILER_WORKAROUND_GUARD 1 -#else -#define __INTEL_COMPILER_WORKAROUND_GUARD 0 -#endif -#ifndef __ICL -#define __ICL_WORKAROUND_GUARD 1 -#else -#define __ICL_WORKAROUND_GUARD 0 -#endif -#ifndef _COMPILER_VERSION -#define _COMPILER_VERSION_WORKAROUND_GUARD 1 -#else -#define _COMPILER_VERSION_WORKAROUND_GUARD 0 -#endif - -#ifndef _RWSTD_VER -#define _RWSTD_VER_WORKAROUND_GUARD 1 -#else -#define _RWSTD_VER_WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_RWSTD_VER -#define BOOST_RWSTD_VER_WORKAROUND_GUARD 1 -#else -#define BOOST_RWSTD_VER_WORKAROUND_GUARD 0 -#endif -#ifndef __GLIBCPP__ -#define __GLIBCPP___WORKAROUND_GUARD 1 -#else -#define __GLIBCPP___WORKAROUND_GUARD 0 -#endif -#ifndef _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC -#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 1 -#else -#define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC_WORKAROUND_GUARD 0 -#endif -#ifndef __SGI_STL_PORT -#define __SGI_STL_PORT_WORKAROUND_GUARD 1 -#else -#define __SGI_STL_PORT_WORKAROUND_GUARD 0 -#endif -#ifndef _STLPORT_VERSION -#define _STLPORT_VERSION_WORKAROUND_GUARD 1 -#else -#define _STLPORT_VERSION_WORKAROUND_GUARD 0 -#endif -#ifndef __LIBCOMO_VERSION__ -#define __LIBCOMO_VERSION___WORKAROUND_GUARD 1 -#else -#define __LIBCOMO_VERSION___WORKAROUND_GUARD 0 -#endif -#ifndef _CPPLIB_VER -#define _CPPLIB_VER_WORKAROUND_GUARD 1 -#else -#define _CPPLIB_VER_WORKAROUND_GUARD 0 -#endif - -#ifndef BOOST_INTEL_CXX_VERSION -#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 1 -#else -#define BOOST_INTEL_CXX_VERSION_WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_INTEL_WIN -#define BOOST_INTEL_WIN_WORKAROUND_GUARD 1 -#else -#define BOOST_INTEL_WIN_WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_DINKUMWARE_STDLIB -#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 1 -#else -#define BOOST_DINKUMWARE_STDLIB_WORKAROUND_GUARD 0 -#endif -#ifndef BOOST_INTEL -#define BOOST_INTEL_WORKAROUND_GUARD 1 -#else -#define BOOST_INTEL_WORKAROUND_GUARD 0 -#endif -// Always define to zero, if it's used it'll be defined my MPL: -#define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 - -# define BOOST_WORKAROUND(symbol, test) \ - ((symbol ## _WORKAROUND_GUARD + 0 == 0) && \ - (symbol != 0) && (1 % (( (symbol test) ) + 1))) -// ^ ^ ^ ^ -// The extra level of parenthesis nesting above, along with the -// BOOST_OPEN_PAREN indirection below, is required to satisfy the -// broken preprocessor in MWCW 8.3 and earlier. -// -// The basic mechanism works as follows: -// (symbol test) + 1 => if (symbol test) then 2 else 1 -// 1 % ((symbol test) + 1) => if (symbol test) then 1 else 0 -// -// The complication with % is for cooperation with BOOST_TESTED_AT(). -// When "test" is BOOST_TESTED_AT(x) and -// BOOST_DETECT_OUTDATED_WORKAROUNDS is #defined, -// -// symbol test => if (symbol <= x) then 1 else -1 -// (symbol test) + 1 => if (symbol <= x) then 2 else 0 -// 1 % ((symbol test) + 1) => if (symbol <= x) then 1 else divide-by-zero -// - -# ifdef BOOST_DETECT_OUTDATED_WORKAROUNDS -# define BOOST_OPEN_PAREN ( -# define BOOST_TESTED_AT(value) > value) ?(-1): BOOST_OPEN_PAREN 1 -# else -# define BOOST_TESTED_AT(value) != ((value)-(value)) -# endif - -# else - -# define BOOST_WORKAROUND(symbol, test) 0 - -# endif +#include #endif // WORKAROUND_DWA2002126_HPP diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 22be62f8..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 Sun May 28 10:05:49 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,12 +316,21 @@ 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 ] ; test-suite "BOOST_NO_CXX17_STD_APPLY" : [ run ../no_cxx17_std_apply_pass.cpp ] [ compile-fail ../no_cxx17_std_apply_fail.cpp ] ; test-suite "BOOST_NO_CXX17_STD_INVOKE" : [ run ../no_cxx17_std_invoke_pass.cpp ] [ compile-fail ../no_cxx17_std_invoke_fail.cpp ] ; +test-suite "BOOST_NO_CXX17_STRUCTURED_BINDINGS" : +[ run ../no_cxx17_structured_bindings_pass.cpp ] +[ compile-fail ../no_cxx17_structured_bindings_fail.cpp ] ; test-suite "BOOST_NO_CXX98_BINDERS" : [ run ../no_cxx98_binders_pass.cpp ] [ compile-fail ../no_cxx98_binders_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/boost_no_cxx17_inline_variables.ipp b/test/boost_no_cxx17_inline_variables.ipp new file mode 100644 index 00000000..d144ed9a --- /dev/null +++ b/test/boost_no_cxx17_inline_variables.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_INLINE_VARIABLES +// TITLE: C++17 inline variables +// DESCRIPTION: C++17 inline variables are not supported. + +namespace boost_no_cxx17_inline_variables { + +inline const int Value = 1; + +struct Type { + static inline const int value = 1; +}; + +int test() +{ + return Type::value - Value; +} + +} /* boost_no_cxx17_inline_variables */ diff --git a/test/boost_no_cxx17_structured_bindings.ipp b/test/boost_no_cxx17_structured_bindings.ipp new file mode 100644 index 00000000..c5c72598 --- /dev/null +++ b/test/boost_no_cxx17_structured_bindings.ipp @@ -0,0 +1,36 @@ +/* +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_STRUCTURED_BINDINGS +// TITLE: C++17 structured bindings +// DESCRIPTION: C++17 structured bindings are not supported. + +#include + +namespace boost_no_cxx17_structured_bindings { + +struct P { + int x; + int y; +}; + +int test() +{ + auto [c, d] = std::make_tuple(1, 2); + if (c != 1 || d != 2) { + return 1; + } + auto [a, b] = P{1, 2}; + if (a != 1 || b != 2) { + return 1; + } + return 0; +} + +} /* boost_no_cxx17_structured_bindings */ diff --git a/test/config_info.cpp b/test/config_info.cpp index 2b6b862b..3fe9d9df 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1067,8 +1067,11 @@ 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); + PRINT_MACRO(BOOST_NO_CXX17_STRUCTURED_BINDINGS); PRINT_MACRO(BOOST_NO_CXX98_BINDERS); PRINT_MACRO(BOOST_NO_CXX98_FUNCTION_BASE); PRINT_MACRO(BOOST_NO_CXX98_RANDOM_SHUFFLE); @@ -1154,6 +1157,9 @@ void print_boost_macros() + + + diff --git a/test/config_test.cpp b/test/config_test.cpp index a263c911..93e838a6 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Sun May 28 10:05:49 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,16 @@ 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 +namespace boost_no_cxx17_inline_variables = empty_boost; +#endif #ifndef BOOST_NO_CXX17_STD_APPLY #include "boost_no_cxx17_std_apply.ipp" #else @@ -342,6 +352,11 @@ namespace boost_no_cxx17_std_apply = empty_boost; #else namespace boost_no_cxx17_std_invoke = empty_boost; #endif +#ifndef BOOST_NO_CXX17_STRUCTURED_BINDINGS +#include "boost_no_cxx17_structured_bindings.ipp" +#else +namespace boost_no_cxx17_structured_bindings = empty_boost; +#endif #ifndef BOOST_NO_CXX98_BINDERS #include "boost_no_cxx98_binders.ipp" #else @@ -1451,6 +1466,16 @@ 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; + ++error_count; + } if(0 != boost_no_cxx17_std_apply::test()) { std::cerr << "Failed test for BOOST_NO_CXX17_STD_APPLY at: " << __FILE__ << ":" << __LINE__ << std::endl; @@ -1461,6 +1486,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX17_STD_INVOKE at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_cxx17_structured_bindings::test()) + { + std::cerr << "Failed test for BOOST_NO_CXX17_STRUCTURED_BINDINGS at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_cxx98_binders::test()) { std::cerr << "Failed test for BOOST_NO_CXX98_BINDERS 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(); +} + diff --git a/test/no_cxx17_inline_variables_fail.cpp b/test/no_cxx17_inline_variables_fail.cpp new file mode 100644 index 00000000..58e688b3 --- /dev/null +++ b/test/no_cxx17_inline_variables_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon May 29 10:00:26 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_INLINE_VARIABLES +// This file should not compile, if it does then +// BOOST_NO_CXX17_INLINE_VARIABLES should not be defined. +// See file boost_no_cxx17_inline_variables.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_INLINE_VARIABLES +#include "boost_no_cxx17_inline_variables.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_inline_variables::test(); +} + diff --git a/test/no_cxx17_inline_variables_pass.cpp b/test/no_cxx17_inline_variables_pass.cpp new file mode 100644 index 00000000..ec5f69e2 --- /dev/null +++ b/test/no_cxx17_inline_variables_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon May 29 10:00:26 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_INLINE_VARIABLES +// This file should compile, if it does not then +// BOOST_NO_CXX17_INLINE_VARIABLES should be defined. +// See file boost_no_cxx17_inline_variables.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_INLINE_VARIABLES +#include "boost_no_cxx17_inline_variables.ipp" +#else +namespace boost_no_cxx17_inline_variables = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_inline_variables::test(); +} + diff --git a/test/no_cxx17_structured_bindings_fail.cpp b/test/no_cxx17_structured_bindings_fail.cpp new file mode 100644 index 00000000..9b7b1fb1 --- /dev/null +++ b/test/no_cxx17_structured_bindings_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon May 29 09:56:04 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_STRUCTURED_BINDINGS +// This file should not compile, if it does then +// BOOST_NO_CXX17_STRUCTURED_BINDINGS should not be defined. +// See file boost_no_cxx17_structured_bindings.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_STRUCTURED_BINDINGS +#include "boost_no_cxx17_structured_bindings.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_structured_bindings::test(); +} + diff --git a/test/no_cxx17_structured_bindings_pass.cpp b/test/no_cxx17_structured_bindings_pass.cpp new file mode 100644 index 00000000..312e0c0c --- /dev/null +++ b/test/no_cxx17_structured_bindings_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Mon May 29 09:56:04 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_STRUCTURED_BINDINGS +// This file should compile, if it does not then +// BOOST_NO_CXX17_STRUCTURED_BINDINGS should be defined. +// See file boost_no_cxx17_structured_bindings.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_STRUCTURED_BINDINGS +#include "boost_no_cxx17_structured_bindings.ipp" +#else +namespace boost_no_cxx17_structured_bindings = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_cxx17_structured_bindings::test(); +} +