]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix error message about limited extensions
authorRonan Desplanques <desplanques@adacore.com>
Tue, 16 Sep 2025 08:12:29 +0000 (10:12 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 29 Sep 2025 09:43:39 +0000 (11:43 +0200)
commit84119759ec0f312fb4a022a718254fa311ebf474
tree96d79094a71572b14b6dd2b5d435d53e9b53ab7b
parent701fbd4cfbac0b52566e4c8cab02d95968cb961d
ada: Fix error message about limited extensions

Consider the following package:

    package P is
       type T1 is tagged limited null record;

       type T2 is new T1 with private;
    private

       type T2 is limited new T1 with null record;
    end P;

It should be rejected because of ARM 7.3 (10.1/3). Before this patch,
GNAT did reject it, with the following error message:

    full view of non-limited extension cannot be limited

This message is not right because the partial view of T2 here *is*
limited even if it doesn't have an explicit limited keyword in its
declaration. This patch changes the error message to something that's a
better match for ARM 7.3 (10.1/3).

This patch also tweaks another related error message and substitutes
a mention of ARM 7.3 (10.1/3) for the Ada Issue it originated from in a
comment.

gcc/ada/ChangeLog:

* sem_ch3.adb (Process_Full_View): Fix error message.
gcc/ada/sem_ch3.adb