Commit de65e0e4 by Ed Schonberg Committed by Arnaud Charlet

sem_util.adb: Add guard to setting of No_Predicate_On_Actual.

       * sem_util.adb: Add guard to setting of No_Predicate_On_Actual.
       * sem_ch3.adb: Minor reformatting.

From-SVN: r213422
parent 5e01ce12
...@@ -16804,10 +16804,10 @@ package body Sem_Ch3 is ...@@ -16804,10 +16804,10 @@ package body Sem_Ch3 is
procedure Inherit_Predicate_Flags (Subt, Par : Entity_Id) is procedure Inherit_Predicate_Flags (Subt, Par : Entity_Id) is
begin begin
Set_Has_Static_Predicate_Aspect (Subt, Set_Has_Static_Predicate_Aspect
Has_Static_Predicate_Aspect (Par)); (Subt, Has_Static_Predicate_Aspect (Par));
Set_Has_Dynamic_Predicate_Aspect (Subt, Set_Has_Dynamic_Predicate_Aspect
Has_Dynamic_Predicate_Aspect (Par)); (Subt, Has_Dynamic_Predicate_Aspect (Par));
end Inherit_Predicate_Flags; end Inherit_Predicate_Flags;
----------------------- -----------------------
......
...@@ -793,7 +793,9 @@ package body Sem_Util is ...@@ -793,7 +793,9 @@ package body Sem_Util is
return; return;
end if; 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); Set_No_Predicate_On_Actual (Typ);
end if; end if;
...@@ -821,9 +823,11 @@ package body Sem_Util is ...@@ -821,9 +823,11 @@ package body Sem_Util is
Error_Msg_Warn := SPARK_Mode /= On; Error_Msg_Warn := SPARK_Mode /= On;
Error_Msg_FE (Msg & "<<", N, Typ); Error_Msg_FE (Msg & "<<", N, Typ);
Error_Msg_F ("\Program_Error [<<", N); Error_Msg_F ("\Program_Error [<<", N);
Insert_Action (N, Insert_Action (N,
Make_Raise_Program_Error (Sloc (N), Make_Raise_Program_Error (Sloc (N),
Reason => PE_Bad_Predicated_Generic_Type)); Reason => PE_Bad_Predicated_Generic_Type));
else else
Error_Msg_FE (Msg & "<<", N, Typ); Error_Msg_FE (Msg & "<<", N, Typ);
end if; end if;
...@@ -6018,7 +6022,8 @@ package body Sem_Util is ...@@ -6018,7 +6022,8 @@ package body Sem_Util is
-- be a static subtype, since otherwise it would have -- be a static subtype, since otherwise it would have
-- been diagnosed as illegal. -- 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 then
exit Search when Is_In_Range (Expr, Etype (Choice), exit Search when Is_In_Range (Expr, Etype (Choice),
Assume_Valid => False); Assume_Valid => False);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment