We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8484584 commit f2e0397Copy full SHA for f2e0397
clang/lib/CodeGen/CodeGenModule.cpp
@@ -2368,9 +2368,8 @@ static QualType GeneralizeTransparentUnion(QualType Ty) {
2368
const RecordDecl *UD = UT->getDecl()->getDefinitionOrSelf();
2369
if (!UD->hasAttr<TransparentUnionAttr>())
2370
return Ty;
2371
- for (const auto *it : UD->fields()) {
2372
- return it->getType();
2373
- }
+ if (!UD->fields().empty())
+ return UD->fields().begin()->getType();
2374
2375
}
2376
0 commit comments