public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Aldy Hernandez <aldyh@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc/devel/ranger] libstdc++: Update the <numeric> synopsis test to latest standard
Date: Wed, 17 Jun 2020 19:17:54 +0000 (GMT) [thread overview]
Message-ID: <20200617191754.B6D763959C5F@sourceware.org> (raw)
https://gcc.gnu.org/g:799270b430542572ddc859331e9e15311ce7ee2c
commit 799270b430542572ddc859331e9e15311ce7ee2c
Author: Patrick Palka <ppalka@redhat.com>
Date: Fri Feb 28 12:43:14 2020 -0500
libstdc++: Update the <numeric> 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 ++
| 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 <ppalka@redhat.com>
+
+ * 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 <jwakely@redhat.com>
* testsuite/24_iterators/range_operations/advance_debug_neg.cc: Run
--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 <numeric>
+#if __cplusplus > 201703L
+#define CONSTEXPR constexpr
+#else
+#define CONSTEXPR
+#endif
+
namespace std {
template <class InputIterator, class T>
+ CONSTEXPR
T accumulate(InputIterator first, InputIterator last, T init);
template <class InputIterator, class T, class BinaryOperation>
+ CONSTEXPR
T accumulate(InputIterator first, InputIterator last, T init,
BinaryOperation binary_op);
template <class InputIterator1, class InputIterator2, class T>
+ CONSTEXPR
T inner_product(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init);
template <class InputIterator1, class InputIterator2, class T,
class BinaryOperation1, class BinaryOperation2>
+ CONSTEXPR
T inner_product(InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, T init,
BinaryOperation1 binary_op1,
BinaryOperation2 binary_op2);
template <class InputIterator, class OutputIterator>
+ CONSTEXPR
OutputIterator partial_sum(InputIterator first,
InputIterator last,
OutputIterator result);
template <class InputIterator, class OutputIterator,
class BinaryOperation>
+ CONSTEXPR
OutputIterator partial_sum(InputIterator first,
InputIterator last,
OutputIterator result,
BinaryOperation binary_op);
template <class InputIterator, class OutputIterator>
+ CONSTEXPR
OutputIterator adjacent_difference(InputIterator first,
InputIterator last,
OutputIterator result);
template <class InputIterator, class OutputIterator,
class BinaryOperation>
+ CONSTEXPR
OutputIterator adjacent_difference(InputIterator first,
InputIterator last,
OutputIterator result,
BinaryOperation binary_op);
+#if __cplusplus >= 201103L
+ template<class ForwardIterator, class T>
+ CONSTEXPR void iota(ForwardIterator first, ForwardIterator last, T value);
+#endif // C++11
+
+#if __cplusplus >= 201703L
+ template<class InputIterator>
+ CONSTEXPR typename iterator_traits<InputIterator>::value_type
+ reduce(InputIterator first, InputIterator last);
+
+ template<class InputIterator, class T>
+ CONSTEXPR T reduce(InputIterator first, InputIterator last, T init);
+
+ template<class InputIterator, class T, class BinaryOperation>
+ CONSTEXPR T reduce(InputIterator first, InputIterator last, T init,
+ BinaryOperation binary_op);
+
+ template<class InputIterator, class OutputIterator, class T>
+ CONSTEXPR OutputIterator
+ exclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result, T init);
+
+ template<class InputIterator, class OutputIterator, class T,
+ class BinaryOperation>
+ CONSTEXPR OutputIterator
+ exclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result, T init, BinaryOperation binary_op);
+
+ template<class InputIterator, class OutputIterator>
+ CONSTEXPR OutputIterator
+ inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result);
+
+ template<class InputIterator, class OutputIterator, class BinaryOperation>
+ CONSTEXPR OutputIterator
+ inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result, BinaryOperation binary_op);
+
+ template<class InputIterator, class OutputIterator, class BinaryOperation,
+ class T>
+ CONSTEXPR OutputIterator
+ inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result, BinaryOperation binary_op, T init);
+
+ template<class InputIterator1, class InputIterator2, class T>
+ CONSTEXPR T transform_reduce(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init);
+
+ template<class InputIterator1, class InputIterator2, class T,
+ class BinaryOperation1, class BinaryOperation2>
+ CONSTEXPR T transform_reduce(InputIterator1 first1, InputIterator1 last1,
+ InputIterator2 first2, T init,
+ BinaryOperation1 binary_op1,
+ BinaryOperation2 binary_op2);
+
+ template<class InputIterator, class T,
+ class BinaryOperation, class UnaryOperation>
+ CONSTEXPR T transform_reduce(InputIterator first, InputIterator last, T init,
+ BinaryOperation binary_op,
+ UnaryOperation unary_op);
+
+ template<class InputIterator, class OutputIterator, class T,
+ class BinaryOperation, class UnaryOperation>
+ CONSTEXPR OutputIterator
+ transform_exclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result, T init,
+ BinaryOperation binary_op, UnaryOperation unary_op);
+
+ template<class InputIterator, class OutputIterator,
+ class BinaryOperation, class UnaryOperation>
+ CONSTEXPR OutputIterator
+ transform_inclusive_scan(InputIterator first, InputIterator last,
+ OutputIterator result,
+ BinaryOperation binary_op, UnaryOperation unary_op);
+
+ template<class InputIterator, class OutputIterator,
+ class BinaryOperation, class UnaryOperation, class T>
+ 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<class M, class N>
+ constexpr common_type_t<M,N> gcd(M m, N n);
+
+ template<class M, class N>
+ constexpr common_type_t<M,N> lcm(M m, N n);
+
+ template<class T>
+ constexpr T midpoint(T a, T b) noexcept;
+
+ template<class T>
+ constexpr T* midpoint(T* a, T* b);
+#endif // C++2a
}
reply other threads:[~2020-06-17 19:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200617191754.B6D763959C5F@sourceware.org \
--to=aldyh@gcc.gnu.org \
--cc=gcc-cvs@gcc.gnu.org \
--cc=libstdc++-cvs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).