aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/inline.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/inline.adb b/gcc/ada/inline.adb
index ca86fb8..91e8f45 100644
--- a/gcc/ada/inline.adb
+++ b/gcc/ada/inline.adb
@@ -3367,6 +3367,8 @@ package body Inline is
E : Entity_Id;
Ret : Node_Id;
+ Had_Private_View : Boolean;
+
begin
if Is_Entity_Name (N) and then Present (Entity (N)) then
E := Entity (N);
@@ -3380,13 +3382,21 @@ package body Inline is
-- subtype is private at the call point but its full view is
-- visible to the body, then the inlined tree here must be
-- analyzed with the full view).
+ --
+ -- The Has_Private_View flag is cleared by rewriting, so it
+ -- must be explicitly saved and restored, just like when
+ -- instantiating the body to inline.
if Is_Entity_Name (A) then
+ Had_Private_View := Has_Private_View (N);
Rewrite (N, New_Occurrence_Of (Entity (A), Sloc (N)));
+ Set_Has_Private_View (N, Had_Private_View);
Check_Private_View (N);
elsif Nkind (A) = N_Defining_Identifier then
+ Had_Private_View := Has_Private_View (N);
Rewrite (N, New_Occurrence_Of (A, Sloc (N)));
+ Set_Has_Private_View (N, Had_Private_View);
Check_Private_View (N);
-- Numeric literal