Commit 16397eff by Thomas Quinot Committed by Arnaud Charlet

sem_res.adb (Resolve_Actuals): Do not resolve the expression of an actual that…

sem_res.adb (Resolve_Actuals): Do not resolve the expression of an actual that is a view conversion of a bit...

2005-07-04  Thomas Quinot  <quinot@adacore.com>

	* sem_res.adb (Resolve_Actuals): Do not resolve the expression of an
	actual that is a view conversion of a bit packed array reference.

From-SVN: r101590
parent c2bf339e
...@@ -2582,12 +2582,15 @@ package body Sem_Res is ...@@ -2582,12 +2582,15 @@ package body Sem_Res is
-- If the formal is Out or In_Out, do not resolve and expand the -- If the formal is Out or In_Out, do not resolve and expand the
-- conversion, because it is subsequently expanded into explicit -- conversion, because it is subsequently expanded into explicit
-- temporaries and assignments. However, the object of the -- temporaries and assignments. However, the object of the
-- conversion can be resolved. An exception is the case of -- conversion can be resolved. An exception is the case of a
-- a tagged type conversion with a class-wide actual. In that -- tagged type conversion with a class-wide actual. In that case
-- case we want the tag check to occur and no temporary will -- we want the tag check to occur and no temporary will be needed
-- will be needed (no representation change can occur) and -- (no representation change can occur) and the parameter is
-- the parameter is passed by reference, so we go ahead and -- passed by reference, so we go ahead and resolve the type
-- resolve the type conversion. -- conversion. Another excpetion is the case of reference to a
-- component or subcomponent of a bit-packed array, in which case
-- we want to defer expansion to the point the in and out
-- assignments are performed.
if Ekind (F) /= E_In_Parameter if Ekind (F) /= E_In_Parameter
and then Nkind (A) = N_Type_Conversion and then Nkind (A) = N_Type_Conversion
...@@ -2628,8 +2631,9 @@ package body Sem_Res is ...@@ -2628,8 +2631,9 @@ package body Sem_Res is
end if; end if;
end if; end if;
if Conversion_OK (A) if (Conversion_OK (A)
or else Valid_Conversion (A, Etype (A), Expression (A)) or else Valid_Conversion (A, Etype (A), Expression (A)))
and then not Is_Ref_To_Bit_Packed_Array (Expression (A))
then then
Resolve (Expression (A)); Resolve (Expression (A));
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment