diff options
Diffstat (limited to 'gcc/ada/par-ch5.adb')
-rw-r--r-- | gcc/ada/par-ch5.adb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb index 8992f15a5a7..bf28e23bb9d 100644 --- a/gcc/ada/par-ch5.adb +++ b/gcc/ada/par-ch5.adb @@ -1736,6 +1736,19 @@ package body Ch5 is elsif Token = Tok_In then Scan; -- past IN + elsif Prev_Token = Tok_In + and then Present (Subtype_Indication (Node1)) + then + + -- Simplest recovery is to transform it into an element iterator. + -- Error message on 'in" has already been emitted when parsing the + -- optional constraint. + + Set_Of_Present (Node1); + Error_Msg_N + ("subtype indication is only legal on on element iterator", + Subtype_Indication (Node1)); + else return Error; end if; |