sem_util.adb: Add guard to setting of No_Predicate_On_Actual.
authorEd Schonberg <schonberg@adacore.com>
Fri, 1 Aug 2014 08:26:57 +0000 (10:26 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 1 Aug 2014 08:26:57 +0000 (10:26 +0200)
       * sem_util.adb: Add guard to setting of No_Predicate_On_Actual.
       * sem_ch3.adb: Minor reformatting.

From-SVN: r213422

gcc/ada/sem_ch3.adb
gcc/ada/sem_util.adb

index 9e8969f9ac53a7ddeb2983d90f7b05748fc46985..a22479f02feaeee7be4a167ff181e6a2bbefd70c 100644 (file)
@@ -16804,10 +16804,10 @@ package body Sem_Ch3 is
 
    procedure Inherit_Predicate_Flags (Subt, Par : Entity_Id) is
    begin
-      Set_Has_Static_Predicate_Aspect (Subt,
-          Has_Static_Predicate_Aspect (Par));
-      Set_Has_Dynamic_Predicate_Aspect (Subt,
-          Has_Dynamic_Predicate_Aspect (Par));
+      Set_Has_Static_Predicate_Aspect
+        (Subt, Has_Static_Predicate_Aspect (Par));
+      Set_Has_Dynamic_Predicate_Aspect
+        (Subt, Has_Dynamic_Predicate_Aspect (Par));
    end Inherit_Predicate_Flags;
 
    -----------------------
index 237cc86f774238153e977762c5e3ddfd2b89623e..7fbf48a8461edd71da69848f26303a8944614571 100644 (file)
@@ -793,7 +793,9 @@ package body Sem_Util is
             return;
          end if;
 
-         if Is_Generic_Formal (Typ) then
+         if Is_Generic_Formal (Typ)
+           and then Is_Discrete_Type (Typ)
+         then
             Set_No_Predicate_On_Actual (Typ);
          end if;
 
@@ -821,9 +823,11 @@ package body Sem_Util is
                Error_Msg_Warn := SPARK_Mode /= On;
                Error_Msg_FE (Msg & "<<", N, Typ);
                Error_Msg_F ("\Program_Error [<<", N);
+
                Insert_Action (N,
                  Make_Raise_Program_Error (Sloc (N),
                    Reason => PE_Bad_Predicated_Generic_Type));
+
             else
                Error_Msg_FE (Msg & "<<", N, Typ);
             end if;
@@ -6018,7 +6022,8 @@ package body Sem_Util is
                --  be a static subtype, since otherwise it would have
                --  been diagnosed as illegal.
 
-               elsif Is_Entity_Name (Choice) and then Is_Type (Entity (Choice))
+               elsif Is_Entity_Name (Choice) and then
+                     Is_Type (Entity (Choice))
                then
                   exit Search when Is_In_Range (Expr, Etype (Choice),
                                                 Assume_Valid => False);