diff options
author | Ronan Desplanques <desplanques@adacore.com> | 2024-01-03 12:09:03 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-06 11:11:31 +0200 |
commit | 615c33804f6a1d3f6dcc02308f59b24c735881dc (patch) | |
tree | b94c054f160d37c21b977f0c78c3fd3f27ecc998 /gcc/ada | |
parent | 98b26f695bdcb1e4eee2c27742fd6ab534bb7d55 (diff) | |
download | gcc-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.adb | 3 |
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; |