]> granicus.if.org Git - clang/commit
Add new warning -Wrange-loop-analysis to warn on copies during loops.
authorRichard Trieu <rtrieu@google.com>
Mon, 13 Apr 2015 22:08:55 +0000 (22:08 +0000)
committerRichard Trieu <rtrieu@google.com>
Mon, 13 Apr 2015 22:08:55 +0000 (22:08 +0000)
commitda53a423d61b4f3822e60ce510826ec0c0a8faf4
tree019f9be30e6d29ca560a61570a9232215baff462
parent804f40bf60ab4aa4f3d2a74b2850b0c0d8ccb66b
Add new warning -Wrange-loop-analysis to warn on copies during loops.

-Wrange-loop-analysis is a subgroup of -Wloop-analysis and will warn when
a range-based for-loop makes copies of the elements in the range.  If possible,
suggest the proper type to prevent copies, or the non-reference to help
distinguish copy versus non-copy forms.  Existing warnings in -Wloop-analysis
are moved to -Wfor-loop-analysis, also a subgroup of -Wloop-analysis.

Differential Revision: http://reviews.llvm.org/D4169

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@234804 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaStmt.cpp
test/SemaCXX/warn-range-loop-analysis.cpp [new file with mode: 0644]