Add BOOST_NO_CXX17_STRUCTURED_BINDINGS detection

This commit is contained in:
Glen Fernandes
2017-05-29 09:57:18 -04:00
parent 833634021a
commit fe06370972
24 changed files with 213 additions and 4 deletions
+4 -1
View File
@@ -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 09:56:04 2017
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@@ -322,6 +322,9 @@ test-suite "BOOST_NO_CXX17_STD_APPLY" :
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 ] ;
@@ -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 <tuple>
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 */
+2
View File
@@ -1069,6 +1069,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_CXX14_VARIABLE_TEMPLATES);
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);
@@ -1156,6 +1157,7 @@ void print_boost_macros()
// END GENERATED BLOCK
+11 -1
View File
@@ -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 09:56:04 2017
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
@@ -342,6 +342,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
@@ -1461,6 +1466,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;
@@ -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 <boost/config.hpp>
#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();
}
@@ -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 <boost/config.hpp>
#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();
}