aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2020-05-18 15:41:09 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-07-08 10:55:51 -0400
commit01f27c64770ae34cb659679e2c25f2fea44fbbb6 (patch)
treecc5d1b220aa0c54cce9c2b855f4a8474887cbf9c /gcc
parent5fae483372b3e4da5b5e00b0ccf9557335e9e421 (diff)
downloadgcc-01f27c64770ae34cb659679e2c25f2fea44fbbb6.zip
gcc-01f27c64770ae34cb659679e2c25f2fea44fbbb6.tar.gz
gcc-01f27c64770ae34cb659679e2c25f2fea44fbbb6.tar.bz2
[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.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/sem_ch13.adb12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 476503c..e440069 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