From 0b8b87a632dc92b86b6af3a80b3f1ed133948c93 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Sat, 22 Mar 2014 19:38:49 +0300 Subject: [PATCH 1/2] Mark unusable for all libstdc++ versions The header is present but the regex implementation is incomplete and fails with regex_error exceptions in runtime for many valid patterns. So define BOOST_NO_CXX11_HDR_REGEX for it unconditionally. See: http://thread.gmane.org/gmane.comp.lib.boost.devel/250010 --- include/boost/config/stdlib/libstdcpp3.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 172a2df7..872cb162 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -107,7 +107,6 @@ // #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__) # define BOOST_NO_CXX11_HDR_ARRAY -# define BOOST_NO_CXX11_HDR_REGEX # define BOOST_NO_CXX11_HDR_TUPLE # define BOOST_NO_CXX11_HDR_UNORDERED_MAP # define BOOST_NO_CXX11_HDR_UNORDERED_SET @@ -152,7 +151,7 @@ // C++0x features in GCC 4.7.0 and later // #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__) -// Note that although existed prior to 4.7, "stead_clock" is spelled "monotonic_clock" +// Note that although existed prior to 4.7, "steady_clock" is spelled "monotonic_clock" // so 4.7.0 is the first truely conforming one. # define BOOST_NO_CXX11_HDR_CHRONO # define BOOST_NO_CXX11_ALLOCATOR @@ -170,5 +169,8 @@ # define BOOST_NO_CXX11_HDR_CODECVT # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_STD_ALIGN +// Although is present and compilable against, the actual implementation is not functional +// even for the simplest patterns such as "\d" or "[0-9]". This is the case at least in gcc up to 4.8, inclusively. +# define BOOST_NO_CXX11_HDR_REGEX // --- end --- From 654762003e027ca6d3ac85ea5d7a3790da7f1c7c Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 25 Mar 2014 17:12:46 +0000 Subject: [PATCH 2/2] Header is finally working (probably) in gcc-4.9. Add better tests for it as well. --- include/boost/config/stdlib/libstdcpp3.hpp | 8 +++++--- test/boost_no_cxx11_hdr_regex.ipp | 7 ++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 872cb162..2fd6ea7d 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -162,6 +162,11 @@ // Note that although existed prior to gcc 4.8 it was largely unimplemented for many types: # define BOOST_NO_CXX11_HDR_ATOMIC #endif +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +// Although is present and compilable against, the actual implementation is not functional +// even for the simplest patterns such as "\d" or "[0-9]". This is the case at least in gcc up to 4.8, inclusively. +# define BOOST_NO_CXX11_HDR_REGEX +#endif // C++0x headers not yet (fully!) implemented // # define BOOST_NO_CXX11_HDR_THREAD @@ -169,8 +174,5 @@ # define BOOST_NO_CXX11_HDR_CODECVT # define BOOST_NO_CXX11_ATOMIC_SMART_PTR # define BOOST_NO_CXX11_STD_ALIGN -// Although is present and compilable against, the actual implementation is not functional -// even for the simplest patterns such as "\d" or "[0-9]". This is the case at least in gcc up to 4.8, inclusively. -# define BOOST_NO_CXX11_HDR_REGEX // --- end --- diff --git a/test/boost_no_cxx11_hdr_regex.ipp b/test/boost_no_cxx11_hdr_regex.ipp index 750db43b..81512579 100644 --- a/test/boost_no_cxx11_hdr_regex.ipp +++ b/test/boost_no_cxx11_hdr_regex.ipp @@ -18,7 +18,12 @@ int test() { using std::regex; using std::wregex; - return 0; + + regex e("\\d+"); + wregex we(L"\\s+"); + std::string s("123456"); + std::wstring ws(L"123456"); + return regex_match(s, e) && regex_match(ws, we) ? 0 : 1; } }