Opened 8 years ago

Last modified 6 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 by Thierry Delisle, 6 years ago

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