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
This commit is contained in:
Justin Bogner 2016-03-22 17:50:05 +00:00
parent c2d21cb763
commit 4d51190936
1 changed files with 1 additions and 1 deletions

View File

@ -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