[Ada] Reject aspect specifications on number constants
authorGhjuvan Lacambre <lacambre@adacore.com>
Wed, 18 Dec 2019 07:14:39 +0000 (07:14 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 18 Dec 2019 07:14:39 +0000 (07:14 +0000)
2019-12-18  Ghjuvan Lacambre  <lacambre@adacore.com>

gcc/ada/

* par-ch13.adb: Check if declarations allow aspect
specifications.

From-SVN: r279509

gcc/ada/ChangeLog
gcc/ada/par-ch13.adb

index 0323aad..1700070 100644 (file)
@@ -1,3 +1,8 @@
+2019-12-18  Ghjuvan Lacambre  <lacambre@adacore.com>
+
+       * par-ch13.adb: Check if declarations allow aspect
+       specifications.
+
 2019-12-18  Piotr Trojanek  <trojanek@adacore.com>
 
        * einfo.ads (Is_Ghost_Entity): Fix typo in comment.
index 25a0df9..e26e83f 100644 (file)
@@ -956,7 +956,9 @@ package body Ch13 is
 
          --  If Decl is Error, we ignore the aspects, and issue a message
 
-         elsif Decl = Error then
+         elsif Decl = Error
+            or else not Permits_Aspect_Specifications (Decl)
+         then
             Error_Msg ("aspect specifications not allowed here", Ptr);
 
          --  Here aspects are allowed, and we store them