From: Ghjuvan Lacambre Date: Mon, 18 May 2020 13:41:09 +0000 (+0200) Subject: [Ada] Add expected and actual size to "bit number out of range" error message X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=01f27c64770ae34cb659679e2c25f2fea44fbbb6;p=gcc.git [Ada] Add expected and actual size to "bit number out of range" error message gcc/ada/ * sem_ch13.adb (Analyze_Record_Representation_Clause, Check_Record_Representation_Clause): Add expected and actual size to error message. --- diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb index 476503c2e78..e440069c7da 100644 --- a/gcc/ada/sem_ch13.adb +++ b/gcc/ada/sem_ch13.adb @@ -8105,8 +8105,10 @@ package body Sem_Ch13 is if Has_Size_Clause (Rectype) and then RM_Size (Rectype) <= Lbit then - Error_Msg_N - ("bit number out of range of specified size", + Error_Msg_Uint_1 := RM_Size (Rectype); + Error_Msg_Uint_2 := Lbit + 1; + Error_Msg_N ("bit number out of range of specified " + & "size (expected ^, got ^)", Last_Bit (CC)); else Set_Component_Clause (Comp, CC); @@ -11552,8 +11554,10 @@ package body Sem_Ch13 is if Has_Size_Clause (Rectype) and then RM_Size (Rectype) <= Lbit then - Error_Msg_N - ("bit number out of range of specified size", + Error_Msg_Uint_1 := RM_Size (Rectype); + Error_Msg_Uint_2 := Lbit + 1; + Error_Msg_N ("bit number out of range of specified " + & "size (expected ^, got ^)", Last_Bit (CC)); -- Check for overlap with tag or parent component