]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Adjust message about statically compatible result subtype
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 10 Jun 2025 22:20:13 +0000 (00:20 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 3 Jul 2025 08:16:26 +0000 (10:16 +0200)
Ada RM 6.5(5.3/5) is about "result SUBTYPE of the function", while the error
message was saying "result TYPE of the function". Now use the exact RM wording
in the error message for this rule.

gcc/ada/ChangeLog:

* sem_ch3.adb (Check_Return_Subtype_Indication): Adjust error message
to match the RM wording.

gcc/ada/sem_ch3.adb

index 0afc65da52c3e880204ddbbebe32be2c23900079..98a8fa563919798cd4512f986fa1fc59b78636c2 100644 (file)
@@ -4297,7 +4297,7 @@ package body Sem_Ch3 is
             then
                Error_Msg_N
                  ("result subtype must be statically compatible with the " &
-                  "function result type", Indic);
+                  "function result subtype", Indic);
 
                if not Predicates_Compatible (Obj_Typ, R_Typ) then
                   Error_Msg_NE