commit bbcbcd50c07b8c735c6d19cc7487bbc736004ab7 Author: Jonathan Wakely 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++. - 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