aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorRonan Desplanques <desplanques@adacore.com>2024-01-03 12:09:03 +0100
committerMarc Poulhiès <poulhies@adacore.com>2024-05-06 11:11:31 +0200
commit615c33804f6a1d3f6dcc02308f59b24c735881dc (patch)
treeb94c054f160d37c21b977f0c78c3fd3f27ecc998 /gcc/ada
parent98b26f695bdcb1e4eee2c27742fd6ab534bb7d55 (diff)
downloadgcc-615c33804f6a1d3f6dcc02308f59b24c735881dc.zip
gcc-615c33804f6a1d3f6dcc02308f59b24c735881dc.tar.gz
gcc-615c33804f6a1d3f6dcc02308f59b24c735881dc.tar.bz2
ada: Tweak discriminant source locations
This patch changes the source location information for the default expressions of discrimants to better represent the fact that they're evaluated at the point of object declaration, in the cases where a Build_Default_Subtype optimization is performed. This fixes a regression with CodePeer diagnostics introduced by a recent change around Build_Default_Subtype optimizations. gcc/ada/ * sem_util.adb (Build_Default_Subtype): Tweak source location information.
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/sem_util.adb3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index c47904f..18c9de05 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -1780,7 +1780,8 @@ package body Sem_Util is
begin
while Present (Disc) loop
Append_To (Constraints,
- New_Copy_Tree (Discriminant_Default_Value (Disc)));
+ New_Copy_Tree
+ (Discriminant_Default_Value (Disc), New_Sloc => Loc));
Next_Discriminant (Disc);
end loop;