Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions checks/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ obj cxx11_hdr_unordered_set : test_case.cpp : <define>TEST_BOOST_NO_CXX11_HDR_UN
obj cxx11_inline_namespaces : test_case.cpp : <define>TEST_BOOST_NO_CXX11_INLINE_NAMESPACES ;
obj cxx11_non_public_defaulted_functions : test_case.cpp : <define>TEST_BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS ;
obj cxx11_numeric_limits : test_case.cpp : <define>TEST_BOOST_NO_CXX11_NUMERIC_LIMITS ;
obj cxx11_override : test_case.cpp : <define>TEST_BOOST_NO_CXX11_OVERRIDE ;
obj cxx11_pointer_traits : test_case.cpp : <define>TEST_BOOST_NO_CXX11_POINTER_TRAITS ;
obj cxx11_ref_qualifiers : test_case.cpp : <define>TEST_BOOST_NO_CXX11_REF_QUALIFIERS ;
obj cxx11_sfinae_expr : test_case.cpp : <define>TEST_BOOST_NO_CXX11_SFINAE_EXPR ;
Expand Down
5 changes: 5 additions & 0 deletions checks/test_case.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@
# error "Defect macro BOOST_NO_CXX11_NUMERIC_LIMITS is defined."
# endif
#endif
#ifdef TEST_BOOST_NO_CXX11_OVERRIDE
# ifdef BOOST_NO_CXX11_OVERRIDE
# error "Defect macro BOOST_NO_CXX11_OVERRIDE is defined."
# endif
#endif
#ifdef TEST_BOOST_NO_CXX11_POINTER_TRAITS
# ifdef BOOST_NO_CXX11_POINTER_TRAITS
# error "Defect macro BOOST_NO_CXX11_POINTER_TRAITS is defined."
Expand Down
6 changes: 6 additions & 0 deletions doc/macro_reference.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,8 @@ compilers implementing an early draft of the C++11 standard (in particular, inco
[[`BOOST_NO_CXX11_NUMERIC_LIMITS`][The standard library `<limits>` header does
not support the C++11 version of `numeric_limits`.
]]
[[`BOOST_NO_CXX11_OVERRIDE`][The compiler does not support `override`.
]]
[[`BOOST_NO_CXX11_POINTER_TRAITS`][The standard library does not provide a
C++11 version of `std::pointer_traits` in <memory>.]]
[[`BOOST_NO_CXX11_RANGE_BASED_FOR`][The compiler does not support
Expand Down Expand Up @@ -793,6 +795,10 @@ with:
static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a;
``
]]
[[`BOOST_OVERRIDE`][
If `BOOST_NO_CXX11_OVERRIDE` is not defined (i.e. C++11 compliant compilers),
expands to `override` keyword, otherwise expands to nothing.
]]
[[`BOOST_STATIC_CONSTEXPR`][
This is a shortcut for `static BOOST_CONSTEXPR_OR_CONST`. For example, when defining const expr variables replace:
``
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/borland.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/clang.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@

#if !__has_feature(cxx_override_control)
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_OVERRIDE
#endif

#if !__has_feature(cxx_unrestricted_unions)
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/codegear.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_DECLTYPE_N3276
#define BOOST_NO_CXX11_UNRESTRICTED_UNION
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/common_edg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
3 changes: 3 additions & 0 deletions include/boost/config/compiler/cray.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
#define BOOST_NO_CXX11_DELETED_FUNCTIONS
#define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_CXX11_LAMBDAS
#define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
Expand Down Expand Up @@ -275,6 +276,7 @@
#undef BOOST_NO_CXX11_DELETED_FUNCTIONS
#undef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS
#undef BOOST_NO_CXX11_FINAL
#undef BOOST_NO_CXX11_OVERRIDE
#undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#undef BOOST_NO_CXX11_LAMBDAS
#undef BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS
Expand Down Expand Up @@ -346,6 +348,7 @@
#undef BOOST_NO_CXX11_CHAR32_T
#undef BOOST_NO_CXX11_INLINE_NAMESPACES
#undef BOOST_NO_CXX11_FINAL
#undef BOOST_NO_CXX11_OVERRIDE
#undef BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
#undef BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_CXX11_SFINAE_EXPR // This is correct, even though '*_fail.cpp' test fails.
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/digitalmars.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/gcc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
# define BOOST_NO_CXX11_TEMPLATE_ALIASES
# define BOOST_NO_CXX11_USER_DEFINED_LITERALS
# define BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS
# define BOOST_NO_CXX11_OVERRIDE
#endif

// C++0x features in 4.8.n and later
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/gcc_xml.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
# define BOOST_NO_CXX11_INLINE_NAMESPACES
# define BOOST_NO_CXX11_REF_QUALIFIERS
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_OVERRIDE
# define BOOST_NO_CXX11_THREAD_LOCAL
# define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
2 changes: 2 additions & 0 deletions include/boost/config/compiler/intel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,10 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
#endif

// BOOST_NO_CXX11_FINAL
// BOOST_NO_CXX11_OVERRIDE
#if (BOOST_INTEL_CXX_VERSION >= 1400) && (!defined(BOOST_INTEL_GCC_VERSION) || (BOOST_INTEL_GCC_VERSION >= 40700)) && (!defined(_MSC_VER) || (_MSC_VER >= 1700))
# undef BOOST_NO_CXX11_FINAL
# undef BOOST_NO_CXX11_OVERRIDE
#endif

// BOOST_NO_CXX11_UNRESTRICTED_UNION
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/metrowerks.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/mpw.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/pathscale.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
# define BOOST_NO_CXX11_INLINE_NAMESPACES
# define BOOST_NO_CXX11_REF_QUALIFIERS
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_OVERRIDE
# define BOOST_NO_CXX11_THREAD_LOCAL
# define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/sunpro_cc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
#define BOOST_NO_CXX11_TRAILING_RESULT_TYPES
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_UNRESTRICTED_UNION
#endif

Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/vacpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
#define BOOST_NO_CXX11_INLINE_NAMESPACES
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_UNRESTRICTED_UNION

Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/visualc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_RANGE_BASED_FOR
# define BOOST_NO_CXX11_SCOPED_ENUMS
# define BOOST_NO_CXX11_OVERRIDE
#endif // _MSC_VER < 1700

// C++11 features supported by VC++ 12 (aka 2013).
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/xlcpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@

#if !__has_feature(cxx_override_control)
# define BOOST_NO_CXX11_FINAL
# define BOOST_NO_CXX11_OVERRIDE
#endif

#if !__has_feature(cxx_unrestricted_unions)
Expand Down
1 change: 1 addition & 0 deletions include/boost/config/compiler/xlcpp_zos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
#define BOOST_NO_CXX11_THREAD_LOCAL
#define BOOST_NO_CXX11_REF_QUALIFIERS
#define BOOST_NO_CXX11_FINAL
#define BOOST_NO_CXX11_OVERRIDE
#define BOOST_NO_CXX11_ALIGNAS
#define BOOST_NO_CXX11_UNRESTRICTED_UNION
#define BOOST_NO_CXX14_VARIABLE_TEMPLATES
Expand Down
6 changes: 6 additions & 0 deletions include/boost/config/detail/suffix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,12 @@ namespace std{ using ::type_info; }
# define BOOST_UNLIKELY(x) x
#endif

#if !defined(BOOST_NO_CXX11_OVERRIDE)
# define BOOST_OVERRIDE override
#else
# define BOOST_OVERRIDE
#endif

// Type and data alignment specification
//
#if !defined(BOOST_ALIGNMENT)
Expand Down
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ test-suite config
[ run helper_macros_test.cpp ]
[ compile pragma_message_test.cpp ]
[ compile header_deprecated_test.cpp ]
[ compile boost_override_test.cpp ]
;

obj has_clang_implicit_fallthrough : cmd_line_check.cpp :
Expand Down
5 changes: 4 additions & 1 deletion test/all/Jamfile.v2
Original file line number Diff line number Diff line change
@@ -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 09 09:47:37 2019
# This file was automatically generated on Thu Apr 9 14:27:07 2020
# by libs/config/tools/generate.cpp
# Copyright John Maddock.
# Use, modification and distribution are subject to the
Expand Down Expand Up @@ -268,6 +268,9 @@ test-suite "BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS" :
test-suite "BOOST_NO_CXX11_NUMERIC_LIMITS" :
[ run ../no_cxx11_numeric_limits_pass.cpp ]
[ compile-fail ../no_cxx11_numeric_limits_fail.cpp ] ;
test-suite "BOOST_NO_CXX11_OVERRIDE" :
[ run ../no_cxx11_override_pass.cpp ]
[ compile-fail ../no_cxx11_override_fail.cpp ] ;
test-suite "BOOST_NO_CXX11_POINTER_TRAITS" :
[ run ../no_cxx11_pointer_traits_pass.cpp ]
[ compile-fail ../no_cxx11_pointer_traits_fail.cpp ] ;
Expand Down
32 changes: 32 additions & 0 deletions test/boost_no_cxx11_override.ipp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright 2020 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_CXX11_OVERRIDE
// TITLE: C++11 SFINAE for expressions
// DESCRIPTION: C++11 SFINAE for expressions not supported.

namespace boost_no_cxx11_override {

struct base {
virtual void first() = 0;
virtual void second() { }
};

struct derived
: base {
void first() override { }
void second() override { }
};

int test()
{
return 0;
}

} /* boost_no_cxx11_override */
19 changes: 19 additions & 0 deletions test/boost_override_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
Copyright 2020 Glen Joseph Fernandes
(glenjofe@gmail.com)

Distributed under Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt)
*/
#include <boost/config.hpp>

struct base {
virtual void first() = 0;
virtual void second() { }
};

struct derived
: base {
void first() BOOST_OVERRIDE { }
void second() BOOST_OVERRIDE { }
};
2 changes: 2 additions & 0 deletions test/config_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS);
PRINT_MACRO(BOOST_NO_CXX11_NULLPTR);
PRINT_MACRO(BOOST_NO_CXX11_NUMERIC_LIMITS);
PRINT_MACRO(BOOST_NO_CXX11_OVERRIDE);
PRINT_MACRO(BOOST_NO_CXX11_POINTER_TRAITS);
PRINT_MACRO(BOOST_NO_CXX11_RANGE_BASED_FOR);
PRINT_MACRO(BOOST_NO_CXX11_RAW_LITERALS);
Expand Down Expand Up @@ -1234,6 +1235,7 @@ void print_boost_macros()
PRINT_MACRO(BOOST_NO_VOID_RETURNS);



// END GENERATED BLOCK

PRINT_MACRO(BOOST_INTEL);
Expand Down
12 changes: 11 additions & 1 deletion test/config_test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file was automatically generated on Mon Dec 09 09:47:37 2019
// This file was automatically generated on Thu Apr 9 14:27:07 2020
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to the
Expand Down Expand Up @@ -247,6 +247,11 @@ namespace boost_no_cxx11_non_public_defaulted_functions = empty_boost;
#else
namespace boost_no_cxx11_numeric_limits = empty_boost;
#endif
#ifndef BOOST_NO_CXX11_OVERRIDE
#include "boost_no_cxx11_override.ipp"
#else
namespace boost_no_cxx11_override = empty_boost;
#endif
#ifndef BOOST_NO_CXX11_POINTER_TRAITS
#include "boost_no_cxx11_pointer_traits.ipp"
#else
Expand Down Expand Up @@ -1431,6 +1436,11 @@ int main( int, char *[] )
std::cerr << "Failed test for BOOST_NO_CXX11_NUMERIC_LIMITS at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_cxx11_override::test())
{
std::cerr << "Failed test for BOOST_NO_CXX11_OVERRIDE at: " << __FILE__ << ":" << __LINE__ << std::endl;
++error_count;
}
if(0 != boost_no_cxx11_pointer_traits::test())
{
std::cerr << "Failed test for BOOST_NO_CXX11_POINTER_TRAITS at: " << __FILE__ << ":" << __LINE__ << std::endl;
Expand Down
37 changes: 37 additions & 0 deletions test/no_cxx11_override_fail.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// This file was automatically generated on Thu Apr 9 14:27:07 2020
// 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_CXX11_OVERRIDE
// This file should not compile, if it does then
// BOOST_NO_CXX11_OVERRIDE should not be defined.
// See file boost_no_cxx11_override.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_CXX11_OVERRIDE
#include "boost_no_cxx11_override.ipp"
#else
#error "this file should not compile"
#endif

int main( int, char *[] )
{
return boost_no_cxx11_override::test();
}

Loading