summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-09-09 15:39:14 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-09-09 15:39:14 +0200
commit4ca1721930e4e6a7eb33727d03bda6255233d9ee (patch)
treecb720994148b95b38c1b6afdac695c8b8e66650e /gcc/ada
parent9d983bbf20d818173dab18c236192bb071494604 (diff)
downloadgcc-4ca1721930e4e6a7eb33727d03bda6255233d9ee.tar.gz
sprint.adb (Write_Id): If the parent node is an expanded name...
* sprint.adb (Write_Id): If the parent node is an expanded name, check that its entity_or_associated_node is an entity before writing it out. From-SVN: r164093
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sprint.adb6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 44c12f0ab2d..264056ed978 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -3467,11 +3467,13 @@ package body Sprint is
end if;
-- Case of selector of an expanded name where the expanded name
- -- has an associated entity, output this entity.
+ -- has an associated entity, output this entity. Check that the
+ -- entity or associated node is of the right kind, see above.
elsif Nkind (Parent (N)) = N_Expanded_Name
and then Selector_Name (Parent (N)) = N
- and then Present (Entity (Parent (N)))
+ and then Present (Entity_Or_Associated_Node (Parent (N)))
+ and then Nkind (Entity (Parent (N))) in N_Entity
then
Write_Id (Entity (Parent (N)));