]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix missing error on actual for In/Out parameter
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 14 Jan 2022 21:36:13 +0000 (22:36 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 9 May 2022 09:27:36 +0000 (09:27 +0000)
The compiler was failing to give an error on the result of a call to the
Input attribute passed as actual for an In/Out parameter.

gcc/ada/

* sem_util.adb (Is_OK_Variable_For_Out_Formal): Remove test on
Comes_From_Source in the condition dealing with the expression
of an N_Unchecked_Type_Conversion node.

gcc/ada/sem_util.adb

index 7f56ab496ed38d485fe0fe2c9cae467b57913584..86bd296faa5777cd5fb7ccca6e89a65add817b0c 100644 (file)
@@ -19533,9 +19533,7 @@ package body Sem_Util is
          if Nkind (Original_Node (AV)) in N_Function_Call | N_Aggregate then
             return False;
 
-         elsif Comes_From_Source (AV)
-           and then Nkind (Original_Node (Expression (AV))) = N_Function_Call
-         then
+         elsif Nkind (Original_Node (Expression (AV))) = N_Function_Call then
             return False;
 
          elsif Nkind (Original_Node (AV)) = N_Type_Conversion then