From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id B6D763959C5F; Wed, 17 Jun 2020 19:17:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B6D763959C5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1592421474; bh=1HS+Ivx3DbzLJptCTExMrPaFXC13IRQt4vml/9oa50c=; h=From:To:Subject:Date:From; b=PvQ6BpqlCXKyjr+R6NxYScPkfX2tfemZV6UpSk06jfK6qUr19ucVKQclL7cED9vI8 t11eZYy7mqEK4mTY8CyG1bGXHbJOqVQOqkjsnDhZm/IQOf2Q0gChGNckTGODca+Bl/ TlKt0hNQYzO9D5M2DVDWG4v+GtiaCwJX5nQYY75k= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc/devel/ranger] libstdc++: Update the synopsis test to latest standard X-Act-Checkin: gcc X-Git-Author: Patrick Palka X-Git-Refname: refs/heads/devel/ranger X-Git-Oldrev: 586b016cd48f5a5f6f2ba9f179105fabaa3e85dd X-Git-Newrev: 799270b430542572ddc859331e9e15311ce7ee2c Message-Id: <20200617191754.B6D763959C5F@sourceware.org> Date: Wed, 17 Jun 2020 19:17:54 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jun 2020 19:17:54 -0000 https://gcc.gnu.org/g:799270b430542572ddc859331e9e15311ce7ee2c commit 799270b430542572ddc859331e9e15311ce7ee2c Author: Patrick Palka Date: Fri Feb 28 12:43:14 2020 -0500 libstdc++: Update the synopsis test to latest standard Tested with make check RUNTESTFLAGS="conformance.exp=*numeric*synopsis* --target_board=unix/-std=$std" for std in {c++98, c++11, c++17, c++2a}. libstdc++-v3/ChangeLog: * testsuite/26_numerics/headers/numeric/synopsis.cc: Add signatures for functions introduced in C++11, C++17 and C++2a. Add 'constexpr' to existing signatures for C++2a. Diff: --- libstdc++-v3/ChangeLog | 6 ++ .../26_numerics/headers/numeric/synopsis.cc | 111 +++++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 98eaff92fd1..6484e499b96 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2020-02-28 Patrick Palka + + * testsuite/26_numerics/headers/numeric/synopsis.cc: Add signatures for + functions introduced in C++11, C++17 and C++2a. Add 'constexpr' to + existing signatures for C++2a. + 2020-02-28 Jonathan Wakely * testsuite/24_iterators/range_operations/advance_debug_neg.cc: Run diff --git a/libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc b/libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc index 8d3850ff0cf..5a9465c45f4 100644 --- a/libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc +++ b/libstdc++-v3/testsuite/26_numerics/headers/numeric/synopsis.cc @@ -19,46 +19,157 @@ #include +#if __cplusplus > 201703L +#define CONSTEXPR constexpr +#else +#define CONSTEXPR +#endif + namespace std { template + CONSTEXPR T accumulate(InputIterator first, InputIterator last, T init); template + CONSTEXPR T accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); template + CONSTEXPR T inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init); template + CONSTEXPR T inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); template + CONSTEXPR OutputIterator partial_sum(InputIterator first, InputIterator last, OutputIterator result); template + CONSTEXPR OutputIterator partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op); template + CONSTEXPR OutputIterator adjacent_difference(InputIterator first, InputIterator last, OutputIterator result); template + CONSTEXPR OutputIterator adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op); +#if __cplusplus >= 201103L + template + CONSTEXPR void iota(ForwardIterator first, ForwardIterator last, T value); +#endif // C++11 + +#if __cplusplus >= 201703L + template + CONSTEXPR typename iterator_traits::value_type + reduce(InputIterator first, InputIterator last); + + template + CONSTEXPR T reduce(InputIterator first, InputIterator last, T init); + + template + CONSTEXPR T reduce(InputIterator first, InputIterator last, T init, + BinaryOperation binary_op); + + template + CONSTEXPR OutputIterator + exclusive_scan(InputIterator first, InputIterator last, + OutputIterator result, T init); + + template + CONSTEXPR OutputIterator + exclusive_scan(InputIterator first, InputIterator last, + OutputIterator result, T init, BinaryOperation binary_op); + + template + CONSTEXPR OutputIterator + inclusive_scan(InputIterator first, InputIterator last, + OutputIterator result); + + template + CONSTEXPR OutputIterator + inclusive_scan(InputIterator first, InputIterator last, + OutputIterator result, BinaryOperation binary_op); + + template + CONSTEXPR OutputIterator + inclusive_scan(InputIterator first, InputIterator last, + OutputIterator result, BinaryOperation binary_op, T init); + + template + CONSTEXPR T transform_reduce(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init); + + template + CONSTEXPR T transform_reduce(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, T init, + BinaryOperation1 binary_op1, + BinaryOperation2 binary_op2); + + template + CONSTEXPR T transform_reduce(InputIterator first, InputIterator last, T init, + BinaryOperation binary_op, + UnaryOperation unary_op); + + template + CONSTEXPR OutputIterator + transform_exclusive_scan(InputIterator first, InputIterator last, + OutputIterator result, T init, + BinaryOperation binary_op, UnaryOperation unary_op); + + template + CONSTEXPR OutputIterator + transform_inclusive_scan(InputIterator first, InputIterator last, + OutputIterator result, + BinaryOperation binary_op, UnaryOperation unary_op); + + template + CONSTEXPR OutputIterator + transform_inclusive_scan(InputIterator first, InputIterator last, + OutputIterator result, + BinaryOperation binary_op, UnaryOperation unary_op, + T init); +#endif // C++17 + +#if __cplusplus > 201703L + template + constexpr common_type_t gcd(M m, N n); + + template + constexpr common_type_t lcm(M m, N n); + + template + constexpr T midpoint(T a, T b) noexcept; + + template + constexpr T* midpoint(T* a, T* b); +#endif // C++2a }