From: Arnaud Charlet Date: Mon, 26 Oct 2015 10:49:55 +0000 (+0100) Subject: [multiple changes] X-Git-Tag: basepoints/gcc-7~3627 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e4bda61026bf4b79fecf43698ac76c0ee1de3266;p=thirdparty%2Fgcc.git [multiple changes] 2015-10-26 Ed Schonberg * 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 * treepr.adb: Code clean up. From-SVN: r229326 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 5dff6de4fca1..442dafe0853e 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2015-10-26 Ed Schonberg + + * 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 + + * treepr.adb: Code clean up. + 2015-10-26 Eric Botcazou * freeze.adb (Check_Component_Storage_Order): Skip a record diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 0f2615861f8f..495df3d653e8 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -7310,6 +7310,19 @@ package body Sem_Ch6 is then 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 if Nkind (N) /= N_Subprogram_Body_Stub then Set_Corresponding_Spec (N, E); diff --git a/gcc/ada/treepr.adb b/gcc/ada/treepr.adb index d11a12bbe9c6..a032416587bb 100644 --- a/gcc/ada/treepr.adb +++ b/gcc/ada/treepr.adb @@ -1565,13 +1565,9 @@ package body Treepr is Print_Elist_Ref (E); Print_Eol; - M := First_Elmt (E); - - if No (M) then - Print_Str (""); - Print_Eol; + if Present (E) and then not Is_Empty_Elmt_List (E) then + M := First_Elmt (E); - else loop Print_Char ('|'); Print_Eol;