diff options
author | Yannick Moy <moy@adacore.com> | 2022-06-16 14:14:56 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2022-07-06 13:29:49 +0000 |
commit | e5802d60130bd804663559471f9c5f3561dfab4d (patch) | |
tree | ee33950872e7f7fb2e230f39891ba3b2b0328727 /gcc/ada/sem_util.adb | |
parent | 870518bfe257908095eb8d299fb0bbf14a4d2920 (diff) | |
download | gcc-e5802d60130bd804663559471f9c5f3561dfab4d.zip gcc-e5802d60130bd804663559471f9c5f3561dfab4d.tar.gz gcc-e5802d60130bd804663559471f9c5f3561dfab4d.tar.bz2 |
[Ada] Deferred constant considered as not preelaborable
Fix detection of non-preelaborable constructs for checking SPARK
elaboration rules, which was tagging deferred constant declarations as
not preelaborable.
gcc/ada/
* sem_util.adb (Is_Non_Preelaborable_Construct): Fix for
deferred constants.
Diffstat (limited to 'gcc/ada/sem_util.adb')
-rw-r--r-- | gcc/ada/sem_util.adb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 942a77a..7b7566d 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -18952,8 +18952,9 @@ package body Sem_Util is if Has_Init_Expression (Nod) then Visit (Expression (Nod)); - elsif not Has_Preelaborable_Initialization - (Etype (Defining_Entity (Nod))) + elsif not Constant_Present (Nod) + and then not Has_Preelaborable_Initialization + (Etype (Defining_Entity (Nod))) then raise Non_Preelaborable; end if; |