fpc/tests/tbf/tb0258.pp
Jonas Maebe 3129605195 --- Merging r40180 into '.':
U    compiler/ninl.pas
--- Recording mergeinfo for merge of r40180 into '.':
 U   .
--- Merging r40216 into '.':
U    compiler/htypechk.pas
G    compiler/ninl.pas
U    tests/tbf/tb0258.pp
A    tests/tbf/tb0259.pp
A    tests/tbf/tb0260.pp
A    tests/tbs/tb0653.pp
--- Recording mergeinfo for merge of r40216 into '.':
 G   .
--- Merging r40217 into '.':
U    compiler/systems/t_bsd.pas
--- Recording mergeinfo for merge of r40217 into '.':
 G   .
--- Merging r40218 into '.':
G    compiler/systems/t_bsd.pas
--- Recording mergeinfo for merge of r40218 into '.':
 G   .

git-svn-id: branches/fixes_3_2@44000 -
2020-01-19 19:20:31 +00:00

27 lines
602 B
ObjectPascal

{ %fail% }
{ %opt=-Sew -vw -O- }
{
Test for correct emitting of warnings/hints for uninitialized variables of management types
See also tbs/tb0653.pp, tbf/tb0259.pp, tbf/tb0260.pp
}
// This code must issue warnings "Function result variable of a managed type does not seem to be initialized".
{$mode objfpc}
type
TLongArray = array of longint;
function f: TLongArray;
begin
// Warning for the dyn array Result, since contents of the Result after calling SetLength()
// is expected to be zeroed, but instead it is undefined.
setlength(Result,100);
Result[2]:=1;
end;
begin
f;
end.