Opened 6 years ago

Closed 4 years ago

#70 closed defect (invalid)

resolver problesm

Reported by: pabuhr Owned by: Rob
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

Selects wrong routine to call.

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(); // correctly calls foo1
    int & j = foo(); // correctly calls foo2

    i = foo();  // correctly calls foo1
    &j = foo();  // incorrectly calls foo1 instead of foo2
}
@plg2[1]% a.out
foo1
foo2
foo1
foo1

Change History (2)

comment:1 Changed 6 years ago by Thierry Delisle

Line int * i = foo(); // correctly calls foo1 is now ambiguous

comment:2 Changed 4 years ago by Thierry Delisle

Resolution: invalid
Status: assignedclosed

This ticket has changed from the original and now has 2 different problems. I'm converting it to 2 new tickets #194 and #195

Note: See TracTickets for help on using tickets.