From: Piotr Trojanek Date: Wed, 14 Feb 2024 17:06:36 +0000 (+0100) Subject: ada: Cleanup reporting locations for Ada 2022 and GNAT extension aspects X-Git-Tag: basepoints/gcc-16~9013 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=492f896e3a224a09c5f693249dc302dda435fae7;p=thirdparty%2Fgcc.git ada: Cleanup reporting locations for Ada 2022 and GNAT extension aspects Code cleanup; semantics is unaffected. gcc/ada/ * sem_ch13.adb (Analyze_Aspect_Specification): Consistently reuse existing constant where possible. --- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 8bc8e84ceb4..ce9f15c1491 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -2417,7 +2417,7 @@ package body Sem_Ch13 is begin if Ada_Version < Ada_2022 then - Error_Msg_Ada_2022_Feature ("aspect %", Sloc (Aspect)); + Error_Msg_Ada_2022_Feature ("aspect %", Loc); return; end if; @@ -2442,7 +2442,7 @@ package body Sem_Ch13 is elsif Is_Imported_Intrinsic then Error_Msg_GNAT_Extension - ("aspect % on intrinsic function", Sloc (Aspect), + ("aspect % on intrinsic function", Loc, Is_Core_Extension => True); else @@ -4133,7 +4133,7 @@ package body Sem_Ch13 is when Aspect_Designated_Storage_Model => if not All_Extensions_Allowed then - Error_Msg_GNAT_Extension ("aspect %", Sloc (Aspect)); + Error_Msg_GNAT_Extension ("aspect %", Loc); elsif not Is_Type (E) or else Ekind (E) /= E_Access_Type @@ -4148,7 +4148,7 @@ package body Sem_Ch13 is when Aspect_Storage_Model_Type => if not All_Extensions_Allowed then - Error_Msg_GNAT_Extension ("aspect %", Sloc (Aspect)); + Error_Msg_GNAT_Extension ("aspect %", Loc); elsif not Is_Type (E) or else not Is_Immutably_Limited_Type (E) @@ -4479,7 +4479,7 @@ package body Sem_Ch13 is -- Ada 2022 (AI12-0363): Full_Access_Only elsif A_Id = Aspect_Full_Access_Only then - Error_Msg_Ada_2022_Feature ("aspect %", Sloc (Aspect)); + Error_Msg_Ada_2022_Feature ("aspect %", Loc); -- Ada 2022 (AI12-0075): static expression functions