From: Eric Botcazou Date: Tue, 10 Mar 2020 11:14:49 +0000 (+0100) Subject: [Ada] Add missing Sloc on new explicit dereferences X-Git-Tag: basepoints/gcc-12~7085 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c0c89cb163ec78c3dd1ca7cdffe026c706bedd7;p=thirdparty%2Fgcc.git [Ada] Add missing Sloc on new explicit dereferences 2020-06-10 Eric Botcazou gcc/ada/ * sem_util.adb (Copy_And_Maybe_Dereference): Temporarily copy the parent node of the original tree when dereferencing. --- diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index fe6e8c942000..2b5c211d0836 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -1355,6 +1355,9 @@ package body Sem_Util is begin if Is_Access_Type (Etype (New_N)) then + -- Copy the parent to have a proper Sloc on the dereference + + Set_Parent (New_N, Parent (N)); Insert_Explicit_Dereference (New_N); end if;