[Ada] Spurious error on deferred constant with predicate
gcc/ada/ * sem_ch3.adb (Analyze_Object_Declaration): Do not insert a predicate check after a deferred constant declaration.
This commit is contained in:
parent
c0471c61e1
commit
03b6cc3b3e
@ -4505,7 +4505,7 @@ package body Sem_Ch3 is
|
|||||||
-- default initial value (including via a Default_Value or
|
-- default initial value (including via a Default_Value or
|
||||||
-- Default_Component_Value aspect, see AI12-0301) and then this is not
|
-- Default_Component_Value aspect, see AI12-0301) and then this is not
|
||||||
-- an internal declaration whose initialization comes later (as for an
|
-- an internal declaration whose initialization comes later (as for an
|
||||||
-- aggregate expansion).
|
-- aggregate expansion) or a deferred constant.
|
||||||
-- If expression is an aggregate it may be expanded into assignments
|
-- If expression is an aggregate it may be expanded into assignments
|
||||||
-- and the declaration itself is marked with No_Initialization, but
|
-- and the declaration itself is marked with No_Initialization, but
|
||||||
-- the predicate still applies.
|
-- the predicate still applies.
|
||||||
@ -4519,6 +4519,7 @@ package body Sem_Ch3 is
|
|||||||
(Present (E)
|
(Present (E)
|
||||||
or else
|
or else
|
||||||
Is_Partially_Initialized_Type (T, Include_Implicit => False))
|
Is_Partially_Initialized_Type (T, Include_Implicit => False))
|
||||||
|
and then not (Constant_Present (N) and then No (E))
|
||||||
then
|
then
|
||||||
-- If the type has a static predicate and the expression is known at
|
-- If the type has a static predicate and the expression is known at
|
||||||
-- compile time, see if the expression satisfies the predicate.
|
-- compile time, see if the expression satisfies the predicate.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user