https://gcc.gnu.org/g:b014d250119378663d4a5d4a650fa53bbaca1c3f
commit r15-6634-gb014d250119378663d4a5d4a650fa53bbaca1c3f Author: Piotr Trojanek <troja...@adacore.com> Date: Tue Mar 26 16:52:08 2024 +0100 ada: Untangle check for restriction No_Implementation_Attributes Code cleanup; given that no attribute is both defined by Ada 83 and specific to GNAT, the semantics is unaffected. gcc/ada/ChangeLog: * sem_attr.adb (Analyze_Attribute): Simplify logic. Diff: --- gcc/ada/sem_attr.adb | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 53b96501d788..39725d23442b 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3214,26 +3214,23 @@ package body Sem_Attr is -- Deal with Ada 83 issues - if not Attribute_83 (Attr_Id) then - if Ada_Version = Ada_83 then - Error_Msg_Name_1 := Aname; - Error_Msg_N ("(Ada 83) attribute% is not standard??", N); - end if; - - if Attribute_Impl_Def (Attr_Id) then - Check_Restriction (No_Implementation_Attributes, N); - end if; + if not Attribute_83 (Attr_Id) and then Ada_Version = Ada_83 then + Error_Msg_Name_1 := Aname; + Error_Msg_N ("(Ada 83) attribute% is not standard??", N); end if; -- Deal with Ada 2005 attributes that are implementation attributes -- because they appear in a version of Ada before Ada 2005, ditto for -- Ada 2012 and Ada 2022 attributes appearing in an earlier version. + -- Likewise for GNAT implementation-defined attributes. if (Attribute_05 (Attr_Id) and then Ada_Version < Ada_2005) or else (Attribute_12 (Attr_Id) and then Ada_Version < Ada_2012) or else (Attribute_22 (Attr_Id) and then Ada_Version < Ada_2022) + or else + Attribute_Impl_Def (Attr_Id) then Check_Restriction (No_Implementation_Attributes, N); end if;