Opened 5 years ago

#156 new defect

Warning for "returning address of local variable" does not catch polymorphic functions

Reported by: Thierry Delisle Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

Given the following code

int & bad_copy(int & a) {
	int b = a;
	return b;
}

Cforall correctly warns that this is unsafe.

However, the warning is not printed in the following equivalent case.

forall(otype T)
T & bad_copy2(T & a) {
	T b = a;
	return b;
}

Change History (0)

Note: See TracTickets for help on using tickets.