Skip to content

Commit ab9d029

Browse files
committed
[parser] points to start of raw value and complain
1 parent 3f96a20 commit ab9d029

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4390,6 +4390,7 @@ ParserStatus Parser::parseDeclEnumCase(ParseDeclOptions Flags,
43904390

43914391
// See if there's a raw value expression.
43924392
SourceLoc EqualsLoc;
4393+
auto NextLoc = peekToken().getLoc();
43934394
ParserResult<Expr> RawValueExpr;
43944395
LiteralExpr *LiteralRawValueExpr = nullptr;
43954396
if (Tok.is(tok::equal)) {
@@ -4404,7 +4405,7 @@ ParserStatus Parser::parseDeclEnumCase(ParseDeclOptions Flags,
44044405
return Status;
44054406
}
44064407
if (RawValueExpr.isNull()) {
4407-
diagnose(EqualsLoc, diag::not_a_proper_raw_value_expression);
4408+
diagnose(NextLoc, diag::not_a_proper_raw_value_expression);
44084409
Status.setIsParseError();
44094410
return Status;
44104411
}

0 commit comments

Comments
 (0)