PR libstdc++/88338 Implement P0898R3, C++20 concepts library
authorJonathan Wakely <jwakely@redhat.com>
Thu, 24 Oct 2019 09:47:25 +0000 (10:47 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 24 Oct 2019 09:47:25 +0000 (10:47 +0100)
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.

From-SVN: r277371

libstdc++-v3/ChangeLog
libstdc++-v3/doc/html/manual/status.html
libstdc++-v3/doc/xml/manual/status_cxx2020.xml
libstdc++-v3/testsuite/std/concepts/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/std/concepts/2.cc [new file with mode: 0644]

index 15448962fcf7285057d61dd26a3a23ac42316ede..d65c84586be5adaaaec987f71fea22723f64c5fa 100644 (file)
@@ -1,5 +1,11 @@
 2019-10-24  Jonathan Wakely  <jwakely@redhat.com>
 
+       PR libstdc++/88338 Implement P0898R3, C++20 concepts library
+       * 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.
+
        * include/bits/random.h (uniform_random_bit_generator): Define for
        C++20.
        * testsuite/26_numerics/random/concept.cc: New test.
index 884de7ca8d2c35f1e3a264ec71149fd8d72021d0..7e4e51c972dca8f28115bf1ef5dd740632947c23 100644 (file)
@@ -1214,11 +1214,11 @@ Feature-testing recommendations for C++</a>.
         <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html" target="_top">
        P0892R2
        </a>
-      </td><td align="center"> Note 1 </td><td align="left"> </td></tr><tr bgcolor="#C8B0B0"><td align="left">  Standard Library Concepts </td><td align="left">
+      </td><td align="center"> Note 1 </td><td align="left"> </td></tr><tr><td align="left">  Standard Library Concepts </td><td align="left">
         <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0898r3.pdf" target="_top">
        P0898R3
        </a>
-      </td><td align="center"> </td><td align="left"> </td></tr><tr><td align="left">  Eradicating unnecessarily explicit default constructors from the standard library </td><td align="left">
+      </td><td align="center"> 10.1 </td><td align="left"> <code class="code">__cpp_lib_concepts &gt;= 201806L</code> </td></tr><tr><td align="left">  Eradicating unnecessarily explicit default constructors from the standard library </td><td align="left">
         <a class="link" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html" target="_top">
        P0935R0
        </a>
index 72c38ef985cfa3d3590db6dc3dfd1c37989c8458..73949a34ad9076e93ed2fac2c74e1bc507191079 100644 (file)
@@ -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 (file)
index 0000000..f7f86e7
--- /dev/null
@@ -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 (file)
index 0000000..1b71b31
--- /dev/null
@@ -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