This ACATS test shows that we are not checking legality of functions
returning interfaces that need to be abstract.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-16 Arnaud Charlet <char...@adacore.com>
gcc/ada/
* sem_ch6.adb (Analyze_Subprogram_Specification): Generate error
message for functions returning interfaces.
--- gcc/ada/sem_ch6.adb
+++ gcc/ada/sem_ch6.adb
@@ -5464,9 +5464,7 @@ package body Sem_Ch6 is
N_Formal_Abstract_Subprogram_Declaration,
N_Subprogram_Renaming_Declaration)
then
- if Is_Abstract_Type (Etype (Designator))
- and then not Is_Interface (Etype (Designator))
- then
+ if Is_Abstract_Type (Etype (Designator)) then
Error_Msg_N
("function that returns abstract type must be abstract", N);