* always call procvars inside varargs in TP/Delphi mode (mantis #15446)

git-svn-id: trunk@14527 -
This commit is contained in:
Jonas Maebe 2010-01-02 21:43:19 +00:00
parent 7672c08d2f
commit b4c572483b
3 changed files with 31 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.