Skip to content

NFC: silence some -Wrange-loop-analysis warnings. #32634

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
merged 1 commit into from
Jul 1, 2020

Conversation

dan-zheng
Copy link
Contributor

Silence warnings:

lib/AST/TypeWalker.cpp:42:21: warning: loop variable 'arg' of type 'const swift::Type' creates a copy from type 'const swift::Type' [-Wrange-loop-analysis]
    for (const auto arg : ty->getDirectGenericArgs())
                    ^
lib/AST/TypeWalker.cpp:42:10: note: use reference type 'const swift::Type &' to prevent copying
    for (const auto arg : ty->getDirectGenericArgs())
         ^~~~~~~~~~~~~~~~
                    &
1 warning generated.
lib/AST/ASTDumper.cpp:3527:23: warning: loop variable 'arg' of type 'const swift::Type' creates a copy from type 'const swift::Type' [-Wrange-loop-analysis]
      for (const auto arg : T->getDirectGenericArgs())
                      ^
lib/AST/ASTDumper.cpp:3527:12: note: use reference type 'const swift::Type &' to prevent copying
      for (const auto arg : T->getDirectGenericArgs())
           ^~~~~~~~~~~~~~~~
                      &
1 warning generated.

@dan-zheng dan-zheng requested a review from compnerd July 1, 2020 00:41
@dan-zheng
Copy link
Contributor Author

@swift-ci Please smoke test

@dan-zheng
Copy link
Contributor Author

I'll merge this now since I don't expect it to be controversial.

@dan-zheng dan-zheng merged commit 71dbe2b into swiftlang:master Jul 1, 2020
@dan-zheng dan-zheng deleted the silence-warnings branch July 1, 2020 03:40
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.

1 participant