Fix uses of non-uglified 'Args' and 'args' in a header. Also add checks
for some other non-reserved names that occur in upstream PSTL sources.
libstdc++-v3/ChangeLog:
* include/pstl/parallel_backend_tbb.h (class __root_task):
Rename _Args and args to use reserved names.
* testsuite/17_intro/names.cc: Check for more non-reserved
names.
---
Tested x86_64-linux.
Even though I'm about to replace all the PSTL code with a new version
from upstream, I've pushed this to trunk so that it can be backported to
the branches.
libstdc++-v3/include/pstl/parallel_backend_tbb.h | 12 ++++++------
libstdc++-v3/testsuite/17_intro/names.cc | 11 +++++++++++
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/libstdc++-v3/include/pstl/parallel_backend_tbb.h
b/libstdc++-v3/include/pstl/parallel_backend_tbb.h
index 00a8b9fb635c..0e342842417a 100644
--- a/libstdc++-v3/include/pstl/parallel_backend_tbb.h
+++ b/libstdc++-v3/include/pstl/parallel_backend_tbb.h
@@ -511,9 +511,9 @@ class __root_task
tbb::task* _M_task;
public:
- template <typename... Args>
- __root_task(Args&&... args)
- : _M_task{new (tbb::task::allocate_root())
__func_task<_Func>{_Func(std::forward<Args>(args)...)}}
+ template <typename... _Args>
+ __root_task(_Args&&... __args)
+ : _M_task{new (tbb::task::allocate_root())
__func_task<_Func>{_Func(std::forward<_Args>(__args)...)}}
{
}
@@ -709,11 +709,11 @@ class __root_task : public __task
tbb::task_group_context _M_context{};
public:
- template <typename... Args>
- __root_task(Args&&... args) : _M_wait_object{1}
+ template <typename... _Args>
+ __root_task(_Args&&... __args) : _M_wait_object{1}
{
tbb::detail::d1::small_object_allocator __alloc{};
- _M_func_task =
__alloc.new_object<__func_task<_Func>>(_Func(std::forward<Args>(args)...));
+ _M_func_task =
__alloc.new_object<__func_task<_Func>>(_Func(std::forward<_Args>(__args)...));
_M_func_task->_M_allocator = __alloc;
_M_func_task->_M_parent = this;
_M_refcount.store(1, std::memory_order_relaxed);
diff --git a/libstdc++-v3/testsuite/17_intro/names.cc
b/libstdc++-v3/testsuite/17_intro/names.cc
index c6fe81c5325d..712e38e0f8b7 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -129,6 +129,9 @@
#define token (
#define value_t (
+#define maximum {
+#define minimum {
+
#if __cplusplus < 201103L
#define mutex (
#define uses_allocator (
@@ -137,6 +140,8 @@
#if __cplusplus < 201402L
// <complex> defines operator""il
#define il (
+// <functional> defines std::less<>::is_transparent etc.
+#define is_transparent {
#endif
#if __cplusplus < 201703L
@@ -149,6 +154,8 @@
#if __cplusplus < 202002L
#define ranges (
+#define iterator_concept {
+#define identity {
#endif
// These clash with newlib so don't use them.
@@ -181,6 +188,7 @@
#define InIter InIter is not a reserved name
#define Alloc Alloc is not a reserved name
+#define Args Args is not a reserved name
#define BinaryFunction1 BinaryFunction1 is not a reserved name
#define BinaryFunction2 BinaryFunction2 is not a reserved name
#define BinaryOperation BinaryOperation is not a reserved name
@@ -225,6 +233,7 @@
#define Proj2 Proj2 is not a reserved name
#define Ptr Ptr is not a reserved name
#define Reference Reference is not a reserved name
+#define Rest Rest is not a reserved name
#define Rg Rg is not a reserved name
#define Rs Rs is not a reserved name
#define Seq Seq is not a reserved name
@@ -234,9 +243,11 @@
#define Size Size is not a reserved name
#define String String is not a reserved name
#define Tp Tp is not a reserved name
+#define Ts Ts is not a reserved name
#define TQual TQual is not a reserved name
#define Traits Traits is not a reserved name
#define Type Type is not a reserved name
+#define Types Types is not a reserved name
#define UQual UQual is not a reserved name
#define Value Value is not a reserved name
#define ValueT ValueT is not a reserved name
--
2.56.1