From 85366343968e93bcafa77900d640ae3ebde7fb9a Mon Sep 17 00:00:00 2001
From: Jeff Trull
Date: Tue, 30 Jun 2020 12:24:00 -0700
Subject: [PATCH] Deprecate C++03 and re-deprecate the old preprocessor hooks
(#104)
Targeting a one year transition period for C++03 -> C++11 and one release less to finally get off the old hooks - assuming there are even any users of them.
Also added documentation per @pdimov recommendations at https://pdimov.github.io/articles/phasing_out_cxx03.html#_suggested_policy
---
ChangeLog | 1 +
doc/class_ref_ctxpolicy_depr.html | 2 +-
doc/compiletime_config.html | 2 ++
include/boost/wave/wave_config.hpp | 15 +++++++++++++++
4 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6730bce..766cf32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@ Boost V1.74:
- Repaired two samples and added a new one for macro naming enforcement
- Implemented C++20 changes for variadic macros, including __VA_OPT__()
- Added C++17 feature __has_include()
+ - Deprecate C++98 and C++03. Support will end with 1.77.
Boost V1.73:
- Fixed TRAC #7822: waveidl sample does not use the IDL lexer
diff --git a/doc/class_ref_ctxpolicy_depr.html b/doc/class_ref_ctxpolicy_depr.html
index e8df187..92da7d2 100644
--- a/doc/class_ref_ctxpolicy_depr.html
+++ b/doc/class_ref_ctxpolicy_depr.html
@@ -32,7 +32,7 @@
Introduction
Please note that the following description relates to a depreciated interface as it was used by default up to Boost V1.34.x. For the new interface please refer to The Context Policy. You can still force to use this older interface by defining the BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS preprocessing constant as outlined in the Compile
-Time Configuration section. By default the new interface is used starting Boost V1.35.0, while the older one is used by default otherwise.
+Time Configuration section. By default the new interface is used starting Boost V1.35.0, while the older one is used by default otherwise. The old interface will be removed entirely with Boost 1.76.
The context policy is used to provide callback hooks, which are called from inside the library into the user code, whenever
- a preprocessor directive has been recognized,
diff --git a/doc/compiletime_config.html b/doc/compiletime_config.html
index eadc002..b167670 100644
--- a/doc/compiletime_config.html
+++ b/doc/compiletime_config.html
@@ -244,6 +244,8 @@ even if these do not have the 'll' suffix.
where the '...somthing' is a hint, which grammars
are explicitly instantiated inside. By using the separation model the compilation
times required to build the Wave example are dropped by up to 90%.
+Compiler Requirements
+Beginning with version 1.77, Wave will require building with C++11 features, and will no longer support the use of older compilers. However, Wave will continue to emulate the features of older preprocessors indefinitely.
|
diff --git a/include/boost/wave/wave_config.hpp b/include/boost/wave/wave_config.hpp
index fcd9fe9..3d224f1 100644
--- a/include/boost/wave/wave_config.hpp
+++ b/include/boost/wave/wave_config.hpp
@@ -14,6 +14,7 @@
#define BOOST_WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED
#include
+#include
#include
#include
#include
@@ -515,6 +516,18 @@ namespace boost { namespace wave
#endif // auto-linking disabled
#endif // BOOST_VERSION
+///////////////////////////////////////////////////////////////////////////////
+// Deprecate C++03
+///////////////////////////////////////////////////////////////////////////////
+
+#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \
+ || defined(BOOST_NO_CXX11_HDR_MEMORY) || defined(BOOST_NO_CXX11_HDR_THREAD) \
+ || defined(BOOST_NO_CXX11_HDR_MUTEX) || defined(BOOST_NO_CXX11_HDR_REGEX)
+
+BOOST_PRAGMA_MESSAGE("C++03 support is deprecated in Boost.Wave 1.74 and will be removed in Boost.Wave 1.77.")
+
+#endif
+
///////////////////////////////////////////////////////////////////////////////
// Compatibility macros
// (ensure interface compatibility to older Wave versions)
@@ -535,6 +548,8 @@ namespace boost { namespace wave
#else
#define BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS 0
#endif
+#elif BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
+BOOST_PRAGMA_MESSAGE("The old preprocessing hooks were deprecated in Boost 1.35 and will be removed in 1.76. See https://www.boost.org/doc/libs/1_74_0/libs/wave/doc/class_ref_ctxpolicy_depr.html for details")
#endif
#endif // !defined(BOOST_WAVE_CONFIG_HPP_F143F90A_A63F_4B27_AC41_9CA4F14F538D_INCLUDED)