From: Ronan Desplanques Date: Fri, 8 Aug 2025 12:57:19 +0000 (+0200) Subject: ada: Fix comment in Find_Type_Name X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cdb59dcce86c060d828d751b666757edb6af0b3;p=thirdparty%2Fgcc.git ada: Fix comment in Find_Type_Name The comment this patch changes was made incorrect by the possibility of completing an incomplete view with a private type declaration in Ada 2012. To avoid any possible confusion, this patch brings the comment up to date. gcc/ada/ChangeLog: * sem_ch3.adb (Find_Type_Name): Fix comment. --- diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 96429361115..bdd23aa276f 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -18747,7 +18747,11 @@ package body Sem_Ch3 is Enter_Name (Id); New_Id := Id; - -- Check invalid completion of private or incomplete type + -- Check invalid completion of private or incomplete type. The + -- completion of an incomplete view must be a non-incomplete type + -- declaration (RM 3.10.1 (3/3)) and the completion of a partial view + -- must be a full type declaration (RM 7.3 (4)). Before Ada 2012, a + -- full type declaration is needed in the two cases. elsif Nkind (N) not in N_Full_Type_Declaration | N_Task_Type_Declaration @@ -18758,8 +18762,6 @@ package body Sem_Ch3 is or else Nkind (N) not in N_Private_Type_Declaration | N_Private_Extension_Declaration) then - -- Completion must be a full type declarations (RM 7.3(4)) - Error_Msg_Sloc := Sloc (Prev); Error_Msg_NE ("invalid completion of }", Id, Prev);