File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -7162,13 +7162,11 @@ static bool CheckNonNullExpr(Sema &S, const Expr *Expr) {
71627162
71637163 // As a special case, transparent unions initialized with zero are
71647164 // considered null for the purposes of the nonnull attribute.
7165- if (const RecordType *UT = Expr->getType()->getAsUnionType()) {
7166- if (UT->getDecl()->hasAttr<TransparentUnionAttr>())
7167- if (const CompoundLiteralExpr *CLE =
7168- dyn_cast<CompoundLiteralExpr>(Expr))
7169- if (const InitListExpr *ILE =
7170- dyn_cast<InitListExpr>(CLE->getInitializer()))
7171- Expr = ILE->getInit(0);
7165+ if (const RecordType *UT = Expr->getType()->getAsUnionType();
7166+ UT && UT->getDecl()->hasAttr<TransparentUnionAttr>()) {
7167+ if (const auto *CLE = dyn_cast<CompoundLiteralExpr>(Expr))
7168+ if (const auto *ILE = dyn_cast<InitListExpr>(CLE->getInitializer()))
7169+ Expr = ILE->getInit(0);
71727170 }
71737171
71747172 bool Result;
You can’t perform that action at this time.
0 commit comments