From: Jonathan Wakely Date: Thu, 24 Oct 2019 09:47:25 +0000 (+0100) Subject: PR libstdc++/88338 Implement P0898R3, C++20 concepts library X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=02819d39199b8fa8388a235d9e1448e3b6ca2dd8;p=gcc.git 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 --- 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 + 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++. P0892R2 - Note 1   Standard Library Concepts + Note 1   Standard Library Concepts P0898R3 -   Eradicating unnecessarily explicit default constructors from the standard library + 10.1 __cpp_lib_concepts >= 201806L Eradicating unnecessarily explicit default constructors from the standard library P0935R0 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++. - Standard Library Concepts P0898R3 - - + 10.1 + __cpp_lib_concepts >= 201806L 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 +// . + +// { dg-options "-std=gnu++2a" } +// { dg-do preprocess { target c++2a } } + +#include + +#ifndef __cpp_lib_concepts +# error "Feature test macro for concepts is missing in " +#elif __cpp_lib_concepts < 201806L +# error "Feature test macro for concepts has wrong value in " +#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 +// . + +// { dg-options "-std=gnu++2a" } +// { dg-do preprocess { target c++2a } } + +#include + +#ifndef __cpp_lib_concepts +# error "Feature test macro for concepts is missing in " +#elif __cpp_lib_concepts < 201806L +# error "Feature test macro for concepts has wrong value in " +#endif