[Ada] Remove dead and duplicated diagnostics for generic access types
Pierre-Marie de Rodat
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...
Size: 1596 bytes
Desc: not available
More information about the Gcc-patches