diff --git a/.gitattributes b/.gitattributes index 27a14910c1..d40a9f7762 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6821,6 +6821,7 @@ tests/webtbs/tw5015.pp svneol=native#text/plain tests/webtbs/tw5023.pp svneol=native#text/plain tests/webtbs/tw5036.pp svneol=native#text/plain tests/webtbs/tw5082.pp -text svneol=unset#text/plain +tests/webtbs/tw6435.pp svneol=native#text/plain tests/webtbs/tw6491.pp svneol=native#text/plain tests/webtbs/tw6624.pp svneol=native#text/plain tests/webtbs/tw6684.pp svneol=native#text/plain diff --git a/compiler/symsym.pas b/compiler/symsym.pas index 6b3e3103cd..f03ff4ee34 100644 --- a/compiler/symsym.pas +++ b/compiler/symsym.pas @@ -163,6 +163,7 @@ interface constructor create(const n : string;vsp:tvarspez;const tt : ttype;vopts:tvaroptions); constructor ppuload(ppufile:tcompilerppufile); procedure ppuwrite(ppufile:tcompilerppufile);override; + function mangledname:string;override; end; tabstractnormalvarsym = class(tabstractvarsym) @@ -1416,6 +1417,22 @@ implementation end; + function tfieldvarsym.mangledname:string; + var + srsym : tsym; + srsymtable : tsymtable; + begin + if sp_static in symoptions then + begin + searchsym(lower(owner.name^)+'_'+name,srsym,srsymtable); + if assigned(srsym) then + result:=srsym.mangledname; + end + else + result:=inherited mangledname; + end; + + {**************************************************************************** TABSTRACTNORMALVARSYM ****************************************************************************} diff --git a/tests/webtbs/tw6435.pp b/tests/webtbs/tw6435.pp new file mode 100644 index 0000000000..ee41670839 --- /dev/null +++ b/tests/webtbs/tw6435.pp @@ -0,0 +1,14 @@ +{ %OPT=-gl } +program Project1; + +{$mode objfpc}{$H+}{$static on} + +type + MyClass = class(TObject) + private + FClassVar: integer; static; + end; + +begin +end. +