diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2022-11-09 13:32:05 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2022-11-21 11:10:31 +0100 |
commit | 8bebbf7b463693316a1518ba31c04648cb629b23 (patch) | |
tree | 29016d8872d939b61e42526103afac78a92a3eff | |
parent | ec8ec09f9414be871e322fecf4ebf53e3687bd22 (diff) | |
download | gcc-8bebbf7b463693316a1518ba31c04648cb629b23.zip gcc-8bebbf7b463693316a1518ba31c04648cb629b23.tar.gz gcc-8bebbf7b463693316a1518ba31c04648cb629b23.tar.bz2 |
ada: Tweak error messages on misplaced with keywords
Before this patch, with clauses placed in declarative sections were
interpreted by the compiler as incorrect aspect specifications, which
led to confusing error messages.
This patch makes it so more syntax errors involving the with keyword
are diagnosed as intended with clauses instead of aspect
specifications.
gcc/ada/
* par-ch3.adb (P_Declarative_Item): Tweak handling of with keyword.
-rw-r--r-- | gcc/ada/par-ch3.adb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index aac4589..483f96d 100644 --- a/gcc/ada/par-ch3.adb +++ b/gcc/ada/par-ch3.adb @@ -4682,7 +4682,7 @@ package body Ch3 is when Tok_With => Check_Bad_Layout; - if Aspect_Specifications_Present then + if Aspect_Specifications_Present (Strict => True) then -- If we are after a semicolon, complain that it was ignored. -- But we don't really ignore it, since we dump the aspects, |