Skip to content

[NFC] Get rid of -Wrange-loop-analysis warnings. #31324

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

Merged

Conversation

varungandhi-apple
Copy link
Contributor

Keep seeing annoying warnings like

[979/1334][ 73%][66.143s] Building CXX object lib/AST/CMakeFiles/swiftAST.dir/Decl.cpp.o
/Users/varun/foss-swift/swift/lib/AST/Decl.cpp:1831:21: warning: loop variable 'elt' of type 'const swift::TupleTypeReprElement' creates a copy from type 'const swift::TupleTypeReprElement' [-Wrange-loop-analysis]
    for (const auto elt : tuple->getElements()) {
                    ^
/Users/varun/foss-swift/swift/lib/AST/Decl.cpp:1831:10: note: use reference type 'const swift::TupleTypeReprElement &' to prevent copying
    for (const auto elt : tuple->getElements()) {
         ^~~~~~~~~~~~~~~~
                    &

Stop it.

@varungandhi-apple

This comment has been minimized.

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please test source compatibility

@varungandhi-apple
Copy link
Contributor Author

@swift-ci please test

@swift-ci

This comment has been minimized.

@swift-ci

This comment has been minimized.

@varungandhi-apple varungandhi-apple merged commit 6557794 into swiftlang:master Apr 27, 2020
@varungandhi-apple varungandhi-apple deleted the vg-bye-bye-warnings branch April 27, 2020 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants