[Ada] Remove dead and duplicated diagnostics for generic access types

Pierre-Marie de Rodat derodat@adacore.com
Wed Nov 25 13:27:24 GMT 2020

Access type parameters in instances of generic units were first checked
with Subtypes_Match routine, and then their designated types were
checked for matching constrained-ness; diagnostic code guarded by both
conditions was duplicated.

It turns out that the constrained-ness condition was never active, so
the duplicated diagnostic was dead. Actually, this condition seems
redundant, as it only detects a subset of what Subtypes_Match already
detects (at least this happens on 3 ACATS tests, bc3503[def], and the
constrained-ness condition is not active at all on any other test).

This patch removes both the dead condition and the duplicated code.

Tested on x86_64-pc-linux-gnu, committed on trunk


	* sem_ch12.adb (Instantiate_Type): Remove extra whitespace.
	(Validate_Access_Type_Instance): Remove dead (and duplicated)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-diff
Size: 1596 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201125/083f0776/attachment-0001.bin>

More information about the Gcc-patches mailing list