diff options
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 9 |
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 |