Commit c34ce522 authored by charlet's avatar charlet
Browse files

2012-01-30 Javier Miranda <miranda@adacore.com>

PR ada/15846
	* sem_ch8.adb (Analyze_Subprogram_Renaming):
	Handle self-renaming when the renamed entity is referenced using
	its expanded name.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183713 138bc75d-0d04-0410-961f-82ee72b054a4
parent 516da07f
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2011, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -2665,7 +2665,10 @@ package body Sem_Ch8 is ...@@ -2665,7 +2665,10 @@ package body Sem_Ch8 is
if not Is_Actual if not Is_Actual
and then (Old_S = New_S and then (Old_S = New_S
or else (Nkind (Nam) /= N_Expanded_Name or else (Nkind (Nam) /= N_Expanded_Name
and then Chars (Old_S) = Chars (New_S))) and then Chars (Old_S) = Chars (New_S))
or else (Nkind (Nam) = N_Expanded_Name
and then Entity (Prefix (Nam)) = Current_Scope
and then Chars (Selector_Name (Nam)) = Chars (New_S)))
then then
Error_Msg_N ("subprogram cannot rename itself", N); Error_Msg_N ("subprogram cannot rename itself", N);
end if; end if;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment