mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 02:19:27 +02:00
compiler: fix accessing typed constants inside class declaration (bug #21941)
git-svn-id: trunk@21273 -
This commit is contained in:
parent
b3595893c8
commit
62b59235ca
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -12586,6 +12586,7 @@ tests/webtbs/tw2185.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw2186.pp svneol=native#text/plain
|
tests/webtbs/tw2186.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2187.pp svneol=native#text/plain
|
tests/webtbs/tw2187.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw21878.pp svneol=native#text/plain
|
tests/webtbs/tw21878.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw21941.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw21951.pp svneol=native#text/plain
|
tests/webtbs/tw21951.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2196.pp svneol=native#text/plain
|
tests/webtbs/tw2196.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2197.pp svneol=native#text/plain
|
tests/webtbs/tw2197.pp svneol=native#text/plain
|
||||||
|
@ -2254,7 +2254,9 @@ implementation
|
|||||||
if (srsymtable.symtabletype in [ObjectSymtable,recordsymtable]) then
|
if (srsymtable.symtabletype in [ObjectSymtable,recordsymtable]) then
|
||||||
{ if we are accessing a owner procsym from the nested }
|
{ if we are accessing a owner procsym from the nested }
|
||||||
{ class we need to call it as a class member }
|
{ class we need to call it as a class member }
|
||||||
if assigned(current_structdef) and (current_structdef<>hdef) and is_owned_by(current_structdef,hdef) then
|
if assigned(current_structdef) and
|
||||||
|
(((current_structdef<>hdef) and is_owned_by(current_structdef,hdef)) or
|
||||||
|
(sp_static in srsym.symoptions)) then
|
||||||
p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
|
p1:=cloadvmtaddrnode.create(ctypenode.create(hdef))
|
||||||
else
|
else
|
||||||
if assigned(current_procinfo) and current_procinfo.procdef.no_self_node then
|
if assigned(current_procinfo) and current_procinfo.procdef.no_self_node then
|
||||||
|
41
tests/webtbs/tw21941.pp
Normal file
41
tests/webtbs/tw21941.pp
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
{%norun}
|
||||||
|
program tw21941;
|
||||||
|
|
||||||
|
{$mode objfpc}{$H+}
|
||||||
|
|
||||||
|
type
|
||||||
|
TACLInfo = record
|
||||||
|
Name: string;
|
||||||
|
end;
|
||||||
|
PACLInfo = ^TACLInfo;
|
||||||
|
|
||||||
|
TCLSInfo = record
|
||||||
|
Name: string;
|
||||||
|
end;
|
||||||
|
PCLSInfo = ^TCLSInfo;
|
||||||
|
|
||||||
|
TCoreObjectInfo = record
|
||||||
|
CLSInfo: PCLSInfo;
|
||||||
|
ACLInfo: PACLInfo;
|
||||||
|
end;
|
||||||
|
|
||||||
|
type
|
||||||
|
Root = class
|
||||||
|
type
|
||||||
|
Test = class
|
||||||
|
const
|
||||||
|
ACLInfo: TACLInfo = (
|
||||||
|
Name: 'Admin';
|
||||||
|
);
|
||||||
|
CLSInfo: TCLSInfo = (
|
||||||
|
Name: 'TAdminCore';
|
||||||
|
);
|
||||||
|
Header: TCoreObjectInfo = (
|
||||||
|
CLSInfo: @CLSInfo;
|
||||||
|
ACLInfo: @ACLInfo;
|
||||||
|
);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
begin
|
||||||
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user