Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-reserved names in pstl/execution_impl.h #46945

Closed
jwakely mannequin opened this issue Sep 21, 2020 · 4 comments
Closed

Non-reserved names in pstl/execution_impl.h #46945

jwakely mannequin opened this issue Sep 21, 2020 · 4 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla pstl Issues related to the C++17 Parallel STL

Comments

@jwakely
Copy link
Mannequin

jwakely mannequin commented Sep 21, 2020

Bugzilla Link 47601
Resolution FIXED
Resolved on Mar 03, 2021 08:38
Version unspecified
OS All
Fixed by commit(s) 053146a

Extended Description

The members of __internal::__policy_traits aren't using reserved names:

template <>
struct __policy_traits<sequenced_policy>
{
typedef std::false_type allow_parallel;
typedef std::false_type allow_unsequenced;
typedef std::false_type allow_vector;
};

This means the alias templates following it are broken:

template
using __collector_t =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__collector_type;

This is invalid, because __collector_type doesn't exist, the member is really called collector_type (although it shouldn't be).

And later in that file:

template <typename policy, typename... _IteratorTypes>
struct __prefer_unsequenced_tag

and

template <typename policy, typename... _IteratorTypes>
struct __prefer_parallel_tag

These use "policy" which is not a reserved name either.

@jwakely
Copy link
Mannequin Author

jwakely mannequin commented Sep 21, 2020

assigned to @ldionne

@jwakely
Copy link
Mannequin Author

jwakely mannequin commented Sep 21, 2020

template
using __collector_t =
typename __internal::__policy_traits<typename
std::decay<_ExecutionPolicy>::type>::__collector_type;

N.B. collector_t alias appears to be completely unused, and no specialization of __policy_traits defines __collector_type. So ignore that one, but the same problem exists for:

template
using __allow_vector =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_vector;

template
using __allow_unsequenced =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_unsequenced;

template
using __allow_parallel =
typename __internal::__policy_traits<typename std::decay<_ExecutionPolicy>::type>::__allow_parallel;

These also aren't used, and refer to non-existent members, but they could be used (if they were fixed), see Bug 47602.

@ldionne
Copy link
Member

ldionne commented Mar 2, 2021

Up for review in https://reviews.llvm.org/D97808

@ldionne
Copy link
Member

ldionne commented Mar 3, 2021

commit 053146a
Author: Louis Dionne ldionne.2@gmail.com
Date: Tue Mar 2 16:53:07 2021 -0500

[pstl] Fix broken policy_traits and clean up unused code

llvm/llvm-bugzilla-archive#47602 
llvm/llvm-project#46945 

Differential Revision: https://reviews.llvm.org/D97808

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla pstl Issues related to the C++17 Parallel STL
Projects
None yet
Development

No branches or pull requests

1 participant