Improve Wrange-loop-analyses for rvalue reference
authorMark de Wever <koraq@xs4all.nl>
Wed, 1 Jan 2020 16:23:20 +0000 (17:23 +0100)
committerMark de Wever <koraq@xs4all.nl>
Wed, 1 Jan 2020 19:02:18 +0000 (20:02 +0100)
commite5ab1e49f958cd8388bab617819ba78167e557d3
tree72294366f36eede9f7c75016c636bac63b44805a
parentf022a5a792fd39a4c33f49583d24d96c70177066
Improve Wrange-loop-analyses for rvalue reference

The Wrange-loop-analyses warns if a copy is made. Suppress this warning when
a temporary is bound to a rvalue reference.

While fixing this issue also found a copy-paste error in test6, which is also
fixed.

Differential Revision: https://reviews.llvm.org/D71806
clang/lib/Sema/SemaStmt.cpp
clang/test/SemaCXX/warn-range-loop-analysis.cpp