Repository navigation
Commit deaedb0
Fix #15245 syntaxError on new[] with a braced initializer ending in a parenthesis
In the K&R parameter pass, simplifyVarDecl skips a parenthesised group
and steps past its `)`. When that `)` is the last token before tokEnd,
the step lands on tokEnd and the loop increment then steps past it, so
the loop runs to the end of the token list and raises a syntax error.
findLambdaEndScope takes `[2]{(1)}` in `new int[2]{(1)}` for a lambda,
which produces such a range.
Don't step onto tokEnd.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 7549fdd commit deaedb0
2 files changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7594 | 7594 | | |
7595 | 7595 | | |
7596 | 7596 | | |
7597 | | - | |
| 7597 | + | |
| 7598 | + | |
7598 | 7599 | | |
7599 | 7600 | | |
7600 | 7601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
245 | 246 | | |
246 | 247 | | |
247 | 248 | | |
| |||
3118 | 3119 | | |
3119 | 3120 | | |
3120 | 3121 | | |
| 3122 | + | |
| 3123 | + | |
| 3124 | + | |
| 3125 | + | |
| 3126 | + | |
3121 | 3127 | | |
3122 | 3128 | | |
3123 | 3129 | | |
| |||
0 commit comments