Add BOOST_NO_CXX17_DEDUCTION_GUIDES.

Replaces https://github.com/boostorg/config/pull/414.
This commit is contained in:
jzmaddock
2022-06-05 16:59:35 +01:00
parent 68702caadb
commit dad856418f
16 changed files with 148 additions and 10 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 Thu Feb 3 18:10:41 2022
# This file was automatically generated on Sun Jun 5 16:50:18 2022
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
@@ -343,6 +343,9 @@ test-suite "BOOST_NO_CXX14_VARIABLE_TEMPLATES" :
test-suite "BOOST_NO_CXX17" :
[ run ../no_cxx17_pass.cpp ]
[ compile-fail ../no_cxx17_fail.cpp ] ;
test-suite "BOOST_NO_CXX17_DEDUCTION_GUIDES" :
[ run ../no_cxx17_deduction_guides_pass.cpp ]
[ compile-fail ../no_cxx17_deduction_guides_fail.cpp ] ;
test-suite "BOOST_NO_CXX17_FOLD_EXPRESSIONS" :
[ run ../no_cxx17_fold_expressions_pass.cpp ]
[ compile-fail ../no_cxx17_fold_expressions_fail.cpp ] ;
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright 2022 Andrey Semashev
*
* 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_DEDUCTION_GUIDES
// TITLE: C++17 class template argument deduction guides
// DESCRIPTION: C++17 class template argument deduction guides are not supported.
namespace boost_no_cxx17_deduction_guides {
template< typename T >
struct foo
{
T m_val;
template< typename U >
foo(U const& x) : m_val(x) {}
};
template< typename T >
foo(T const&)->foo< T >;
int test()
{
foo x1(10);
return x1.m_val - 10;
}
} // boost_no_cxx17_deduction_guides
+2
View File
@@ -1167,6 +1167,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_CXX14_STD_EXCHANGE);
PRINT_MACRO(BOOST_NO_CXX14_VARIABLE_TEMPLATES);
PRINT_MACRO(BOOST_NO_CXX17);
PRINT_MACRO(BOOST_NO_CXX17_DEDUCTION_GUIDES);
PRINT_MACRO(BOOST_NO_CXX17_FOLD_EXPRESSIONS);
PRINT_MACRO(BOOST_NO_CXX17_HDR_ANY);
PRINT_MACRO(BOOST_NO_CXX17_HDR_CHARCONV);
@@ -1266,6 +1267,7 @@ void print_boost_macros()
// END GENERATED BLOCK
PRINT_MACRO(BOOST_CXX_VERSION);
+11 -1
View File
@@ -1,4 +1,4 @@
// This file was automatically generated on Thu Feb 3 18:10:41 2022
// This file was automatically generated on Sun Jun 5 16:50:18 2022
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-21.
// Use, modification and distribution are subject to the
@@ -372,6 +372,11 @@ namespace boost_no_cxx14_variable_templates = empty_boost;
#else
namespace boost_no_cxx17 = empty_boost;
#endif
#ifndef BOOST_NO_CXX17_DEDUCTION_GUIDES
#include "boost_no_cxx17_deduction_guides.ipp"
#else
namespace boost_no_cxx17_deduction_guides = empty_boost;
#endif
#ifndef BOOST_NO_CXX17_FOLD_EXPRESSIONS
#include "boost_no_cxx17_fold_expressions.ipp"
#else
@@ -1681,6 +1686,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_NO_CXX17 at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_cxx17_deduction_guides::test())
{
std::cerr << "Failed test for BOOST_NO_CXX17_DEDUCTION_GUIDES 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;
+37
View File
@@ -0,0 +1,37 @@
// This file was automatically generated on Sun Jun 5 16:50:17 2022
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-21.
// 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_DEDUCTION_GUIDES
// This file should not compile, if it does then
// BOOST_NO_CXX17_DEDUCTION_GUIDES should not be defined.
// See file boost_no_cxx17_deduction_guides.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_DEDUCTION_GUIDES
#include "boost_no_cxx17_deduction_guides.ipp"
#else
#error "this file should not compile"
#endif
int main( int, char *[] )
{
return boost_no_cxx17_deduction_guides::test();
}
+37
View File
@@ -0,0 +1,37 @@
// This file was automatically generated on Sun Jun 5 16:50:17 2022
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-21.
// 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_DEDUCTION_GUIDES
// This file should compile, if it does not then
// BOOST_NO_CXX17_DEDUCTION_GUIDES should be defined.
// See file boost_no_cxx17_deduction_guides.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_DEDUCTION_GUIDES
#include "boost_no_cxx17_deduction_guides.ipp"
#else
namespace boost_no_cxx17_deduction_guides = empty_boost;
#endif
int main( int, char *[] )
{
return boost_no_cxx17_deduction_guides::test();
}