diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-08-12 18:12:40 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-01 06:13:38 +0000 |
commit | 3a81dbb618e3ac6cd42ac6f296a96296e099ac1f (patch) | |
tree | caf9f9423ed9f5bd2c0e3321bdcacc4966108148 /gcc | |
parent | f54be415c18a2cfb37152ed55666c7e766404e4e (diff) | |
download | gcc-3a81dbb618e3ac6cd42ac6f296a96296e099ac1f.zip gcc-3a81dbb618e3ac6cd42ac6f296a96296e099ac1f.tar.gz gcc-3a81dbb618e3ac6cd42ac6f296a96296e099ac1f.tar.bz2 |
[Ada] Add missing guard before call to Interface_Present_In_Ancestor
gcc/ada/
* sem_type.adb (Specific_Type): Check that the type is tagged
before calling Interface_Present_In_Ancestor on it.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_type.adb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb index 3ca2e30..8e5b067 100644 --- a/gcc/ada/sem_type.adb +++ b/gcc/ada/sem_type.adb @@ -3424,7 +3424,8 @@ package body Sem_Type is -- Ada 2005 (AI-251): T1 is a concrete type that implements the -- class-wide interface T2 - elsif Is_Class_Wide_Type (T2) + elsif Is_Tagged_Type (T1) + and then Is_Class_Wide_Type (T2) and then Is_Interface (Etype (T2)) and then Interface_Present_In_Ancestor (Typ => T1, Iface => Etype (T2)) |