From caa64a44ace7776c08a1ca261380bee9a74e2dff Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Wed, 27 Apr 2016 14:47:56 +0200 Subject: [multiple changes] 2016-04-27 Hristian Kirtchev * sem_prag.adb (Process_Atomic_Independent_Shared_Volatile): Code cleanup. Check the original node when trying to determine the node kind of pragma Volatile's argument to account for untagged derivations where the type is transformed into a constrained subtype. 2016-04-27 Olivier Hainque * mkdir.c (__gnat_mkdir): Rework the vxworks section to use a consistent posix interface on the caller side. 2016-04-27 Ed Schonberg * sem_ch10.adb (Build_Limited_View, Decorate_Type): If this is a limited view of a type, initialize the Limited_Dependents field to catch misuses of the type in a client unit. 2016-04-27 Thomas Quinot * a-strunb-shared.adb (Finalize): add missing Reference call. * s-strhas.adb: minor grammar fix and extension of comment * sem_ch8.adb: minor whitespace fixes 2016-04-27 Ed Schonberg * lib-xref.adb (Get_Type_Reference): Handle properly the case of an object declaration whose type definition is a class-wide subtype and whose expression is a function call that returns a classwide type. 2016-04-27 Hristian Kirtchev * sem_util.ads, sem_util.adb (Output_Entity): New routine. (Output_Name): New routine. 2016-04-27 Bob Duff * exp_ch3.adb (Rewrite_As_Renaming): Disable previous change for now. From-SVN: r235495 --- gcc/ada/lib-xref.adb | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'gcc/ada/lib-xref.adb') diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index d64b4b2..c3039cd 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2015, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2016, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -1467,17 +1467,23 @@ package body Lib.Xref is -- initialized with a tag-indeterminate call gets a subtype -- of the classwide type during expansion. See if the original -- type in the declaration is named, and return it instead - -- of going to the root type. + -- of going to the root type. The expression may be a class- + -- wide function call whose result is on the secondary stack, + -- which forces the declaration to be rewritten as a renaming, + -- so examine the source declaration. - if Ekind (Tref) = E_Class_Wide_Subtype - and then Nkind (Parent (Ent)) = N_Object_Declaration - and then - Nkind (Original_Node (Object_Definition (Parent (Ent)))) - = N_Identifier - then - Tref := - Entity - (Original_Node ((Object_Definition (Parent (Ent))))); + if Ekind (Tref) = E_Class_Wide_Subtype then + declare + Decl : constant Node_Id := Original_Node (Parent (Ent)); + begin + if Nkind (Decl) = N_Object_Declaration + and then Is_Entity_Name + (Original_Node ((Object_Definition (Decl)))) + then + Tref := + Entity ((Original_Node ((Object_Definition (Decl))))); + end if; + end; end if; -- For anything else, exit -- cgit v1.1