From 01f27c64770ae34cb659679e2c25f2fea44fbbb6 Mon Sep 17 00:00:00 2001 From: Ghjuvan Lacambre Date: Mon, 18 May 2020 15:41:09 +0200 Subject: [PATCH] [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. --- gcc/ada/sem_ch13.adb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 -- 2.30.2