aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--clang/lib/Sema/SemaChecking.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 12a8894..5a4fa97 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -14731,9 +14731,8 @@ static bool isLayoutCompatibleStruct(const ASTContext &C, const RecordDecl *RD1,
/// (C++11 [class.mem] p18)
static bool isLayoutCompatibleUnion(const ASTContext &C, const RecordDecl *RD1,
const RecordDecl *RD2) {
- llvm::SmallPtrSet<const FieldDecl *, 8> UnmatchedFields;
- for (auto *Field2 : RD2->fields())
- UnmatchedFields.insert(Field2);
+ llvm::SmallPtrSet<const FieldDecl *, 8> UnmatchedFields(llvm::from_range,
+ RD2->fields());
for (auto *Field1 : RD1->fields()) {
auto I = UnmatchedFields.begin();