Skip to content

Commit c622722

Browse files
committed
[CSRanking] Handle EnumElementDecl in IUO parameter checking
1 parent ee0538c commit c622722

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/CSRanking.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ static bool paramIsIUO(Decl *decl, int paramNum) {
372372
auto *param = paramList->get(paramNum);
373373
return param->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>();
374374
}
375+
if (auto *ee = dyn_cast<EnumElementDecl>(decl)) {
376+
auto *param = ee->getParameterList()->get(paramNum);
377+
return param->getAttrs().hasAttribute<ImplicitlyUnwrappedOptionalAttr>();
378+
}
375379

376380
auto *subscript = cast<SubscriptDecl>(decl);
377381
auto *index = subscript->getIndices()->get(paramNum);

0 commit comments

Comments
 (0)