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.
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;