Commit 1ae70618 by Ed Schonberg Committed by Arnaud Charlet

checks.adb: minor clarification.

2014-01-29  Ed Schonberg  <schonberg@adacore.com>

	* checks.adb: minor clarification.
	* sem_ch7.adb (Declare_Inherited_Private_Subprograms): Limit
	search for primitive operations to the entities that immediately
	follow the type declaration.

From-SVN: r207248
parent cca7f107
2014-01-29 Ed Schonberg <schonberg@adacore.com>
* checks.adb: minor clarification.
* sem_ch7.adb (Declare_Inherited_Private_Subprograms): Limit
search for primitive operations to the entities that immediately
follow the type declaration.
2014-01-29 Tristan Gingold <gingold@adacore.com> 2014-01-29 Tristan Gingold <gingold@adacore.com>
* exp_ch9.adb (Build_Protected_Entry): Do not call * exp_ch9.adb (Build_Protected_Entry): Do not call
......
...@@ -6694,8 +6694,9 @@ package body Checks is ...@@ -6694,8 +6694,9 @@ package body Checks is
if (not Inside_Init_Proc or else SPARK_Mode = On) if (not Inside_Init_Proc or else SPARK_Mode = On)
-- Do not emit the warning within a conditional expression -- Do not emit the warning within a conditional expression,
-- Why not ??? -- where the expression might not be evaluated, and the warning
-- appear as extraneous noise.
and then not Within_Case_Or_If_Expression (N) and then not Within_Case_Or_If_Expression (N)
then then
......
...@@ -1812,6 +1812,15 @@ package body Sem_Ch7 is ...@@ -1812,6 +1812,15 @@ package body Sem_Ch7 is
end if; end if;
Next_Entity (Prim_Op); Next_Entity (Prim_Op);
-- Derived operations appear immediately after the type
-- declaration (or the following subtype indication for
-- a derived scalar type). Further declarations cannot
-- include inherited operations of the type.
if Present (Prim_Op) then
exit when Ekind (Prim_Op) not in Overloadable_Kind;
end if;
end loop; end loop;
end if; end if;
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