This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Define [range.cmp] comparisons for C++20


On 23/10/19 08:08 +0100, Jonathan Wakely wrote:
On Wed, 23 Oct 2019 at 00:33, Tam S. B. <cpplearner@outlook.com> wrote:
The use of concepts is causing `#include <functional>` to break on clang.

OK, thanks, I'll guard it with #if.

Fixed on trunk with this patch. My Clang 7.0.1 still can't compile current
trunk though, because we now have a constexpr destructor on
std::allocator.

Thanks for the report.

commit 27274f130d7c3cf8a6ccbf27c24368fbbf2fb3fb
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 25 14:26:54 2019 +0100

    Guard use of concepts with feature test macro
    
    This fixes a regression when using Clang.
    
            * include/bits/range_cmp.h: Check __cpp_lib_concepts before defining
            concepts. Fix comment.

diff --git a/libstdc++-v3/include/bits/range_cmp.h b/libstdc++-v3/include/bits/range_cmp.h
index a77fd5274b9..870eb3a8ee5 100644
--- a/libstdc++-v3/include/bits/range_cmp.h
+++ b/libstdc++-v3/include/bits/range_cmp.h
@@ -22,7 +22,7 @@
 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 // <http://www.gnu.org/licenses/>.
 
-/** @file bits/ranges_function.h
+/** @file bits/range_cmp.h
  *  This is an internal header file, included by other library headers.
  *  Do not attempt to use it directly. @headername{functional}
  */
@@ -54,6 +54,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     using is_transparent = __is_transparent;
   };
 
+#ifdef __cpp_lib_concepts
 namespace ranges
 {
   namespace __detail
@@ -182,6 +183,7 @@ namespace ranges
   };
 
 } // namespace ranges
+#endif // library concepts
 _GLIBCXX_END_NAMESPACE_VERSION
 } // namespace std
 #endif // C++20

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]