]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Sprint: add guard on printing aspects
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:47:12 +0000 (14:47 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Aug 2018 14:47:12 +0000 (14:47 +0000)
2018-08-21  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sprint.adb: Add guard on printing aspects.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263723 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/sprint.adb

index e9e674b8a1417701f51f0056f5158dbd251c5604..4afe997d33c1059b27fa550549942f423aeeac8d 100644 (file)
@@ -1,3 +1,7 @@
+2018-08-21  Ed Schonberg  <schonberg@adacore.com>
+
+       * sprint.adb: Add guard on printing aspects.
+
 2018-08-21  Javier Miranda  <miranda@adacore.com>
 
        * exp_cg.adb (Generate_CG_Output): Handle calls removed by the
index f19629c6f9ab1aab3cd454bf796066ea7160db29..79788237b7fbc3046d2831ff905da437a37986aa 100644 (file)
@@ -3540,8 +3540,10 @@ package body Sprint is
       --  where the aspects are printed inside the package specification.
 
       if Has_Aspects (Node)
-         and then not Nkind_In (Node, N_Package_Declaration,
-                                      N_Generic_Package_Declaration)
+        and then not Nkind_In (Node, N_Package_Declaration,
+                               N_Generic_Package_Declaration)
+        and then not Is_Empty_List (Aspect_Specifications (Node))
+        and then not Is_Empty_List (Aspect_Specifications (Node))
       then
          Sprint_Aspect_Specifications (Node, Semicolon => True);
       end if;