From 3f5a114d2015dfdef4cded64a55ec5404e0ab9e7 Mon Sep 17 00:00:00 2001 From: charlet Date: Wed, 20 Apr 2016 09:14:02 +0000 Subject: 2016-04-20 Arnaud Charlet * snames.ads-tmpl (Internal_Attribute_Id, Attribute_Class_Array): Fix indentation. * sem_util.adb (Is_Unchecked_Conversion_Instance): defense against library-level renamings of other functions, which are never instances of Unchecked_Conversion. * einfo.ads: minor fix of casing in comment 2016-04-20 Ed Schonberg * exp_ch6.adb (Expand_N_Subprogram_Stub): Do not expand a body that has been analyzed and expanded already. Qualify the names in the proper body for use in the generation of C code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235244 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ada/sem_util.adb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'gcc/ada/sem_util.adb') diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index e9e16ae4add..48208309c56 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -14282,6 +14282,7 @@ package body Sem_Util is -------------------------------------- function Is_Unchecked_Conversion_Instance (Id : Entity_Id) return Boolean is + Par : Node_Id; Gen_Par : Entity_Id; begin @@ -14289,7 +14290,13 @@ package body Sem_Util is -- function Unchecked_Conversion. if Ekind (Id) = E_Function then - Gen_Par := Generic_Parent (Parent (Id)); + Par := Parent (Id); + + if Nkind (Par) /= N_Function_Specification then + return False; + end if; + + Gen_Par := Generic_Parent (Par); return Present (Gen_Par) -- cgit v1.2.1