This patch fixes an error in the compiler whereby an assignment to an out
formal (whose type requires a predicate check) can lead to spurious
"value may be referenced before it has a value" warnings when the RHS is a
qualified expression.
gcc/ada/
* sem_warn.adb (Within_Postcondition): Add case to ignore
references within generated predicate function calls.
then
return True;
+ -- Verify we are not within a generated predicate
+ -- function call.
+
+ elsif Nkind (Nod) = N_Function_Call
+ and then Is_Entity_Name (Name (Nod))
+ and then Is_Predicate_Function
+ (Entity (Name (Nod)))
+ then
+ return True;
+
elsif Present (Parent (Nod)) then
P := Parent (Nod);