fpc/tests/tbf/tb0215.pp
Jonas Maebe b3aa2ab759 + new test which should fail but doesn't yet (it should not be possible to
use a char typecasted as a chararray with more than one element as an
    lvalue)

git-svn-id: trunk@12708 -
2009-02-07 22:20:47 +00:00

21 lines
239 B
ObjectPascal

{ %fail }
{$r-}
type
chararray = array[0..200] of char;
var
p: pchar;
i: longint;
begin
getmem(p,5);
p[0]:='a';
p[1]:='b';
p[2]:='c';
p[3]:='d';
p[4]:=#0;
i:=3;
chararray(p^)[i]:=#0;
writeln(p);
freemem(p);
end.