Commit e4bda610 by Arnaud Charlet

[multiple changes]

2015-10-26  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch6.adb (Find_Corresponding_Spec): Reject a subprogram
	body whose signature is type conformant with a previous expression
	function.

2015-10-26  Bob Duff  <duff@adacore.com>

	* treepr.adb: Code clean up.

From-SVN: r229326
parent dc9111cf
2015-10-26 Ed Schonberg <schonberg@adacore.com>
* sem_ch6.adb (Find_Corresponding_Spec): Reject a subprogram
body whose signature is type conformant with a previous expression
function.
2015-10-26 Bob Duff <duff@adacore.com>
* treepr.adb: Code clean up.
2015-10-26 Eric Botcazou <ebotcazou@adacore.com> 2015-10-26 Eric Botcazou <ebotcazou@adacore.com>
* freeze.adb (Check_Component_Storage_Order): Skip a record * freeze.adb (Check_Component_Storage_Order): Skip a record
......
...@@ -7310,6 +7310,19 @@ package body Sem_Ch6 is ...@@ -7310,6 +7310,19 @@ package body Sem_Ch6 is
then then
return E; return E;
-- Expression functions can be completions, but cannot be
-- completed by an explicit body.
elsif Comes_From_Source (E)
and then Comes_From_Source (N)
and then Nkind (N) = N_Subprogram_Body
and then Nkind (Original_Node (Unit_Declaration_Node (E))) =
N_Expression_Function
then
Error_Msg_Sloc := Sloc (E);
Error_Msg_N ("body conflicts with expression function#", N);
return Empty;
elsif not Has_Completion (E) then elsif not Has_Completion (E) then
if Nkind (N) /= N_Subprogram_Body_Stub then if Nkind (N) /= N_Subprogram_Body_Stub then
Set_Corresponding_Spec (N, E); Set_Corresponding_Spec (N, E);
......
...@@ -1565,13 +1565,9 @@ package body Treepr is ...@@ -1565,13 +1565,9 @@ package body Treepr is
Print_Elist_Ref (E); Print_Elist_Ref (E);
Print_Eol; Print_Eol;
if Present (E) and then not Is_Empty_Elmt_List (E) then
M := First_Elmt (E); M := First_Elmt (E);
if No (M) then
Print_Str ("<empty element list>");
Print_Eol;
else
loop loop
Print_Char ('|'); Print_Char ('|');
Print_Eol; Print_Eol;
......
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