aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.cc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2022-04-19 21:53:35 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2022-06-02 09:06:46 +0000
commit59a6274d86824e9aadf8814c6fb9929ef5e423fc (patch)
tree44a7c9ce7fe82a6acf127f6e4444300475528b2f /gcc/ada/gcc-interface/decl.cc
parentbbb9c475bff9e3646542fa5273433abc0300cf6a (diff)
downloadgcc-59a6274d86824e9aadf8814c6fb9929ef5e423fc.zip
gcc-59a6274d86824e9aadf8814c6fb9929ef5e423fc.tar.gz
gcc-59a6274d86824e9aadf8814c6fb9929ef5e423fc.tar.bz2
[Ada] Couple of small preparatory adjustments
No functional changes. gcc/ada/ * gcc-interface/decl.cc (gnat_to_gnu_entity): Do not check the scope of anonymous access Itypes. * gcc-interface/trans.cc (Identifier_to_gnu): Do not translate the return type of a subprogram here.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.cc')
-rw-r--r--gcc/ada/gcc-interface/decl.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/decl.cc b/gcc/ada/gcc-interface/decl.cc
index bbbb343..9574dbb 100644
--- a/gcc/ada/gcc-interface/decl.cc
+++ b/gcc/ada/gcc-interface/decl.cc
@@ -346,10 +346,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
&& !present_gnu_tree (gnat_entity)
&& In_Extended_Main_Code_Unit (gnat_entity))
{
- /* Ensure that we are in a subprogram mentioned in the Scope chain of
+ /* Unless it's for an anonymous access type, whose scope is irrelevant,
+ ensure that we are in a subprogram mentioned in the Scope chain of
this entity, our current scope is global, or we encountered a task
or entry (where we can't currently accurately check scoping). */
- if (!current_function_decl
+ if (Ekind (gnat_entity) == E_Anonymous_Access_Type
+ || !current_function_decl
|| DECL_ELABORATION_PROC_P (current_function_decl))
{
process_type (gnat_entity);