diff mbox series

[COMMITTED,13/30] ada: Remove Must_Not_Freeze flags from default value expressions

Message ID 20240801151738.400796-13-poulhies@adacore.com
State New
Headers show
Series [COMMITTED,01/30] ada: Remove obsolete workaround | expand

Commit Message

Marc Poulhiès Aug. 1, 2024, 3:17 p.m. UTC
From: Piotr Trojanek <trojanek@adacore.com>

This is a code cleanup and apparently has no impact on the behavior.

The Must_Not_Freeze is saved/set/restored by Preanalyze_Spec_Expression,
so it doesn't need to be set before calling that routine and apparently
doesn't need to be set after that calling that routine either.

gcc/ada/

	* sem_ch13.adb (Resolve_Aspect_Expression): Don't set
	Must_Not_Freeze before preanalyzing spec expressions.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch13.adb | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index a7936641d34..c8fe7d367c1 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -16060,7 +16060,6 @@  package body Sem_Ch13 is
                   --  before the actual freeze point.
 
                   when Aspect_Default_Value =>
-                     Set_Must_Not_Freeze (Expr);
                      Preanalyze_Spec_Expression (Expr, E);
 
                   when Aspect_CPU
@@ -16076,7 +16075,6 @@  package body Sem_Ch13 is
                   --  relevant to the misuse of deferred constants.
 
                   when Aspect_Storage_Size =>
-                     Set_Must_Not_Freeze (Expr);
                      Preanalyze_Spec_Expression (Expr, Any_Integer);
 
                   when others =>