From 577663511e00773f0d4ac2da00d1add7f4529d18 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 1 Oct 2019 22:02:01 +0100 Subject: [PATCH] Fix non-reserved names in Parallel Mode headers * include/parallel/algo.h: Replace non-reserved names. * include/parallel/multiway_merge.h: Likewise. * include/parallel/multiway_mergesort.h: Likewise. * include/parallel/numericfwd.h: Likewise. * testsuite/17_intro/names.cc: Add RAI to test macros. From-SVN: r276429 --- libstdc++-v3/ChangeLog | 8 ++++++++ libstdc++-v3/include/parallel/algo.h | 6 +++--- .../include/parallel/multiway_merge.h | 12 +++++------ .../include/parallel/multiway_mergesort.h | 20 +++++++++---------- libstdc++-v3/include/parallel/numericfwd.h | 14 ++++++------- libstdc++-v3/testsuite/17_intro/names.cc | 1 + 6 files changed, 35 insertions(+), 26 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 7ea135d7842..5b12f564f1b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2019-10-01 Jonathan Wakely + + * include/parallel/algo.h: Replace non-reserved names. + * include/parallel/multiway_merge.h: Likewise. + * include/parallel/multiway_mergesort.h: Likewise. + * include/parallel/numericfwd.h: Likewise. + * testsuite/17_intro/names.cc: Add RAI to test macros. + 2019-09-30 François Dumont * include/debug/array: Add C++20 constexpr to comparison operators. diff --git a/libstdc++-v3/include/parallel/algo.h b/libstdc++-v3/include/parallel/algo.h index dc6971f5dd4..afa325bb4af 100644 --- a/libstdc++-v3/include/parallel/algo.h +++ b/libstdc++-v3/include/parallel/algo.h @@ -311,11 +311,11 @@ namespace __parallel { return _GLIBCXX_STD_A::unique_copy(__begin, __last, __out, __pred); } // Parallel unique_copy for random access iterators - template - RandomAccessOutputIterator + _RandomAccessOutputIterator __unique_copy_switch(_RAIter __begin, _RAIter __last, - RandomAccessOutputIterator __out, _Predicate __pred, + _RandomAccessOutputIterator __out, _Predicate __pred, random_access_iterator_tag, random_access_iterator_tag) { if (_GLIBCXX_PARALLEL_CONDITION( diff --git a/libstdc++-v3/include/parallel/multiway_merge.h b/libstdc++-v3/include/parallel/multiway_merge.h index 6bdf08b4704..c5f85881ace 100644 --- a/libstdc++-v3/include/parallel/multiway_merge.h +++ b/libstdc++-v3/include/parallel/multiway_merge.h @@ -232,7 +232,7 @@ namespace __gnu_parallel * * @return End iterator of output sequence. */ - template class iterator, + template class iterator, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, @@ -351,7 +351,7 @@ namespace __gnu_parallel * * @return End iterator of output sequence. */ - template class iterator, + template class iterator, typename _RAIterIterator, typename _RAIter3, typename _DifferenceTp, @@ -641,8 +641,8 @@ namespace __gnu_parallel /** @brief Multi-way merging procedure for a high branching factor, * requiring sentinels to exist. * - * @tparam UnguardedLoserTree _Loser Tree variant to use for the unguarded - * merging. + * @tparam _UnguardedLoserTree Loser Tree variant to use for the unguarded + * merging. * * @param __seqs_begin Begin iterator of iterator pair input sequence. * @param __seqs_end End iterator of iterator pair input sequence. @@ -653,7 +653,7 @@ namespace __gnu_parallel * * @return End iterator of output sequence. */ - template + __target_end = multiway_merge_loser_tree_unguarded<_UnguardedLoserTree> (__seqs_begin, __seqs_end, __target, __sentinel, __length, __comp); #if _GLIBCXX_PARALLEL_ASSERTIONS diff --git a/libstdc++-v3/include/parallel/multiway_mergesort.h b/libstdc++-v3/include/parallel/multiway_mergesort.h index d39fc9abc19..d382a2c92f6 100644 --- a/libstdc++-v3/include/parallel/multiway_mergesort.h +++ b/libstdc++-v3/include/parallel/multiway_mergesort.h @@ -264,19 +264,19 @@ namespace __gnu_parallel { __gnu_sequential::sort(__begin, __end, __comp); } }; - template + typename _DiffType> struct __possibly_stable_multiway_merge { }; - template - struct __possibly_stable_multiway_merge { - void operator()(const Seq_RAIter& __seqs_begin, - const Seq_RAIter& __seqs_end, + void operator()(const _Seq_RAIter& __seqs_begin, + const _Seq_RAIter& __seqs_end, const _RAIter& __target, _Compare& __comp, _DiffType __length_am) const @@ -284,13 +284,13 @@ namespace __gnu_parallel __length_am, __comp, sequential_tag()); } }; - template - struct __possibly_stable_multiway_merge { - void operator()(const Seq_RAIter& __seqs_begin, - const Seq_RAIter& __seqs_end, + void operator()(const _Seq_RAIter& __seqs_begin, + const _Seq_RAIter& __seqs_end, const _RAIter& __target, _Compare& __comp, _DiffType __length_am) const diff --git a/libstdc++-v3/include/parallel/numericfwd.h b/libstdc++-v3/include/parallel/numericfwd.h index a9b8a2b1ea6..a1b1dc7571b 100644 --- a/libstdc++-v3/include/parallel/numericfwd.h +++ b/libstdc++-v3/include/parallel/numericfwd.h @@ -149,17 +149,17 @@ namespace __parallel _BinaryFunction2, __gnu_parallel::sequential_tag); template + typename _BinaryFunction1, typename _BinaryFunction2> _Tp - inner_product(_IIter1, _IIter1, _IIter2, _Tp, BinaryFunction1, - BinaryFunction2, __gnu_parallel::_Parallelism); + inner_product(_IIter1, _IIter1, _IIter2, _Tp, _BinaryFunction1, + _BinaryFunction2, __gnu_parallel::_Parallelism); template + typename _BinaryFunction1, typename _BinaryFunction2> _Tp - __inner_product_switch(_RAIter1, _RAIter1, _RAIter2, _Tp, BinaryFunction1, - BinaryFunction2, random_access_iterator_tag, - random_access_iterator_tag, + __inner_product_switch(_RAIter1, _RAIter1, _RAIter2, _Tp, _BinaryFunction1, + _BinaryFunction2, random_access_iterator_tag, + random_access_iterator_tag, __gnu_parallel::_Parallelism = __gnu_parallel::parallel_unbalanced); diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc index 66c639ff3a3..cab25498043 100644 --- a/libstdc++-v3/testsuite/17_intro/names.cc +++ b/libstdc++-v3/testsuite/17_intro/names.cc @@ -113,6 +113,7 @@ #define BidirectionalIterator BidirectionalIterator is not a reserved name #define RandomAccessIterator RandomAccessIterator is not a reserved name #define RandomAccessOutputIterator RandomAccessOutputIterator is not a reserved name +#define RAI RAI is not a reserved name #define RAIter RAIter is not a reserved name #define FwdIter FwdIter is not a reserved name #define OutIter OutIter is not a reserved name -- 2.30.2