From: Ronan Desplanques Date: Wed, 9 Nov 2022 12:32:05 +0000 (+0100) Subject: ada: Tweak error messages on misplaced with keywords X-Git-Tag: basepoints/gcc-14~3019 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8bebbf7b463693316a1518ba31c04648cb629b23;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb index aac45890c97c..483f96d041f1 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,