This patch improves the handling of programs with illegal placement of aspect specifications, ensuring that the flag that controls the parsing of a list of declarations is properly set in the presence of errors.
No simple test available. Tested on x86_64-pc-linux-gnu, committed on trunk 2015-10-20 Ed Schonberg <schonb...@adacore.com> * par-ch3.adb (P_Declarative_Items): In case of misplaced aspect specifications, ensure that flag Done is properly set to continue parse.
Index: par-ch3.adb =================================================================== --- par-ch3.adb (revision 229023) +++ par-ch3.adb (working copy) @@ -4425,6 +4425,12 @@ else Error_Msg_SC ("aspect specifications not allowed here"); + + -- Assume that this is a misplaced aspect specification + -- within a declarative list. After discarding the + -- misplaced aspects we can continue the scan. + + Done := False; end if; declare