Improve previous patch since the regression reproduces also
compiling under check syntax and semantic only mode (-gnatc).
gcc/ada/ChangeLog:
* sem_res.adb (Resolve_Declare_Expression): Do not create a
transient scope when expansion is disabled.
-- Given that we don't know yet if secondary stack management will
-- be needed, we assume the worst case.
- if not Preanalysis_Active
- and then not GNATprove_Mode
+ if Expander_Active
and then (Requires_Transient_Scope (Typ)
or else Has_Sec_Stack_Call (Expr))
then