Skip to content

Commit 382fcd7

Browse files
committed
[Sema] Remove some dead code
The parser should ensure that we never encounter this case.
1 parent b7320cd commit 382fcd7

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,13 +1505,10 @@ OperatorPrecedenceGroupRequest::evaluate(Evaluator &evaluator,
15051505
}
15061506
}
15071507

1508-
if (!identifiers.empty() && !enableOperatorDesignatedTypes) {
1509-
assert(!group);
1510-
Diags.diagnose(identifiers[0].Loc, diag::unknown_precedence_group,
1511-
identifiers[0].Item);
1512-
identifiers = identifiers.slice(1);
1513-
assert(identifiers.empty());
1514-
}
1508+
// Unless operator designed types are enabled, the parser will ensure that
1509+
// only one identifier is allowed in the clause, which we should have just
1510+
// handled.
1511+
assert(identifiers.empty() || enableOperatorDesignatedTypes);
15151512

15161513
if (!group) {
15171514
group = TypeChecker::lookupPrecedenceGroup(dc, ctx.Id_DefaultPrecedence,

0 commit comments

Comments
 (0)