Commit 967fb65e by Arnaud Charlet

[multiple changes]

2012-10-05  Robert Dewar  <dewar@adacore.com>

	* sem_util.adb (Has_One_Matching_Field): Handle case of lone
	discriminant.

2012-10-05  Yannick Moy  <moy@adacore.com>

	* checks.adb (Minimize_Eliminate_Overflow_Checks): Correct code
	for the division operation and exponent operation. Adjust bound
	for the mod and rem operations.

From-SVN: r192126
parent 60b68e56
2012-10-05 Robert Dewar <dewar@adacore.com>
* sem_util.adb (Has_One_Matching_Field): Handle case of lone
discriminant.
2012-10-05 Yannick Moy <moy@adacore.com>
* checks.adb (Minimize_Eliminate_Overflow_Checks): Correct code
for the division operation and exponent operation. Adjust bound
for the mod and rem operations.
2012-10-05 Robert Dewar <dewar@adacore.com>
* checks.adb, checks.ads, s-tassta.adb, s-stposu.adb, s-spsufi.adb,
s-spsufi.ads, exp_ch4.adb: Minor reformatting.
......
......@@ -13622,7 +13622,9 @@ package body Sem_Util is
function Has_One_Matching_Field return Boolean;
-- Determines if Expec_Type is a record type with a single component or
-- discriminant whose type matches the found type or is one dimensional
-- array whose component type matches the found type.
-- array whose component type matches the found type. In the case of
-- one discriminant, we ignore the variant parts. That's not accurate,
-- but good enough for the warning.
----------------------------
-- Has_One_Matching_Field --
......@@ -13664,10 +13666,10 @@ package body Sem_Util is
if No (E) then
return False;
elsif (Ekind (E) /= E_Discriminant
and then Ekind (E) /= E_Component)
elsif not Ekind_In (E, E_Discriminant, E_Component)
or else (Chars (E) = Name_uTag
or else Chars (E) = Name_uParent)
or else
Chars (E) = Name_uParent)
then
Next_Entity (E);
......@@ -13679,7 +13681,10 @@ package body Sem_Util is
if not Covers (Etype (E), Found_Type) then
return False;
elsif Present (Next_Entity (E)) then
elsif Present (Next_Entity (E))
and then (Ekind (E) = E_Component
or else Ekind (Next_Entity (E)) = E_Discriminant)
then
return False;
else
......
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