]> git.ipfire.org Git - thirdparty/gcc.git/commit
Ada: Fix misleading diagnostic about abstract new in type derivation
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 3 Nov 2025 23:10:55 +0000 (00:10 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Mon, 3 Nov 2025 23:42:46 +0000 (00:42 +0100)
commitf4367c6b7b7229835fb8786d85a853cb4641b29c
treead226a509ad18327a9c690d7c77b31dcde7789e5
parent584f50a6e405f057ab41fb5416aea5820f15c9cd
Ada: Fix misleading diagnostic about abstract new in type derivation

The current error message is:

abstract1.ads:7:13: error: "abstract" not allowed here, ignored

but "abstract" is indeed allowed there if you complete the declaration.

The patch changes it to:

abstract1.ads:7:13: error: "abstract" allowed only for record extension, ...

gcc/ada/
PR ada/55324
* par-ch3.adb (P_Type_Declaration): Give a better error message
for illegal "abstract" in a type derivation.

gcc/testsuite/
* gnat.dg/specs/abstract1.ads: New test.
gcc/ada/par-ch3.adb
gcc/testsuite/gnat.dg/specs/abstract1.ads [new file with mode: 0644]