aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorYannick Moy <moy@adacore.com>2024-07-24 17:36:20 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-08-06 10:54:32 +0200
commitcfa788bc679bb552640493c4486dde5bd84d1400 (patch)
tree719d71840d107fcdfbf3869baa0e73e157485965 /gcc/ada/sem_ch4.adb
parent891427f2549e38ce393efa92c760c4dd9e50f59f (diff)
downloadgcc-cfa788bc679bb552640493c4486dde5bd84d1400.zip
gcc-cfa788bc679bb552640493c4486dde5bd84d1400.tar.gz
gcc-cfa788bc679bb552640493c4486dde5bd84d1400.tar.bz2
ada: Fix error in GNATprove inlining with array concatenation
Wrong interpretation of the type of the concatenation can lead to a spurious error in GNATprove when inlining code. Now fixed. gcc/ada/ * sem_ch4.adb (Analyze_Concatenation_Rest): Do not add a wrong interpretation of the concatenation, using the type of the operand already recognized as of the element type.
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index fc3a2a4..9b77a81 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -1995,6 +1995,7 @@ package body Sem_Ch4 is
(Root_Type (LT) = Standard_String
or else Scope (LT) /= Standard_Standard)
and then Etype (R) = Any_String
+ and then not Is_Component_Left_Opnd (N)
then
Add_One_Interp (N, Op_Id, LT);
@@ -2002,6 +2003,7 @@ package body Sem_Ch4 is
(Root_Type (RT) = Standard_String
or else Scope (RT) /= Standard_Standard)
and then Etype (L) = Any_String
+ and then not Is_Component_Right_Opnd (N)
then
Add_One_Interp (N, Op_Id, RT);