OSDN Git Service

2008-08-01 Gary Dismukes <dismukes@adacore.com>
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Aug 2008 09:29:30 +0000 (09:29 +0000)
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Aug 2008 09:29:30 +0000 (09:29 +0000)
* exp_ch6.adb (Expand_Call): Adjustment to previous fix for passing
correct accessibility levels. In the "when others" case, retrieve the
access level of the Etype of Prev rather than Prev_Orig, because the
original exression has not always been analyzed.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138493 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/exp_ch6.adb

index d2281d1..2d31162 100644 (file)
@@ -2284,13 +2284,15 @@ package body Exp_Ch6 is
                           Intval => Scope_Depth (Current_Scope) + 1),
                         Extra_Accessibility (Formal));
 
-                  --  For other cases we simply pass the level of the
-                  --  actual's access type.
+                  --  For other cases we simply pass the level of the actual's
+                  --  access type. The type is retrieved from Prev rather than
+                  --  Prev_Orig, because in some cases Prev_Orig denotes a
+                  --  original expression that has not been analyzed.
 
                   when others =>
                      Add_Extra_Actual
                        (Make_Integer_Literal (Loc,
-                          Intval => Type_Access_Level (Etype (Prev_Orig))),
+                          Intval => Type_Access_Level (Etype (Prev))),
                         Extra_Accessibility (Formal));
 
                end case;