mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 11:24:14 +02:00
* disallow using inline nodes with a non-void resultdef as statements
(e.g. length, lo/hi, ord, etc). Not the same as mantis #9918, but somewhat related git-svn-id: trunk@8770 -
This commit is contained in:
parent
775ee6f563
commit
c89ea4412f
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -7496,6 +7496,10 @@ tests/webtbf/tw9522e.pp svneol=native#text/plain
|
||||
tests/webtbf/tw9579a.pp svneol=native#text/plain
|
||||
tests/webtbf/tw9579b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw9894b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw9918a.pp svneol=native#text/plain
|
||||
tests/webtbf/tw9918b.pp svneol=native#text/plain
|
||||
tests/webtbf/tw9918c.pp svneol=native#text/plain
|
||||
tests/webtbf/tw9918d.pp svneol=native#text/plain
|
||||
tests/webtbf/uw0744.pp svneol=native#text/plain
|
||||
tests/webtbf/uw0840a.pp svneol=native#text/plain
|
||||
tests/webtbf/uw0840b.pp svneol=native#text/plain
|
||||
|
@ -1074,7 +1074,9 @@ implementation
|
||||
{ with a separate statement for each read/write operation (JM) }
|
||||
{ the same is true for val() if the third parameter is not 32 bit }
|
||||
if not(p.nodetype in [nothingn,calln,ifn,assignn,breakn,inlinen,
|
||||
continuen,labeln,blockn,exitn]) then
|
||||
continuen,labeln,blockn,exitn]) or
|
||||
((p.nodetype=inlinen) and
|
||||
not is_void(p.resultdef)) then
|
||||
Message(parser_e_illegal_expression);
|
||||
|
||||
{ Specify that we don't use the value returned by the call.
|
||||
|
9
tests/webtbf/tw9918a.pp
Normal file
9
tests/webtbf/tw9918a.pp
Normal file
@ -0,0 +1,9 @@
|
||||
{ %fail }
|
||||
|
||||
{$x-}
|
||||
|
||||
var
|
||||
a: array of byte;
|
||||
begin
|
||||
length(a);
|
||||
end.
|
9
tests/webtbf/tw9918b.pp
Normal file
9
tests/webtbf/tw9918b.pp
Normal file
@ -0,0 +1,9 @@
|
||||
{ %fail }
|
||||
|
||||
{$x+}
|
||||
|
||||
var
|
||||
s: shortstring;
|
||||
begin
|
||||
length(s);
|
||||
end.
|
9
tests/webtbf/tw9918c.pp
Normal file
9
tests/webtbf/tw9918c.pp
Normal file
@ -0,0 +1,9 @@
|
||||
{ %fail }
|
||||
|
||||
{$x+}
|
||||
|
||||
var
|
||||
l: longint;
|
||||
begin
|
||||
lo(l);
|
||||
end.
|
9
tests/webtbf/tw9918d.pp
Normal file
9
tests/webtbf/tw9918d.pp
Normal file
@ -0,0 +1,9 @@
|
||||
{ %fail }
|
||||
|
||||
{$x+}
|
||||
|
||||
var
|
||||
d: double;
|
||||
begin
|
||||
trunc(d);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user