Opened 7 years ago

Last modified 4 years ago

#5 assigned defect

Undeclared variable with MRV/tuple function composition

Reported by: Rob Schluntz Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords: tuple unique expression temporary
Cc:

Description

When calling a function taking multiple tuple arguments using a function argument returning multiple values, codegen puts a temporary in the wrong place. E.g.,

[int, int] bar() { return [3, 4]; }
[void] foo([int] x, [int] y) {}

int main() {
  foo(bar());
}

The _unq_finished variable is inserted into the statement expression generated as part of the tuple constructor for x, but needs to be accessible in y's constructor as well.

Change History (1)

comment:1 Changed 4 years ago by Thierry Delisle

Owner: Rob Schluntz deleted
Note: See TracTickets for help on using tickets.