diff mbox series

[Ada] ACATS 4.1P - BC55001 - Error missed

Message ID 20200616130745.GA86911@adacore.com
State New
Headers show
Series [Ada] ACATS 4.1P - BC55001 - Error missed | expand

Commit Message

Pierre-Marie de Rodat June 16, 2020, 1:07 p.m. UTC
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  <charlet@adacore.com>

gcc/ada/

	* sem_ch6.adb (Analyze_Subprogram_Specification): Generate error
	message for functions returning interfaces.
diff mbox series

Patch

--- 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);