From: redi Date: Thu, 24 Oct 2019 09:47:25 +0000 (+0000) Subject: PR libstdc++/88338 Implement P0898R3, C++20 concepts library X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54e2e2bb856b812918abdab823be13034ac4e0ea;p=thirdparty%2Fgcc.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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277371 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 15448962fcf7..d65c84586be5 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 884de7ca8d2c..7e4e51c972dc 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 72c38ef985cf..73949a34ad90 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 000000000000..f7f86e7b405f --- /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 000000000000..1b71b3110a55 --- /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