summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 09:14:02 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 09:14:02 +0000
commit3f5a114d2015dfdef4cded64a55ec5404e0ab9e7 (patch)
treed671cff63143ce6c618c5b9b30e2b7e5fb3bb45d /gcc/ada/sem_util.adb
parent2de214f62d7b317f18fd5ab44d4401c1b7a5663f (diff)
downloadgcc-3f5a114d2015dfdef4cded64a55ec5404e0ab9e7.tar.gz
2016-04-20 Arnaud Charlet <charlet@adacore.com>
* 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 <schonberg@adacore.com> * 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
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r--gcc/ada/sem_util.adb9
1 files changed, 8 insertions, 1 deletions
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)