Skip to content

Commit fb30e9e

Browse files
committed
[MSVC] Evaluate parameters in the right order.
Parameter evaluation order is unspecified, and MSVC happens to do it in the opposite order than Clang. Move the evaluation of the parameters outside the invocation, so the order is clear, and the token consuming happens in the right order.
1 parent 4062012 commit fb30e9e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Parse/ParseExpr.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2483,8 +2483,9 @@ parseClosureSignatureIfPresent(SourceRange &bracketRange,
24832483

24842484
SyntaxParsingContext CaptureCtx(SyntaxContext,
24852485
SyntaxKind::ClosureCaptureSignature);
2486-
bracketRange = SourceRange(consumeToken(tok::l_square),
2487-
consumeToken(tok::r_square));
2486+
SourceLoc lBracketLoc = consumeToken(tok::l_square);
2487+
SourceLoc rBracketLoc = consumeToken(tok::r_square);
2488+
bracketRange = SourceRange(lBracketLoc, rBracketLoc);
24882489
} else if (Tok.is(tok::l_square) && !peekToken().is(tok::r_square)) {
24892490
SyntaxParsingContext CaptureCtx(SyntaxContext,
24902491
SyntaxKind::ClosureCaptureSignature);

0 commit comments

Comments
 (0)