Commit ab260a3e by Ed Schonberg Committed by Arnaud Charlet

sem_prag.adb (Analyze_Pragma, [...]): Pragma legally applies to an abstract subprogram declaration.

2015-02-20  Ed Schonberg  <schonberg@adacore.com>

	* sem_prag.adb (Analyze_Pragma, case Obsolescent): Pragma
	legally applies to an abstract subprogram declaration.
	* freeze.adb: Minor comment addition.

From-SVN: r220870
parent 2290a0fe
2015-02-20 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Obsolescent): Pragma
legally applies to an abstract subprogram declaration.
* freeze.adb: Minor comment addition.
2015-02-20 Robert Dewar <dewar@adacore.com> 2015-02-20 Robert Dewar <dewar@adacore.com>
* errout.ads: Document replacement of Name_uPre/Post/Type_Invariant. * errout.ads: Document replacement of Name_uPre/Post/Type_Invariant.
......
...@@ -8035,7 +8035,13 @@ package body Freeze is ...@@ -8035,7 +8035,13 @@ package body Freeze is
end if; end if;
-- If a pragma Import follows, we assume that it is for the current -- If a pragma Import follows, we assume that it is for the current
-- target of the address clause, and skip the warning. -- target of the address clause, and skip the warning. There may be
-- a source pragma or an aspect that specifies import and generates
-- the corresponding pragma. These will indicate that the entity is
-- imported and that is checked above so that the spurious warning
-- (generated when the entity is frozen) will be suppressed. The
-- pragma may be attached to the aspect, so it is not yet a list
-- member.
if Is_List_Member (Parent (Expr)) then if Is_List_Member (Parent (Expr)) then
Decl := Next (Parent (Expr)); Decl := Next (Parent (Expr));
......
...@@ -17233,13 +17233,16 @@ package body Sem_Prag is ...@@ -17233,13 +17233,16 @@ package body Sem_Prag is
end; end;
end if; end if;
-- Cases where we must follow a declaration -- Cases where we must follow a declaration, including an
-- abstract subprogram declaration, which is not in the
-- other node subtypes.
else else
if Nkind (Decl) not in N_Declaration if Nkind (Decl) not in N_Declaration
and then Nkind (Decl) not in N_Later_Decl_Item and then Nkind (Decl) not in N_Later_Decl_Item
and then Nkind (Decl) not in N_Generic_Declaration and then Nkind (Decl) not in N_Generic_Declaration
and then Nkind (Decl) not in N_Renaming_Declaration and then Nkind (Decl) not in N_Renaming_Declaration
and then Nkind (Decl) /= N_Abstract_Subprogram_Declaration
then then
Error_Pragma Error_Pragma
("pragma% misplaced, " ("pragma% misplaced, "
......
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