compiler: fix private and protected members visibility check for nested records (issue #0018768)

git-svn-id: trunk@19000 -
This commit is contained in:
paul 2011-09-07 01:51:13 +00:00
parent dd5aa12531
commit 389c033a29
4 changed files with 32 additions and 5 deletions

1
.gitattributes vendored
View File

@ -11714,6 +11714,7 @@ tests/webtbs/tw18702.pp svneol=native#text/pascal
tests/webtbs/tw1873.pp svneol=native#text/plain
tests/webtbs/tw18767a.pp svneol=native#text/pascal
tests/webtbs/tw18767b.pp svneol=native#text/pascal
tests/webtbs/tw18768.pp svneol=native#text/pascal
tests/webtbs/tw1883.pp svneol=native#text/plain
tests/webtbs/tw18859.pp svneol=native#text/plain
tests/webtbs/tw1888.pp svneol=native#text/plain

View File

@ -1856,8 +1856,8 @@ implementation
(symownerdef.owner.symtabletype in [globalsymtable,staticsymtable]) and
(symownerdef.owner.iscurrentunit)
) or
( // the case of specialize inside the generic declaration
(symownerdef.owner.symtabletype = objectsymtable) and
( // the case of specialize inside the generic declaration and nested types
(symownerdef.owner.symtabletype in [objectsymtable,recordsymtable]) and
(
assigned(current_structdef) and
(
@ -1905,8 +1905,8 @@ implementation
(contextobjdef.owner.iscurrentunit) and
contextobjdef.is_related(symownerdef)
) or
( // the case of specialize inside the generic declaration
(symownerdef.owner.symtabletype = objectsymtable) and
( // the case of specialize inside the generic declaration and nested types
(symownerdef.owner.symtabletype in [objectsymtable,recordsymtable]) and
(
assigned(current_structdef) and
(

View File

@ -1,5 +1,5 @@
{ %norun}
program tw18767a.pp;
program tw18767a;
{$mode delphi}{$H+}

26
tests/webtbs/tw18768.pp Normal file
View File

@ -0,0 +1,26 @@
{ %norun}
program tw18768;
{$mode delphi}{$H+}
type
TFoo1 = record
private
type
TFoo3 = record
private
b, c: integer;
protected
a: integer;
public
function GetFoo2: integer;
end;
end;
function TFoo1.TFoo3.GetFoo2: integer;
begin
c := a * b;
end;
begin
end.