Commit c3c41b29 by Ed Schonberg Committed by Pierre-Marie de Rodat

[Ada] Unnesting: handle conditional expressions

2019-07-04  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* exp_unst.adb: Handle conditional expressions.

From-SVN: r273053
parent 3d53efa6
2019-07-04 Ed Schonberg <schonberg@adacore.com>
* exp_unst.adb: Handle conditional expressions.
2019-07-04 Yannick Moy <moy@adacore.com>
* sem_spark.adb (Check_Package_Spec, Check_Package_Body): Only
......
......@@ -598,6 +598,33 @@ package body Exp_Unst is
then
Note_Uplevel_Bound (Prefix (N), Ref);
-- Conditional expressions.
elsif Nkind (N) = N_If_Expression then
declare
Expr : Node_Id;
begin
Expr := First (Expressions (N));
while Present (Expr) loop
Note_Uplevel_Bound (Expr, Ref);
Next (Expr);
end loop;
end;
elsif Nkind (N) = N_Case_Expression then
declare
Alternative : Node_Id;
begin
Note_Uplevel_Bound (Expression (N), Ref);
Alternative := First (Alternatives (N));
while Present (Alternative) loop
Note_Uplevel_Bound (Expression (Alternative), Ref);
end loop;
end;
-- Conversion case
elsif Nkind (N) = N_Type_Conversion then
......
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