Skip to content

Commit f2e0397

Browse files
committed
[𝘀𝗽𝗿] initial version
Created using spr 1.3.7
1 parent 8484584 commit f2e0397

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2368,9 +2368,8 @@ static QualType GeneralizeTransparentUnion(QualType Ty) {
23682368
const RecordDecl *UD = UT->getDecl()->getDefinitionOrSelf();
23692369
if (!UD->hasAttr<TransparentUnionAttr>())
23702370
return Ty;
2371-
for (const auto *it : UD->fields()) {
2372-
return it->getType();
2373-
}
2371+
if (!UD->fields().empty())
2372+
return UD->fields().begin()->getType();
23742373
return Ty;
23752374
}
23762375

0 commit comments

Comments
 (0)