Skip to content
Snippets Groups Projects
Commit 9872ddf4 authored by Justin Bogner's avatar Justin Bogner
Browse files

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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264071 91177308-0d34-0410-b5e6-96231b3b80d8
parent 1296e32d
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,7 @@ public: ...@@ -168,7 +168,7 @@ public:
const ASTRecordLayout &RL) { const ASTRecordLayout &RL) {
CharUnits PaddingSum; CharUnits PaddingSum;
CharUnits Offset = ASTContext.toCharUnitsFromBits(RL.getFieldOffset(0)); 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 // This checker only cares about the padded size of the
// field, and not the data size. If the field is a record // field, and not the data size. If the field is a record
// with tail padding, then we won't put that number in our // with tail padding, then we won't put that number in our
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment