﻿id	summary	reporter	owner	description	type	status	priority	component	version	resolution	keywords	cc
194	Ambiguous reference vs pointer return [from ticket #70]	Thierry Delisle		"{{{
forall( dtype T | sized(T) ) T * foo( void ) {
	printf( ""foo1\n"" );
	return (T *)0;
}
forall( dtype T | sized(T) ) T & foo( void ) {
	printf( ""foo2\n"" );
	return (T &)*(T *)0;
}
int main( void ) {
    int * i = foo();
}
}}}

This should not be ambiguous, one side is an exact match.
This must be either unambiguous or an error to define both

The reported ambiguity is between:

foo1 with T as int  (return is T*, which is int*, assigned into int* variable)

foo2 with T as int* (return is T&, which is int*&, assigned into int* variable)

The reported cost is ( 0, 0, 0, 0, 1, 0, 0 ).  It is surprising that the second case, which we wish to reject, has a zero reference-cost element (last position).  It seems that assignment from X& to X should count one change of reference level.
"	defect	new	major	cfa-cc	1.0			
