diff options
Diffstat (limited to 'gcc/ada/lib-xref.adb')
-rw-r--r-- | gcc/ada/lib-xref.adb | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index bc663a1a93c..64ae4b7fcf1 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2003, Free Software Foundation, Inc. -- +-- Copyright (C) 1998-2004, 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- -- @@ -604,9 +604,7 @@ package body Lib.Xref is exit; end if; - -- For a subtype, go to ancestor subtype. If it is a - -- subtype created for a generic actual, not clear yet - -- what is the right type to use ??? + -- For a subtype, go to ancestor subtype. else Tref := Ancestor_Subtype (Tref); @@ -651,6 +649,19 @@ package body Lib.Xref is if Sloc (Tref) = Standard_Location or else Comes_From_Source (Tref) then + -- If the reference is a subtype created for a generic + -- actual, go to actual directly, the inner subtype is + -- not user visible. + + if Nkind (Parent (Tref)) = N_Subtype_Declaration + and then not Comes_From_Source (Parent (Tref)) + and then + (Is_Wrapper_Package (Scope (Tref)) + or else Is_Generic_Instance (Scope (Tref))) + then + Tref := Base_Type (Tref); + end if; + return; end if; end loop; |