Skip to content

Conversation

@NEIL-smtg
Copy link

Creating this PR in response to #123

In C++23, the grammar for subscript-expressions was updated to accept an expression-list, which causes the top-level comma (,) to be treated as a separator rather than part of a single expression. This leads to parsing issues when using comma expressions directly inside subscript operators.

To address this, affected expressions have been wrapped in parentheses to ensure the intended evaluation order is preserved and to maintain compatibility with C++23 and beyond.

Example fix:

// Before (invalid in C++23):
while_(arg1--)
[
    cout << arg1 << ", ",
    ++ref(x)
]

// After (valid in C++23):
while_(arg1--)
[
    (cout << arg1 << ", ", ++ref(x))
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant