When the type of the expression of an expression function is
an incomplete type, the frontend does not report the expected
error.
gcc/ada/ChangeLog:
* sem_ch6.adb (Analyze_Expression_Function): Add missing check
on premature use of incomplete type.
End_Scope;
end if;
+ if Is_Incomplete_Type (Typ) then
+ Error_Msg_NE
+ ("premature usage of incomplete}", Expr, First_Subtype (Typ));
+ end if;
+
-- In the case of an expression function marked with the aspect
-- Static, we need to check the requirement that the function's
-- expression is a potentially static expression. This is done