From f2e03972be9d0680884070393809654f5440d053 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 4 Nov 2025 23:19:34 -0800 Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?= =?UTF-8?q?l=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Created using spr 1.3.7 --- clang/lib/CodeGen/CodeGenModule.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 0fea57b2e1799..98d59b79ab881 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2368,9 +2368,8 @@ static QualType GeneralizeTransparentUnion(QualType Ty) { const RecordDecl *UD = UT->getDecl()->getDefinitionOrSelf(); if (!UD->hasAttr()) return Ty; - for (const auto *it : UD->fields()) { - return it->getType(); - } + if (!UD->fields().empty()) + return UD->fields().begin()->getType(); return Ty; }