On 24/10/19 10:34 +0100, Jonathan Wakely wrote:
        * include/bits/random.h (uniform_random_bit_generator): Define for
        C++20.
        * testsuite/26_numerics/random/concept.cc: New test.
        * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error line.

This is the last piece of P0898R3, "C++20 concepts library",

... so this updates the docs.

Tested powerpc64le-linux, committed to trunk.


commit bbcbcd50c07b8c735c6d19cc7487bbc736004ab7
Author: Jonathan Wakely <jwak...@redhat.com>
Date:   Thu Oct 24 10:45:10 2019 +0100

    PR libstdc++/88338 Implement P0898R3, C++20 concepts library
    
    The implementation is already complete but this updates the docs and
    adds tests for the feature test macro.
    
            * doc/xml/manual/status_cxx2020.xml: Update status.
            * doc/html/*: Regenerate.
            * testsuite/std/concepts/1.cc: New test.
            * testsuite/std/concepts/2.cc: New test.

diff --git a/libstdc++-v3/doc/xml/manual/status_cxx2020.xml b/libstdc++-v3/doc/xml/manual/status_cxx2020.xml
index 72c38ef985c..73949a34ad9 100644
--- a/libstdc++-v3/doc/xml/manual/status_cxx2020.xml
+++ b/libstdc++-v3/doc/xml/manual/status_cxx2020.xml
@@ -535,15 +535,14 @@ Feature-testing recommendations for C++</link>.
     </row>
 
     <row>
-      <?dbhtml bgcolor="#C8B0B0" ?>
       <entry>  Standard Library Concepts </entry>
       <entry>
         <link xmlns:xlink="http://www.w3.org/1999/xlink"; xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf";>
 	P0898R3
 	</link>
       </entry>
-      <entry align="center"> </entry>
-      <entry />
+      <entry align="center"> 10.1 </entry>
+      <entry> <code>__cpp_lib_concepts &gt;= 201806L</code> </entry>
     </row>
 
     <row>
diff --git a/libstdc++-v3/testsuite/std/concepts/1.cc b/libstdc++-v3/testsuite/std/concepts/1.cc
new file mode 100644
index 00000000000..f7f86e7b405
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/concepts/1.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2019 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do preprocess { target c++2a } }
+
+#include <concepts>
+
+#ifndef __cpp_lib_concepts
+# error "Feature test macro for concepts is missing in <concepts>"
+#elif __cpp_lib_concepts < 201806L
+# error "Feature test macro for concepts has wrong value in <concepts>"
+#endif
diff --git a/libstdc++-v3/testsuite/std/concepts/2.cc b/libstdc++-v3/testsuite/std/concepts/2.cc
new file mode 100644
index 00000000000..1b71b3110a5
--- /dev/null
+++ b/libstdc++-v3/testsuite/std/concepts/2.cc
@@ -0,0 +1,27 @@
+// Copyright (C) 2019 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do preprocess { target c++2a } }
+
+#include <version>
+
+#ifndef __cpp_lib_concepts
+# error "Feature test macro for concepts is missing in <version>"
+#elif __cpp_lib_concepts < 201806L
+# error "Feature test macro for concepts has wrong value in <version>"
+#endif

Reply via email to