forked from boostorg/config
Add BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS macro.
The macro indicates whether the compiler does not support C++17 auto non-type template parameters.
This commit is contained in:
1 parent
b8e57320d6
commit
f68e9c6e8d
33 files changed
+195
-14
No files matched your search
+4
-1
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# Regression test Jamfile for boost configuration setup.
|
||||
# *** DO NOT EDIT THIS FILE BY HAND ***
|
||||
# This file was automatically generated on Fri Oct 13 19:09:38 2023
|
||||
# This file was automatically generated on Mon Jan 22 16:16:53 2024
|
||||
# by libs/config/tools/generate.cpp
|
||||
# Copyright John Maddock.
|
||||
# Use, modification and distribution are subject to the
|
||||
@@ -346,6 +346,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_AUTO_NONTYPE_TEMPLATE_PARAMS" :
|
||||
[ run ../no_cxx17_auto_nontype_template_params_pass.cpp ]
|
||||
[ compile-fail ../no_cxx17_auto_nontype_template_params_fail.cpp ] ;
|
||||
test-suite "BOOST_NO_CXX17_DEDUCTION_GUIDES" :
|
||||
[ run ../no_cxx17_deduction_guides_pass.cpp ]
|
||||
[ compile-fail ../no_cxx17_deduction_guides_fail.cpp ] ;
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright 2024 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_AUTO_NONTYPE_TEMPLATE_PARAMS
|
||||
// TITLE: C++17 auto non-type template parameters
|
||||
// DESCRIPTION: C++17 auto non-type template parameters are not supported.
|
||||
|
||||
namespace boost_no_cxx17_auto_nontype_template_params {
|
||||
|
||||
template< auto Value >
|
||||
struct foo
|
||||
{
|
||||
static auto get()
|
||||
{
|
||||
return Value;
|
||||
}
|
||||
};
|
||||
|
||||
const int ten = 10;
|
||||
|
||||
int test()
|
||||
{
|
||||
return foo< 10 >::get() - *foo< &ten >::get();
|
||||
}
|
||||
|
||||
} // boost_no_cxx17_auto_nontype_template_params
|
||||
@@ -1168,6 +1168,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_AUTO_NONTYPE_TEMPLATE_PARAMS);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_DEDUCTION_GUIDES);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_FOLD_EXPRESSIONS);
|
||||
PRINT_MACRO(BOOST_NO_CXX17_HDR_ANY);
|
||||
@@ -1287,6 +1288,7 @@ void print_boost_macros()
|
||||
|
||||
|
||||
|
||||
|
||||
// END GENERATED BLOCK
|
||||
|
||||
PRINT_MACRO(BOOST_CXX_VERSION);
|
||||
|
||||
+11
-1
@@ -1,4 +1,4 @@
|
||||
// This file was automatically generated on Fri Oct 13 19:09:38 2023
|
||||
// This file was automatically generated on Mon Jan 22 16:16:53 2024
|
||||
// by libs/config/tools/generate.cpp
|
||||
// Copyright John Maddock 2002-21.
|
||||
// Use, modification and distribution are subject to the
|
||||
@@ -377,6 +377,11 @@ namespace boost_no_cxx14_variable_templates = empty_boost;
|
||||
#else
|
||||
namespace boost_no_cxx17 = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS
|
||||
#include "boost_no_cxx17_auto_nontype_template_params.ipp"
|
||||
#else
|
||||
namespace boost_no_cxx17_auto_nontype_template_params = empty_boost;
|
||||
#endif
|
||||
#ifndef BOOST_NO_CXX17_DEDUCTION_GUIDES
|
||||
#include "boost_no_cxx17_deduction_guides.ipp"
|
||||
#else
|
||||
@@ -1741,6 +1746,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_auto_nontype_template_params::test())
|
||||
{
|
||||
std::cerr << "Failed test for BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS 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;
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Mon Jan 22 16:16:53 2024
|
||||
// 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_AUTO_NONTYPE_TEMPLATE_PARAMS
|
||||
// This file should not compile, if it does then
|
||||
// BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS should not be defined.
|
||||
// See file boost_no_cxx17_auto_nontype_template_params.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_AUTO_NONTYPE_TEMPLATE_PARAMS
|
||||
#include "boost_no_cxx17_auto_nontype_template_params.ipp"
|
||||
#else
|
||||
#error "this file should not compile"
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_cxx17_auto_nontype_template_params::test();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This file was automatically generated on Mon Jan 22 16:16:53 2024
|
||||
// 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_AUTO_NONTYPE_TEMPLATE_PARAMS
|
||||
// This file should compile, if it does not then
|
||||
// BOOST_NO_CXX17_AUTO_NONTYPE_TEMPLATE_PARAMS should be defined.
|
||||
// See file boost_no_cxx17_auto_nontype_template_params.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_AUTO_NONTYPE_TEMPLATE_PARAMS
|
||||
#include "boost_no_cxx17_auto_nontype_template_params.ipp"
|
||||
#else
|
||||
namespace boost_no_cxx17_auto_nontype_template_params = empty_boost;
|
||||
#endif
|
||||
|
||||
int main( int, char *[] )
|
||||
{
|
||||
return boost_no_cxx17_auto_nontype_template_params::test();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user