diff mbox series

[FYI,Ada] reenable ada83 library unit renaming error

Message ID orpms8jjrg.fsf@lxoliva.fsfla.org
State New
Headers show
Series [FYI,Ada] reenable ada83 library unit renaming error | expand

Commit Message

Alexandre Oliva Oct. 14, 2021, 4:46 a.m. UTC
The condition of the 'if' encompassed that of the 'elsif', so the error
message wouldn't get a chance to be printed.

Regstrapped on x86_64-linux-gnu.  I'm checking this in.

for  gcc/ada/ChangeLog

	* par-ch10.adb (P_Compilation_Unit): Reenable ada83 library
	unit renaming test and error.
---
 gcc/ada/par-ch10.adb |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb
index f02934afc7e44..76f0edddc94c6 100644
--- a/gcc/ada/par-ch10.adb
+++ b/gcc/ada/par-ch10.adb
@@ -532,13 +532,14 @@  package body Ch10 is
                                | N_Subprogram_Body
                                | N_Subprogram_Renaming_Declaration
          then
-            Unit_Node := Specification (Unit_Node);
-
-         elsif Nkind (Unit_Node) = N_Subprogram_Renaming_Declaration then
-            if Ada_Version = Ada_83 then
+            if Nkind (Unit_Node) = N_Subprogram_Renaming_Declaration
+              and then Ada_Version = Ada_83
+            then
                Error_Msg_N
                  ("(Ada 83) library unit renaming not allowed", Unit_Node);
             end if;
+
+            Unit_Node := Specification (Unit_Node);
          end if;
 
          if Nkind (Unit_Node) in N_Task_Body