cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

[BUG] Moved statement parameter parsed as parameter list when accessed

Open JohelEGP opened this issue 2 years ago • 1 comments
trafficstars

Title: Moved statement parameter parsed as parameter list when accessed.

Minimal reproducer (https://cpp2.godbolt.org/z/6Y7f7eYG1):

main: (args) = {
  (copy x: args) {
    (move x).clear();
  }
}
Commands: `cppfront main.cpp2`

Expected result: Same as ((move x).clear());.

Actual result and error: error: (temporary alpha limitation) parameters scoped to a block/statement must be 'in' (the default), 'copy', or 'inout'.

JohelEGP avatar Nov 14 '23 15:11 JohelEGP

I think the issue might be that the context of the () isn't special, like in function parameter lists, initializer lists, or return statements.

JohelEGP avatar Nov 14 '23 19:11 JohelEGP