* sem_prag.adb (Set_Imported): Do not generate error for multiple
Import in CodePeer mode.
* s-rident.ads: Fix minor typo.
2013-04-12 Ed Schonberg <schonberg@adacore.com>
* checks.adb (Insert_Valid_Check): Do not insert validity check
in the body of the generated predicate function, to prevent
infinite recursion.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197908
138bc75d-0d04-0410-961f-
82ee72b054a4
+2013-04-12 Arnaud Charlet <charlet@adacore.com>
+
+ * sem_prag.adb (Set_Imported): Do not generate error for multiple
+ Import in CodePeer mode.
+ * s-rident.ads: Fix minor typo.
+
+2013-04-12 Ed Schonberg <schonberg@adacore.com>
+
+ * checks.adb (Insert_Valid_Check): Do not insert validity check
+ in the body of the generated predicate function, to prevent
+ infinite recursion.
+
2013-04-12 Ed Schonberg <schonberg@adacore.com>
* s-rident.ads: Add various missing Ada 2012 restrictions:
procedure Insert_Valid_Check (Expr : Node_Id) is
Loc : constant Source_Ptr := Sloc (Expr);
+ Typ : constant Entity_Id := Etype (Expr);
Exp : Node_Id;
begin
return;
end if;
+ -- Do not insert checks within a predicate function. This will arise
+ -- if the current unit and the predicate function are being compiled
+ -- with validity checks enabled.
+
+ if Present (Predicate_Function (Typ))
+ and then Current_Scope = Predicate_Function (Typ)
+ then
+ return;
+ end if;
+
-- If we have a checked conversion, then validity check applies to
-- the expression inside the conversion, not the result, since if
-- the expression inside is valid, then so is the conversion result.
-- The latest implementation avoids both this problem by using a named
-- scheme for recording restrictions, rather than a positional scheme which
-- fails completely if restrictions are added or subtracted. Now the worst
--- that happens at bind time in incosistent builds is that unrecognized
+-- that happens at bind time in inconsistent builds is that unrecognized
-- restrictions are ignored, and the consistency checking for restrictions
-- might be incomplete, which is no big deal.
if Is_Exported (E) then
Error_Msg_NE ("entity& was previously exported", N, E);
+ -- Ignore error in CodePeer mode where we treat all imported
+ -- subprograms as unknown.
+
+ elsif CodePeer_Mode then
+ goto OK;
+
-- OK if Import/Interface case
elsif Import_Interface_Present (N) then