diff --git a/checks/Jamfile.v2 b/checks/Jamfile.v2 index dcdcd7eb..20e4f824 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 Dec 12 19:37:08 2016 +# This file was automatically generated on Sun Feb 5 18:12:09 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -179,6 +179,7 @@ run-simple TEST_BOOST_NO_PRIVATE_IN_AGGREGATE : private_in_aggregate ; run-simple TEST_BOOST_NO_POINTER_TO_MEMBER_CONST : pointer_to_member_const ; run-simple TEST_BOOST_NO_CXX11_RANGE_BASED_FOR : cxx11_range_based_for ; run-simple TEST_BOOST_NO_CXX11_RAW_LITERALS : cxx11_raw_literals ; +run-simple TEST_BOOST_NO_RESTRICT_REFERENCES : restrict_references ; run-simple TEST_BOOST_NO_UNREACHABLE_RETURN_DETECTION : unreachable_return_detection ; run-simple TEST_BOOST_NO_RTTI : rtti ; run-simple TEST_BOOST_NO_CXX11_RVALUE_REFERENCES : cxx11_rvalue_references ; diff --git a/checks/test_case.cpp b/checks/test_case.cpp index dbfaa653..9e12d855 100644 --- a/checks/test_case.cpp +++ b/checks/test_case.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon Dec 12 19:37:08 2016 +// This file was automatically generated on Sun Feb 5 18:12:09 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -649,6 +649,10 @@ namespace test = boost_no_cxx11_range_based_for; # include "../test/boost_no_raw_literals.ipp" namespace test = boost_no_cxx11_raw_literals; #endif +#ifdef TEST_BOOST_NO_RESTRICT_REFERENCES +# include "../test/boost_no_restrict_references.ipp" +namespace test = boost_no_restrict_references; +#endif #ifdef TEST_BOOST_NO_UNREACHABLE_RETURN_DETECTION # include "../test/boost_no_ret_det.ipp" namespace test = boost_no_unreachable_return_detection; diff --git a/include/boost/config/suffix.hpp b/include/boost/config/suffix.hpp index 13068e3d..6df9223f 100644 --- a/include/boost/config/suffix.hpp +++ b/include/boost/config/suffix.hpp @@ -588,7 +588,7 @@ namespace std{ using ::type_info; } #if !defined(BOOST_RESTRICT) # if defined(_MSC_VER) # define BOOST_RESTRICT __restrict -# if !defined(BOOST_NO_RESTRICT_REFERENCES) +# if !defined(BOOST_NO_RESTRICT_REFERENCES) && (_MSC_FULL_VER < 190023026) # define BOOST_NO_RESTRICT_REFERENCES # endif # elif defined(__GNUC__) && __GNUC__ > 3 diff --git a/test/all/Jamfile.v2 b/test/all/Jamfile.v2 index 57605714..f08e63b8 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 Dec 12 19:37:08 2016 +# This file was automatically generated on Sun Feb 5 18:12:09 2017 # by libs/config/tools/generate.cpp # Copyright John Maddock. # Use, modification and distribution are subject to the @@ -502,6 +502,9 @@ test-suite "BOOST_NO_CXX11_RANGE_BASED_FOR" : test-suite "BOOST_NO_CXX11_RAW_LITERALS" : [ run ../no_raw_literals_pass.cpp ] [ compile-fail ../no_raw_literals_fail.cpp ] ; +test-suite "BOOST_NO_RESTRICT_REFERENCES" : +[ run ../no_restrict_references_pass.cpp ] +[ compile-fail ../no_restrict_references_fail.cpp ] ; test-suite "BOOST_NO_UNREACHABLE_RETURN_DETECTION" : [ run ../no_ret_det_pass.cpp ] [ compile-fail ../no_ret_det_fail.cpp ] ; diff --git a/test/boost_no_restrict_references.ipp b/test/boost_no_restrict_references.ipp new file mode 100644 index 00000000..548984d2 --- /dev/null +++ b/test/boost_no_restrict_references.ipp @@ -0,0 +1,47 @@ +// (C) Copyright Beman Dawes 2009 + +// 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 more information. + +// MACRO: BOOST_NO_RESTRICT_REFERENCES +// TITLE: We cannot apply BOOST_RESTRICT to a reference type. +// DESCRIPTION: We cannot apply BOOST_RESTRICT to a reference type + +#include + +namespace boost_no_restrict_references { + +#ifdef _MSC_VER +#pragma warning(error:4227) +#endif + + +void sum2(int (& BOOST_RESTRICT a)[4], int (& BOOST_RESTRICT b)[4], int (&c)[4], int (&d)[4]) { + int i; + for (i = 0; i < 4; i++) { + a[i] = b[i] + c[i]; + c[i] = b[i] + d[i]; + } +} + +int test() +{ + int a[4] = { 1, 2, 3, 4 }; + int b[4] = { 3, 4, 5, 6 }; + int c[4] = { 0, 1, 3, 5 }; + int d[4] = { 2, 4, 6, 8 }; + + sum2(a, b, c, d); + + return 0; +} + +#ifdef _MSC_VER +#pragma warning(default:4227) +#endif + + +} diff --git a/test/config_info.cpp b/test/config_info.cpp index 53251d28..3daccd31 100644 --- a/test/config_info.cpp +++ b/test/config_info.cpp @@ -1106,6 +1106,7 @@ void print_boost_macros() PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_CONST); PRINT_MACRO(BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS); PRINT_MACRO(BOOST_NO_PRIVATE_IN_AGGREGATE); + PRINT_MACRO(BOOST_NO_RESTRICT_REFERENCES); PRINT_MACRO(BOOST_NO_RTTI); PRINT_MACRO(BOOST_NO_SFINAE); PRINT_MACRO(BOOST_NO_SFINAE_EXPR); @@ -1149,6 +1150,7 @@ void print_boost_macros() + // END GENERATED BLOCK PRINT_MACRO(BOOST_INTEL); diff --git a/test/config_test.cpp b/test/config_test.cpp index 77f4511c..0138bfd1 100644 --- a/test/config_test.cpp +++ b/test/config_test.cpp @@ -1,4 +1,4 @@ -// This file was automatically generated on Mon Dec 12 19:37:08 2016 +// This file was automatically generated on Sun Feb 5 18:12:09 2017 // by libs/config/tools/generate.cpp // Copyright John Maddock 2002-4. // Use, modification and distribution are subject to the @@ -557,6 +557,11 @@ namespace boost_no_cxx11_range_based_for = empty_boost; #else namespace boost_no_cxx11_raw_literals = empty_boost; #endif +#ifndef BOOST_NO_RESTRICT_REFERENCES +#include "boost_no_restrict_references.ipp" +#else +namespace boost_no_restrict_references = empty_boost; +#endif #ifndef BOOST_NO_UNREACHABLE_RETURN_DETECTION #include "boost_no_ret_det.ipp" #else @@ -1816,6 +1821,11 @@ int main( int, char *[] ) std::cerr << "Failed test for BOOST_NO_CXX11_RAW_LITERALS at: " << __FILE__ << ":" << __LINE__ << std::endl; ++error_count; } + if(0 != boost_no_restrict_references::test()) + { + std::cerr << "Failed test for BOOST_NO_RESTRICT_REFERENCES at: " << __FILE__ << ":" << __LINE__ << std::endl; + ++error_count; + } if(0 != boost_no_unreachable_return_detection::test()) { std::cerr << "Failed test for BOOST_NO_UNREACHABLE_RETURN_DETECTION at: " << __FILE__ << ":" << __LINE__ << std::endl; diff --git a/test/no_restrict_references_fail.cpp b/test/no_restrict_references_fail.cpp new file mode 100644 index 00000000..867aa0cb --- /dev/null +++ b/test/no_restrict_references_fail.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Sun Feb 5 18:12:09 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_RESTRICT_REFERENCES +// This file should not compile, if it does then +// BOOST_NO_RESTRICT_REFERENCES should not be defined. +// See file boost_no_restrict_references.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_RESTRICT_REFERENCES +#include "boost_no_restrict_references.ipp" +#else +#error "this file should not compile" +#endif + +int main( int, char *[] ) +{ + return boost_no_restrict_references::test(); +} + diff --git a/test/no_restrict_references_pass.cpp b/test/no_restrict_references_pass.cpp new file mode 100644 index 00000000..878c54eb --- /dev/null +++ b/test/no_restrict_references_pass.cpp @@ -0,0 +1,37 @@ +// This file was automatically generated on Sun Feb 5 18:12:09 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_RESTRICT_REFERENCES +// This file should compile, if it does not then +// BOOST_NO_RESTRICT_REFERENCES should be defined. +// See file boost_no_restrict_references.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_RESTRICT_REFERENCES +#include "boost_no_restrict_references.ipp" +#else +namespace boost_no_restrict_references = empty_boost; +#endif + +int main( int, char *[] ) +{ + return boost_no_restrict_references::test(); +} +