summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-03-22 17:50:05 +0000
committerJustin Bogner <mail@justinbogner.com>2016-03-22 17:50:05 +0000
commit4d511909362fb5c8a8396453fe7e68fe8fa03296 (patch)
tree874484bbcfaf155078f0f5de2b15b93032f1d107
parentc2d21cb7635b72784e629083225666ab61b07e50 (diff)
downloadbcm5719-llvm-4d511909362fb5c8a8396453fe7e68fe8fa03296.tar.gz
bcm5719-llvm-4d511909362fb5c8a8396453fe7e68fe8fa03296.zip
StaticAnalyzer: Avoid an unintentional copy
The range here isn't over references, so using `auto &` here incites a copy. Switching to `auto *` would do, but we might as well list an explicit type for clarity. Found by -Wrange-loop-analysis. llvm-svn: 264071
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
index 05bb7b71b8a..0640d2f49f4 100644
--- a/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/PaddingChecker.cpp
@@ -168,7 +168,7 @@ public:
const ASTRecordLayout &RL) {
CharUnits PaddingSum;
CharUnits Offset = ASTContext.toCharUnitsFromBits(RL.getFieldOffset(0));
- for (const auto &FD : RD->fields()) {
+ for (const FieldDecl *FD : RD->fields()) {
// This checker only cares about the padded size of the
// field, and not the data size. If the field is a record
// with tail padding, then we won't put that number in our
OpenPOWER on IntegriCloud