mirror of
				https://gitlab.com/freepascal.org/fpc/source.git
				synced 2025-11-04 02:39:40 +01:00 
			
		
		
		
	compiler: fix private and protected members visibility check for nested records (issue #0018768)
git-svn-id: trunk@19000 -
This commit is contained in:
		
							parent
							
								
									dd5aa12531
								
							
						
					
					
						commit
						389c033a29
					
				
							
								
								
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitattributes
									
									
									
									
										vendored
									
									
								
							@ -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
 | 
			
		||||
 | 
			
		||||
@ -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
 | 
			
		||||
                          (
 | 
			
		||||
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
{ %norun}
 | 
			
		||||
program tw18767a.pp;
 | 
			
		||||
program tw18767a;
 | 
			
		||||
 | 
			
		||||
{$mode delphi}{$H+}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										26
									
								
								tests/webtbs/tw18768.pp
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								tests/webtbs/tw18768.pp
									
									
									
									
									
										Normal 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.
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user