Commit 3c829e3c by Ed Schonberg Committed by Arnaud Charlet

sem_ch3.adb (Analyze_Component_Declaration): Protect against misuse of incomplete type.

2008-08-06  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch3.adb (Analyze_Component_Declaration): Protect against misuse
	of incomplete type.

	* sem_ch8.adb (Analyze_Object_Renaming): Diagnose properly a renaming
	of a formal parameter of an incomplete type. Improve error message for
	other improper uses of incomplete types.

From-SVN: r138790
parent 65aa315e
...@@ -1667,6 +1667,7 @@ package body Sem_Ch3 is ...@@ -1667,6 +1667,7 @@ package body Sem_Ch3 is
if Ada_Version >= Ada_05 if Ada_Version >= Ada_05
and then Ekind (T) = E_Anonymous_Access_Type and then Ekind (T) = E_Anonymous_Access_Type
and then Etype (E) /= Any_Type
then then
-- Check RM 3.9.2(9): "if the expected type for an expression is -- Check RM 3.9.2(9): "if the expected type for an expression is
-- an anonymous access-to-specific tagged type, then the object -- an anonymous access-to-specific tagged type, then the object
......
...@@ -832,7 +832,10 @@ package body Sem_Ch8 is ...@@ -832,7 +832,10 @@ package body Sem_Ch8 is
if Nkind (Nam) = N_Explicit_Dereference if Nkind (Nam) = N_Explicit_Dereference
and then Ekind (Etype (T2)) = E_Incomplete_Type and then Ekind (Etype (T2)) = E_Incomplete_Type
then then
Error_Msg_N ("invalid use of incomplete type", Id); Error_Msg_NE ("invalid use of incomplete type&", Id, T2);
return;
elsif Ekind (Etype (T)) = E_Incomplete_Type then
Error_Msg_NE ("invalid use of incomplete type&", Id, T);
return; return;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment