Remove warnings due to some captured variables#2575
Merged
hkaiser merged 2 commits intoApr 1, 2017
Conversation
hkaiser
requested changes
Mar 31, 2017
| std::iota(boost::begin(c), boost::end(c), std::rand()); | ||
|
|
||
| std::size_t const val(42); | ||
| std::size_t val(42); |
Contributor
There was a problem hiding this comment.
What's the rationale of this change?
Author
There was a problem hiding this comment.
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]
| std::iota(boost::begin(c), boost::end(c), std::rand()); | ||
|
|
||
| std::size_t const val(42); | ||
| std::size_t val(42); |
Contributor
There was a problem hiding this comment.
What's the rationale of this change?
| std::iota(boost::begin(c), boost::end(c), std::rand()); | ||
|
|
||
| std::size_t const val(42); | ||
| std::size_t val(42); |
Contributor
There was a problem hiding this comment.
What's the rationale of this change?
hkaiser
approved these changes
Mar 31, 2017
397b55a to
219279f
Compare
219279f to
2687e9f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.