sem_ch6.adb (Analyze_Subprogram_Body_Helper): Ensure that the input body is a subprog...
authorHristian Kirtchev <kirtchev@adacore.com>
Fri, 13 Jan 2017 10:57:01 +0000 (10:57 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 13 Jan 2017 10:57:01 +0000 (11:57 +0100)
2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_ch6.adb (Analyze_Subprogram_Body_Helper):
Ensure that the input body is a subprogram body before trying to
determine whether it denoted an expression function.  Note that
subprogram body stubs cannot denote expression functions.

From-SVN: r244421

gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb

index ba0408a44f073a05486da6e37196e65c9f0251a0..126c6d4bbb5004ce699fe737495234f2be6142bf 100644 (file)
@@ -1,3 +1,10 @@
+2017-01-13  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_ch6.adb (Analyze_Subprogram_Body_Helper):
+       Ensure that the input body is a subprogram body before trying to
+       determine whether it denoted an expression function.  Note that
+       subprogram body stubs cannot denote expression functions.
+
 2017-01-13  Gary Dismukes  <dismukes@adacore.com>
 
        * bindgen.adb, sem_ch6.adb, binde.adb, exp_ch3.adb: Minor reformatting
index 86bbb532771b962755ea785537ff41f4989f6d33..08a1bb975c21fc4c417f7bd30c1d0fc5cc6b0390 100644 (file)
@@ -3503,6 +3503,7 @@ package body Sem_Ch6 is
             --  freezing.
 
             if Has_Completion (Spec_Id)
+              and then Nkind (N) = N_Subprogram_Body
               and then Was_Expression_Function (N)
             then
                Freeze_Expr_Types (Spec_Id);