LoopingControl: use auto instead of auto* for iterator#4379
Merged
daschuer merged 1 commit intomixxxdj:mainfrom Oct 12, 2021
Merged
LoopingControl: use auto instead of auto* for iterator#4379daschuer merged 1 commit intomixxxdj:mainfrom
daschuer merged 1 commit intomixxxdj:mainfrom
Conversation
daschuer
requested changes
Oct 12, 2021
Member
daschuer
left a comment
There was a problem hiding this comment.
Now clang-tidy is complaining:
src/engine/controls/loopingcontrol.cpp#L1127
'auto i' can be declared as 'auto *i' [readability-qualified-auto]
Contributor
Author
|
clang-tidy needs to be ignored in this case. QStack inherits from QVector in Qt5 and QVector::iterator is a typedef for |
Member
|
I think we need to introduce an ifdef here then. |
ed4e068 to
aeaf906
Compare
Contributor
Author
|
Using QStack::iterator explicitly instead of auto works too. |
uklotzde
suggested changes
Oct 12, 2021
aeaf906 to
d8abb25
Compare
QStack inherits from QVector in Qt5 so QStack::iterator is a pointer type which clang-tidy wants to be auto*. But in Qt6, QStack inherits from QList so QStack::iterator is not a pointer type and clang-tidy wants to use auto. Resolve this by using the QStack::iterator type explicitly.
d8abb25 to
60d5afc
Compare
uklotzde
approved these changes
Oct 12, 2021
Contributor
Author
|
Merge? |
Contributor
|
Waiting for @daschuer to formally approve the changes according to our rules. |
daschuer
approved these changes
Oct 12, 2021
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.
I don't know how auto* worked before considering the iterator
is not a pointer type, but it doesn't work in Qt6.