diff options
author | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-05-22 09:24:24 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2017-05-22 09:24:24 +0000 |
commit | d327113612c1b089eee87f04cd517b7f7103c1ea (patch) | |
tree | 5b660c58c813d8aea1e713136d95cb2b70afe62d /gcc/ada/gcc-interface/trans.c | |
parent | 4c24ec6d58db238f64bda456ebdb0b5c82347d78 (diff) | |
download | gcc-d327113612c1b089eee87f04cd517b7f7103c1ea.zip gcc-d327113612c1b089eee87f04cd517b7f7103c1ea.tar.gz gcc-d327113612c1b089eee87f04cd517b7f7103c1ea.tar.bz2 |
sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a limited view may appear in the profile of...
* sem_ch4.adb (Analyze_Call): In Ada2012 an incomplete type from a
limited view may appear in the profile of a function, and a call to
that function in another unit in which the full view is available must
use this full view to spurious type errors at the point of call.
* inline.adb (Analyze_Inlined_Bodies): Remove restriction on loading
of parent body with a with clause for the main unit.
* gcc-interface/decl.c (defer_limited_with_list): Document new usage.
(gnat_to_gnu_entity) <E_Access_Type>: Handle completed Taft Amendment
types declared in external units like types from limited with clauses.
Adjust final processing of defer_limited_with_list accordingly.
* gcc-interface/trans.c (gnat_to_gnu) < N_Selected_Component>: Try
again to translate the prefix after the field if it is incomplete.
From-SVN: r248321
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r-- | gcc/ada/gcc-interface/trans.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c index dc1b43a..2542626 100644 --- a/gcc/ada/gcc-interface/trans.c +++ b/gcc/ada/gcc-interface/trans.c @@ -6413,7 +6413,6 @@ gnat_to_gnu (Node_Id gnat_node) Entity_Id gnat_prefix = Prefix (gnat_node); Entity_Id gnat_field = Entity (Selector_Name (gnat_node)); tree gnu_prefix = gnat_to_gnu (gnat_prefix); - tree gnu_field; gnu_prefix = maybe_implicit_deref (gnu_prefix); @@ -6442,8 +6441,19 @@ gnat_to_gnu (Node_Id gnat_node) NULL_TREE, gnu_prefix); else { - gnu_field = gnat_to_gnu_field_decl (gnat_field); - + tree gnu_field = gnat_to_gnu_field_decl (gnat_field); + + /* If the prefix has incomplete type, try again to translate it. + The idea is that the translation of the field just above may + have completed it through gnat_to_gnu_entity, in case it is + the dereference of an access to Taft Amendment type used in + the instantiation of a generic body from an external unit. */ + if (!COMPLETE_TYPE_P (TREE_TYPE (gnu_prefix))) + { + gnu_prefix = gnat_to_gnu (gnat_prefix); + gnu_prefix = maybe_implicit_deref (gnu_prefix); + } + gnu_result = build_component_ref (gnu_prefix, gnu_field, (Nkind (Parent (gnat_node)) |