aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Baird <baird@adacore.com>2021-08-04 20:23:31 -0700
committerPierre-Marie de Rodat <derodat@adacore.com>2021-10-01 06:13:35 +0000
commit8e35980ff82ad5a00de3237ad94c1fe942fb0ba4 (patch)
treefe0d9f88a2a4e7b48d8b195965086556997ed4a9
parent1b482832d5699f3cf248ea5dd7341bba8ca85417 (diff)
downloadgcc-8e35980ff82ad5a00de3237ad94c1fe942fb0ba4.zip
gcc-8e35980ff82ad5a00de3237ad94c1fe942fb0ba4.tar.gz
gcc-8e35980ff82ad5a00de3237ad94c1fe942fb0ba4.tar.bz2
[Ada] No ABE check needed for an expression function call.
gcc/ada/ * sem_elab.adb (Is_Safe_Call): Return True in the case of a (possibly rewritten) call to an expression function.
-rw-r--r--gcc/ada/sem_elab.adb7
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 7635ae1..122a837 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -13621,6 +13621,13 @@ package body Sem_Elab is
then
return True;
+ -- A call to an expression function that is not a completion cannot
+ -- cause an ABE because it has no prior declaration; this remains
+ -- true even if the FE transforms the callee into something else.
+
+ elsif Nkind (Original_Node (Spec_Decl)) = N_Expression_Function then
+ return True;
+
-- Subprogram bodies which wrap attribute references used as actuals
-- in instantiations are always ABE-safe. These bodies are artifacts
-- of expansion.