aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.cc
diff options
context:
space:
mode:
authorDenis Mazzucato <mazzucato@adacore.com>2025-12-06 19:13:26 +0100
committerEric Botcazou <ebotcazou@adacore.com>2025-12-06 19:16:54 +0100
commit55d31324ac5c2763e9c9eb647c5ec068af24baf3 (patch)
tree3b29496f4c19c59f4cf148105a9215e495688c51 /gcc/fortran/resolve.cc
parent951f3ccefca097d483aef1f65a283c8c68b73ab6 (diff)
downloadgcc-55d31324ac5c2763e9c9eb647c5ec068af24baf3.zip
gcc-55d31324ac5c2763e9c9eb647c5ec068af24baf3.tar.gz
gcc-55d31324ac5c2763e9c9eb647c5ec068af24baf3.tar.bz2
Ada: Fix spurious warning if the reducer subprogram is a procedure
If the reducer is a function and the accumulator type isn't constrained, at runtime the reduction will likely raise a Constraint_Error since the reducer is repeatedly assigned to the accumulator variable (likely changing its length). However, if the reducer is a procedure, no such assignment occurs, and thus the runtime error only depends on the reducer logic. This patch prevents the spurious warning in that case. gcc/ada/ * sem_attr.adb (Resolve_Attribute): Check if the reducer is a procedure before giving the warning.
Diffstat (limited to 'gcc/fortran/resolve.cc')
0 files changed, 0 insertions, 0 deletions