diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2020-05-02 17:35:02 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-19 04:17:26 -0400 |
commit | ce716aaaa3efb464af4caa16d8f75814c401b593 (patch) | |
tree | 0843ed72fea0fe21531ab65874e20b906ab7d619 /gcc | |
parent | 1e400f33e172020a4a3e357ee99c63e3ee97376d (diff) | |
download | gcc-ce716aaaa3efb464af4caa16d8f75814c401b593.zip gcc-ce716aaaa3efb464af4caa16d8f75814c401b593.tar.gz gcc-ce716aaaa3efb464af4caa16d8f75814c401b593.tar.bz2 |
[Ada] Fix small fallout of previous change for Analyze_Selected_Component
2020-06-19 Eric Botcazou <ebotcazou@adacore.com>
gcc/ada/
* sem_ch3.adb (Is_Visible_Component): Reason only on the private
status of the original type in an instance body.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index e33e3b3..9e60d75 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -18864,7 +18864,9 @@ package body Sem_Ch3 is -- a component in a sibling package that is inherited from a visible -- component of a type in an ancestor package; the component in the -- sibling package should not be visible even though the component it - -- inherited from is visible). This does not apply however in the case + -- inherited from is visible), but instance bodies are not subject to + -- this second case since they have the Has_Private_View mechanism to + -- ensure proper visibility. This does not apply however in the case -- where the scope of the type is a private child unit, or when the -- parent comes from a local package in which the ancestor is currently -- visible. The latter suppression of visibility is needed for cases @@ -18874,7 +18876,8 @@ package body Sem_Ch3 is or else (not Is_Private_Descendant (Type_Scope) and then not In_Open_Scopes (Type_Scope) - and then Has_Private_Declaration (Original_Type)) + and then Has_Private_Declaration (Original_Type) + and then not In_Instance_Body) then -- If the type derives from an entity in a formal package, there -- are no additional visible components. |