From: Eric Botcazou <ebotca...@adacore.com>

This happens for example with:

  A : constant array (Natural range <>) of String := [ "xor" [;

The problem is that the left bracket token is incorrectly classified as
a name extension, but there is no handler in the Scan_Name_Extension_OK
part of P_Name in Par.Ch4.

gcc/ada/ChangeLog:

        PR ada/112821
        * scans.ads (Token_Type): Remove Tok_Left_Bracket from Namext.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/scans.ads | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads
index 44c20fcf3d2..c445635262a 100644
--- a/gcc/ada/scans.ads
+++ b/gcc/ada/scans.ads
@@ -93,10 +93,11 @@ package Scans is
       Tok_Raise,                    -- RAISE
       Tok_Right_Curly_Bracket,      -- }
 
+      Tok_Left_Bracket,    -- [
+
       Tok_Dot,             -- .            Namext
       Tok_Apostrophe,      -- '            Namext
 
-      Tok_Left_Bracket,    -- [            Namext
       Tok_Left_Paren,      -- (            Namext, Consk
 
       Tok_Delta,           -- DELTA        Atkwd, Sterm, Consk
-- 
2.43.0

Reply via email to