mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 07:34:28 +02:00
* always call procvars inside varargs in TP/Delphi mode (mantis #15446)
git-svn-id: trunk@14527 -
This commit is contained in:
parent
7672c08d2f
commit
b4c572483b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10166,6 +10166,7 @@ tests/webtbs/tw15377.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw1539.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15391.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15415.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15446.pp svneol=native#text/plain
|
||||
tests/webtbs/tw15453a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1567.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1573.pp svneol=native#text/plain
|
||||
|
@ -562,6 +562,10 @@ implementation
|
||||
|
||||
procedure insert_varargstypeconv(var p : tnode; iscvarargs: boolean);
|
||||
begin
|
||||
{ procvars without arguments in variant arrays are always called by
|
||||
Delphi }
|
||||
if not(iscvarargs) then
|
||||
maybe_call_procvar(p,true);
|
||||
if not(iscvarargs) and
|
||||
(p.nodetype=stringconstn) then
|
||||
p:=ctypeconvnode.create_internal(p,cansistringtype)
|
||||
|
26
tests/webtbs/tw15446.pp
Normal file
26
tests/webtbs/tw15446.pp
Normal file
@ -0,0 +1,26 @@
|
||||
program varfunc_test;
|
||||
|
||||
{$IFDEF FPC}
|
||||
{$mode Delphi}
|
||||
{$ELSE}
|
||||
{$APPTYPE CONSOLE}
|
||||
{$ENDIF}
|
||||
{$H+}
|
||||
|
||||
uses sysutils;
|
||||
|
||||
function TestFunc1 : Longint;
|
||||
begin
|
||||
Result := 100;
|
||||
end;
|
||||
|
||||
Type Tfunc1 = function : Longint;
|
||||
var
|
||||
TestFunc2 : Tfunc1 = TestFunc1;
|
||||
|
||||
begin
|
||||
writeln({$IFDEF FPC}'FPC'{$ELSE}'Delphi'{$ENDIF});
|
||||
|
||||
writeln( Format('%d',[TestFunc1]) );
|
||||
writeln( Format('%d',[TestFunc2]) );
|
||||
end.
|
Loading…
Reference in New Issue
Block a user