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
Remove warnings due to some captured variables #2575
Remove warnings due to some captured variables #2575
Conversation
@@ -32,7 +32,7 @@ void test_reduce1(ExPolicy policy, IteratorTag) | |||
std::vector<std::size_t> c(10007); | |||
std::iota(boost::begin(c), boost::end(c), std::rand()); | |||
|
|||
std::size_t const val(42); | |||
std::size_t val(42); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got this strange error from clang 5.0 although the variable is used inside the lambda : warning: lambda capture 'val' is not required to be captured for this use [-Wunused-lambda-capture]
@@ -55,7 +55,7 @@ void test_reduce1_async(ExPolicy p, IteratorTag) | |||
std::vector<std::size_t> c(10007); | |||
std::iota(boost::begin(c), boost::end(c), std::rand()); | |||
|
|||
std::size_t const val(42); | |||
std::size_t val(42); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue
@@ -79,7 +79,7 @@ void test_transform_reduce_async(ExPolicy p, IteratorTag) | |||
std::vector<std::size_t> c(10007); | |||
std::iota(boost::begin(c), boost::end(c), std::rand()); | |||
|
|||
std::size_t const val(42); | |||
std::size_t val(42); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue
397b55a
to
219279f
Compare
219279f
to
2687e9f
Compare
This patch tries to remove some warnings related to unused captured variables detected by Clang 5.0. Because most of those variables are copied via lambda capture for lifetime purpose, HPX_UNUSED() has been used. Also warnings are generated when local const variables are captured by value; some of those variables are then declared non-const in place of const.