summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-10-24 10:47:25 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-10-24 10:47:25 +0100
commit02819d39199b8fa8388a235d9e1448e3b6ca2dd8 (patch)
treed1f164cfd3d019bba56581873bba262ef11cd8a9 /libstdc++-v3
parentbbf0495dd2b583c54d5ff591f4f1351f74d98bf9 (diff)
downloadgcc-02819d39199b8fa8388a235d9e1448e3b6ca2dd8.tar.gz
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. From-SVN: r277371
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/doc/html/manual/status.html4
-rw-r--r--libstdc++-v3/doc/xml/manual/status_cxx2020.xml5
-rw-r--r--libstdc++-v3/testsuite/std/concepts/1.cc27
-rw-r--r--libstdc++-v3/testsuite/std/concepts/2.cc27
5 files changed, 64 insertions, 5 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 15448962fcf..d65c84586be 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -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.
diff --git a/libstdc++-v3/doc/html/manual/status.html b/libstdc++-v3/doc/html/manual/status.html
index 884de7ca8d2..7e4e51c972d 100644
--- a/libstdc++-v3/doc/html/manual/status.html
+++ b/libstdc++-v3/doc/html/manual/status.html
@@ -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>
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