summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-17 21:07:05 +0000
committerbosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4>2001-12-17 21:07:05 +0000
commit26bdbe289ff47a014f2bf4aa06bf3d12d54ca755 (patch)
treea224052d9d5171d179321515f61186deba4f2b92 /gcc/ada/sem_ch3.adb
parent8880be8571f9ef03b3cd47702aa15d31f4c0dad3 (diff)
downloadgcc-26bdbe289ff47a014f2bf4aa06bf3d12d54ca755.tar.gz
* sem_ch3.adb (Analyze_Variant_Part): check that type of discriminant
is discrete before analyzing choices. * bindgen.adb (Gen_Output_File_Ada): Generate a new C-like string containing the name of the Ada Main Program. This string is mainly intended for the debugger. (Gen_Output_File_C): Do the equivalent change when generating a C file. * ali.adb: Set new Dummy_Entry field in dependency entry * ali.ads: Add Dummy_Entry field to source dependency table * bcheck.adb (Check_Consistency): Ignore dummy D lines * lib-writ.adb (Writ_ALI): Write dummy D lines for missing source files * lib-writ.ads: Document dummy D lines for missing files. * types.ads: (Dummy_Time_Stamp): New value for non-existant files git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@48126 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index eb3d2939405..d1076c85ef9 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.10 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
@@ -2609,6 +2609,13 @@ package body Sem_Ch3 is
Discr_Type := Etype (Entity (Discr_Name));
+ if not Is_Discrete_Type (Discr_Type) then
+ Error_Msg_N
+ ("discriminant in a variant part must be of a discrete type",
+ Name (N));
+ return;
+ end if;
+
-- Call the instantiated Analyze_Choices which does the rest of the work
Analyze_Choices