[Ada] Fix anonymous-to-named access type implicit conversion legality checking
2020-06-12 Steve Baird <baird@adacore.com>
gcc/ada/
* sem_res.adb (Valid_Conversion): The simpler cases of
violations of the aforementioned 8.6 rule are already handled
correctly. These include cases where the operand of the type
conversion is an access parameter or a stand-alone object of an
anonymous access type. Add code to detect violations where the
operand of the type conversion is an access discriminant whose
accessibility level is tied to one of the other simpler cases.
This is implemented in a new function,
Valid_Conversion.Is_Discrim_Of_Bad_Access_Conversion_Argument,
which is called in place of the previous test.