﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
306	Waituntil relies on RAII-unsound rvalue-to-reference conversion	mlbrooks	lseo	"Waituntil uses rvalue-to-reference conversion, probably without realizing it.  Types that underlie its implementation should be free to use advanced RAII, which does not support (#305) waituntil's rvalue-to-reference conversion case.

A desired linked-list implementation change (not yet in master) causes the return value of `timeout` to need RAII that present state rvalue-to-reference promotion does not provide.

{{{
#include <concurrency/select.hfa>

int main() {
    waituntil( timeout( 1`ns ) ) {}
    return 0;
}
}}}

Actual, master: Runs and exits normally

Actual, with desired linked-list change: runtime crash with assertion failure about dlist precondition not met

Expected, with desired linked-list change: Runs and exits normally

Inspecting intermediate code (at master), `cfa demo.cfa -CFA -XCFA,-p,-Pbresolver` shows (manually pieced together):

{{{
typeof(__CFA_select_get_type(timeout(__postfix_func_ns(1)))) & __clause_target_0 =
    timeout(__postfix_func_ns(1));
}}}

Note `__clause_target_0` is declared here as a reference, while `timeout` (from select.hfa) has returns `select_timeout_node` by value.  This is the case of #305.
"	defect	closed	major	libcfa	1.0	fixed	waituntil raii rvalue reference dlist	
