mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 13:09:32 +02:00
* perform -CTlowercaseprocstart conversion it tprocsym.create rather than
when building the mangled name, because the latter can also be performed when compiler another unit (and therefore if that other unit's setting is different from that of the original unit, a wrong mangled name was generated) + test for this case git-svn-id: trunk@25388 -
This commit is contained in:
parent
a14ceba791
commit
fcaad5baf2
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10639,6 +10639,7 @@ tests/test/jvm/tint.pp svneol=native#text/plain
|
||||
tests/test/jvm/tintstr.pp svneol=native#text/plain
|
||||
tests/test/jvm/tjavalowercaseproc.java svneol=native#text/plain
|
||||
tests/test/jvm/tjsetter.java svneol=native#text/plain
|
||||
tests/test/jvm/tlowercaseproc.pp svneol=native#text/plain
|
||||
tests/test/jvm/tnestdynarr.pp svneol=native#text/plain
|
||||
tests/test/jvm/tnestedset.pp svneol=native#text/plain
|
||||
tests/test/jvm/tnestproc.pp svneol=native#text/plain
|
||||
|
@ -5271,8 +5271,6 @@ implementation
|
||||
tmpresult:='$'+tprocdef(owner.defowner).procsym.realname+'$'+tostr(tprocdef(owner.defowner).procsym.symid)+'$'+tmpresult;
|
||||
container:=container.defowner.owner;
|
||||
end;
|
||||
if ts_lowercase_proc_start in current_settings.targetswitches then
|
||||
tmpresult[1]:=lower(tmpresult[1]);
|
||||
end;
|
||||
end
|
||||
else
|
||||
|
@ -614,7 +614,11 @@ implementation
|
||||
|
||||
constructor tprocsym.create(const n : string);
|
||||
begin
|
||||
inherited create(procsym,n);
|
||||
if not(ts_lowercase_proc_start in current_settings.targetswitches) or
|
||||
(n='') then
|
||||
inherited create(procsym,n)
|
||||
else
|
||||
inherited create(procsym,lowercase(n[1])+copy(n,2,length(n)-1));
|
||||
FProcdefList:=TFPObjectList.Create(false);
|
||||
FProcdefderefList:=nil;
|
||||
{ the tprocdef have their own symoptions, make the procsym
|
||||
|
40
tests/test/jvm/tlowercaseproc.pp
Normal file
40
tests/test/jvm/tlowercaseproc.pp
Normal file
@ -0,0 +1,40 @@
|
||||
{$namespace org.freepascal.test.lcproc}
|
||||
|
||||
unit tlowercaseproc;
|
||||
|
||||
{$mode delphi}
|
||||
{$targetswitch lowercaseprocstart}
|
||||
|
||||
interface
|
||||
|
||||
procedure DoIt;
|
||||
|
||||
type
|
||||
tc = class
|
||||
procedure MethodName;
|
||||
class procedure ClassMethodName; static;
|
||||
end;
|
||||
|
||||
implementation
|
||||
|
||||
procedure DoIt;
|
||||
var
|
||||
a: ansistringclass;
|
||||
begin
|
||||
{ this routine is declared with uppercase C at the start in the system unit,
|
||||
check that we don't lowercase this one as well }
|
||||
a:=AnsistringClass(AnsistringClass.CreateFromLiteralStringBytes('abcdef',DefaultSystemCodePage));
|
||||
end;
|
||||
|
||||
procedure tc.MethodName;
|
||||
begin
|
||||
doit;
|
||||
classmethodname;
|
||||
end;
|
||||
|
||||
class procedure tc.ClassMethodName; static;
|
||||
begin
|
||||
doit;
|
||||
end;
|
||||
|
||||
end.
|
Loading…
Reference in New Issue
Block a user