aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2017-01-13 10:57:01 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-13 11:57:01 +0100
commit36be008200548cc009cff3f9855ac94708a175dd (patch)
treedddc84d08fe3180c135f5b669006363b48661a69
parent804ec349d065e79f5f54d513156a46b3d95b69bf (diff)
downloadgcc-36be008200548cc009cff3f9855ac94708a175dd.zip
gcc-36be008200548cc009cff3f9855ac94708a175dd.tar.gz
gcc-36be008200548cc009cff3f9855ac94708a175dd.tar.bz2
sem_ch6.adb (Analyze_Subprogram_Body_Helper): Ensure that the input body is a subprogram body before trying to determine...
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
-rw-r--r--gcc/ada/ChangeLog7
-rw-r--r--gcc/ada/sem_ch6.adb1
2 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index ba0408a..126c6d4 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -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
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 86bbb53..08a1bb9 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -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);