[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 24 Apr 2013 13:17:28 +0000 (15:17 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 24 Apr 2013 13:17:28 +0000 (15:17 +0200)
2013-04-24  Ed Schonberg  <schonberg@adacore.com>

* sem_aux.adb: Add guard in Available_View.

2013-04-24  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_prag.adb (Analyze_Depends_In_Decl_Part): Use
Find_Related_Subprogram to find the associated subprogram.
(Analyze_Global_In_Decl_List): Use Find_Related_Subprogram
to find the associated subprogram.
(Analyze_Pragma): Use Find_Related_Subprogram to find the associated
subprogram.

From-SVN: r198229

gcc/ada/ChangeLog
gcc/ada/sem_aux.adb
gcc/ada/sem_prag.adb

index 93955a03843cb66f11f7ed651a25c80a81e7c423..f33d03b9a635bb770bf05cab128a422eea114be6 100644 (file)
@@ -1,3 +1,16 @@
+2013-04-24  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_aux.adb: Add guard in Available_View.
+
+2013-04-24  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_prag.adb (Analyze_Depends_In_Decl_Part): Use
+       Find_Related_Subprogram to find the associated subprogram.
+       (Analyze_Global_In_Decl_List): Use Find_Related_Subprogram
+       to find the associated subprogram.
+       (Analyze_Pragma): Use Find_Related_Subprogram to find the associated
+       subprogram.
+
 2013-04-24  Hristian Kirtchev  <kirtchev@adacore.com>
 
        * exp_ch6.adb: Remove with and use clause for Sem_Prag.
index 23b8f592aa9e6918f111dc9eb559fec18b3a3d3d..3c5d2af59baa8f9c6c719c1a65883bcf1b971f30 100644 (file)
@@ -86,8 +86,12 @@ package body Sem_Aux is
 
          return Get_Full_View (Non_Limited_View (Typ));
 
+      --  If it is class_wide, check whether the specific type comes from
+      --  A limited_with.
+
       elsif Is_Class_Wide_Type (Typ)
         and then Is_Incomplete_Type (Etype (Typ))
+        and then From_With_Type (Etype (Typ))
         and then Present (Non_Limited_View (Etype (Typ)))
       then
          return Class_Wide_Type (Non_Limited_View (Etype (Typ)));
index 9339d490c974d8a52463b9e58e3f20e103096bf0..089c1157fefb191241ebb1a374cc16d5dd6a314a 100644 (file)
@@ -1370,7 +1370,7 @@ package body Sem_Prag is
    begin
       Set_Analyzed (N);
 
-      Subp_Decl := Parent (Corresponding_Aspect (N));
+      Subp_Decl := Find_Related_Subprogram (N);
       Subp_Id   := Defining_Unit_Name (Specification (Subp_Decl));
       Clause    := Expression (Arg1);
 
@@ -1746,7 +1746,7 @@ package body Sem_Prag is
    begin
       Set_Analyzed (N);
 
-      Subp_Decl := Parent (Corresponding_Aspect (N));
+      Subp_Decl := Find_Related_Subprogram (N);
       Subp_Id   := Defining_Unit_Name (Specification (Subp_Decl));
       List      := Expression (Arg1);
 
@@ -10625,7 +10625,7 @@ package body Sem_Prag is
             --  associated with a subprogram declaration or a body that acts
             --  as a spec.
 
-            Subp_Decl := Parent (Corresponding_Aspect (N));
+            Subp_Decl := Find_Related_Subprogram (N, Check_Duplicates => True);
 
             if Nkind (Subp_Decl) /= N_Subprogram_Declaration
               and then (Nkind (Subp_Decl) /= N_Subprogram_Body
@@ -11904,7 +11904,7 @@ package body Sem_Prag is
             --  associated with a subprogram declaration or a body that acts
             --  as a spec.
 
-            Subp_Decl := Parent (Corresponding_Aspect (N));
+            Subp_Decl := Find_Related_Subprogram (N, Check_Duplicates => True);
 
             if Nkind (Subp_Decl) /= N_Subprogram_Declaration
               and then (Nkind (Subp_Decl) /= N_Subprogram_Body