[COMMITTED,07/35] ada: Spurious error compiling CC51011

Message ID 20241025091107.485741-7-poulhies@adacore.com
State Committed
Commit d6f9774b780150c1cbb58d43a0f1f36c2da0e2c7
Headers
Series [COMMITTED,01/35] ada: Pass parameters of full access unconstrained array types by copy in calls |

Commit Message

Marc Poulhiès Oct. 25, 2024, 9:10 a.m. UTC
  From: Javier Miranda <miranda@adacore.com>

Adjust the check of 13.14(10.2/3) to avoid reporting an error
on unfrozen incomplete types, as they are never frozen
(AI12-0155-1).

gcc/ada/ChangeLog:

	* sem_ch8.adb (Freeze_Actual_Profile): Do not report error
	on incomplete types, since they do not cause freezing.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch8.adb | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index 13c44c5e302..760d4bebc78 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -2343,6 +2343,11 @@  package body Sem_Ch8 is
                      elsif From_Limited_With (Etype (F)) then
                         null;
 
+                     --  Incomplete types are never frozen (AI12-0155-1)
+
+                     elsif Is_Incomplete_Type (Etype (F)) then
+                        null;
+
                      else
                         Error_Msg_NE
                           ("type& must be frozen before this point",