lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master f62151a: Add workaround for Boost.Regex compi


From: Greg Chicares
Subject: [lmi-commits] [lmi] master f62151a: Add workaround for Boost.Regex compilation with clang 11
Date: Tue, 11 May 2021 18:50:07 -0400 (EDT)

branch: master
commit f62151ab4a23429fb05466f203fb937683907395
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Add workaround for Boost.Regex compilation with clang 11
    
    [The actual author is Vadim--see:
      https://lists.nongnu.org/archive/html/lmi/2021-05/msg00020.html
    I couldn't get git-am to work:
      Patch format detection failed
    so I used git-apply instead, and copied the commit message below.]
    
    std::allocator::size_type is used, even when BOOST_NO_STD_ALLOCATOR is
    defined, in boost/regex/v4/match_results.hpp, but libc++ used by clang
    11 doesn't define this type in C++20 mode, so explicitly request it to
    still be defined even in this case.
---
 boost_regex.hpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/boost_regex.hpp b/boost_regex.hpp
index c69fc7e..a273cb2 100644
--- a/boost_regex.hpp
+++ b/boost_regex.hpp
@@ -32,6 +32,14 @@
 #   pragma clang diagnostic ignored "-Wkeyword-macro"
 #   pragma clang diagnostic ignored "-Wparentheses-equality"
 #   pragma clang diagnostic ignored "-Wregister"
+
+    // libc++ used by clang 11 requires defining this symbol in order to define
+    // std::allocator::size_type, which is still used by Boost code even when
+    // BOOST_NO_STD_ALLOCATOR is defined. Surprisingly, this type definition is
+    // unconditional in libc++ 12, so this might have been a mistake in this
+    // particular libc++ version, but it's still simpler to work around it
+    // unconditionally rather than try to detect the exact libc++ version.
+#   define _LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS
 #endif // defined LMI_CLANG
 #if defined LMI_GCC
 #   pragma GCC diagnostic push



reply via email to

[Prev in Thread] Current Thread [Next in Thread]