diff options
-rw-r--r-- | gcc/ada/par-ch4.adb | 2 | ||||
-rw-r--r-- | gcc/ada/scng.adb | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb index e4ce02f..cc5ed03 100644 --- a/gcc/ada/par-ch4.adb +++ b/gcc/ada/par-ch4.adb @@ -1395,7 +1395,7 @@ package body Ch4 is begin Lparen_Sloc := Token_Ptr; - if Token = Tok_Left_Bracket and then Ada_Version >= Ada_2020 then + if Token = Tok_Left_Bracket then Scan; -- Special case for null aggregate in Ada 2020 diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb index 2bac3a8..a2bd176 100644 --- a/gcc/ada/scng.adb +++ b/gcc/ada/scng.adb @@ -1378,14 +1378,19 @@ package body Scng is -- Left bracket when '[' => - if Source (Scan_Ptr + 1) = '"' then - goto Scan_Wide_Character; - elsif Ada_Version >= Ada_2020 then + -- [] under -gnatX is an aggregate notation and the special + -- wide character notation becomes unsupported since the two + -- are ambiguous. + + if Extensions_Allowed then Scan_Ptr := Scan_Ptr + 1; Token := Tok_Left_Bracket; return; + elsif Source (Scan_Ptr + 1) = '"' then + goto Scan_Wide_Character; + else Error_Msg_S ("illegal character, replaced by ""("""); Scan_Ptr := Scan_Ptr + 1; |