* force static; being repeated in the procedure body, this avoids trouble as in #12242

+ add static when using fullprocname

git-svn-id: trunk@11835 -
This commit is contained in:
florian 2008-09-28 18:45:37 +00:00
parent 20a8aced3c
commit 8c9baed5cb
4 changed files with 35 additions and 2 deletions

1
.gitattributes vendored
View File

@ -8564,6 +8564,7 @@ tests/webtbs/tw1222.pp svneol=native#text/plain
tests/webtbs/tw12224.pp svneol=native#text/plain
tests/webtbs/tw1223.pp svneol=native#text/plain
tests/webtbs/tw12233.pp svneol=native#text/plain
tests/webtbs/tw12242.pp svneol=native#text/plain
tests/webtbs/tw1228.pp svneol=native#text/plain
tests/webtbs/tw1229.pp svneol=native#text/plain
tests/webtbs/tw1250.pp svneol=native#text/plain

View File

@ -1920,7 +1920,7 @@ const
mutexclpo : []
),(
idtok:_STATIC;
pd_flags : [pd_interface,pd_object,pd_notobjintf];
pd_flags : [pd_interface,pd_implemen,pd_body,pd_object,pd_notobjintf];
handler : @pd_static;
pocall : pocall_none;
pooption : [po_staticmethod];

View File

@ -3149,9 +3149,12 @@ implementation
not(is_void(returndef)) then
s:=s+':'+returndef.GetTypeName;
end;
s:=s+';';
{ forced calling convention? }
if (po_hascallingconvention in procoptions) then
s:=s+';'+ProcCallOptionStr[proccalloption];
s:=s+' '+ProcCallOptionStr[proccalloption]+';';
if po_staticmethod in procoptions then
s:=s+' Static;';
fullprocname:=s;
end;

29
tests/webtbs/tw12242.pp Normal file
View File

@ -0,0 +1,29 @@
{
staticbug.pas
With FPC 2.2.2:
staticbug.lpr(24,31) Error: function header doesn't match the previous declaration "class TMyController.doClose(Pointer, Pointer, Pointer);CDecl"
}
program staticbug;
{$mode delphi}{$STATIC ON}
uses
Classes, SysUtils;
type
{ TMyController }
TMyController = class
public
class procedure doClose(_self: Pointer; _cmd: Pointer; sender: Pointer); cdecl; static;
end;
class procedure TMyController.doClose(_self: Pointer; _cmd: Pointer; sender: Pointer); cdecl; static;
begin
end;
begin
end.