+2013-04-23 Ed Schonberg <schonberg@adacore.com>
+
+ * exp_ch6.adb (Expand_N_Subprogram_Body): When compiling with
+ initialize_scalars, disable predicate checks on the generated
+ assignment to an out scalar parameter.
+
+2013-04-23 Gary Dismukes <dismukes@adacore.com>
+
+ * sem_ch4.adb (Analyze_Allocator): Remove error
+ check for "constrained in partial view" constraints entirely.
+
+2013-04-23 Robert Dewar <dewar@adacore.com>
+
+ * einfo.ads, sem_prag.ads: Minor reformatting.
+ * errout.ads: Comment update.
+
2013-04-23 Yannick Moy <moy@adacore.com>
* exp_ch5.adb: Minor typo.
-- type has no discriminants and the full view has discriminants with
-- defaults. In Ada 2005 heap-allocated objects of such types are not
-- constrained, and can change their discriminants with full assignment.
-
+--
-- Ada 2012 has an additional rule (3.3. (23/10.3)) concerning objects
-- declared in a generic package body. Objects whose type is an untagged
-- generic formal private type are considered to have a constrained
-- which is being continued. It is allowable to put ? in continuation
-- messages, and the usual style is to include it, since it makes it
-- clear that the continuation is part of a warning message.
+ --
+ -- Note: this usage is obsolete, use ??, ?x? or ?X? instead to specify
+ -- the string to be added when Warn_Doc_Switch is set to True. If this
+ -- switch is True, then for simple ? messages it has no effect. This
+ -- simple form is to ease transition and will be removed later.
- -- Insertion character ?? (two question marks)
+ -- Insertion character ?? (Two question marks: default warning)
-- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
- -- "[enabled by default]" at the end of the warning message. In the
- -- case of continuations, use this in each continuation message.
+ -- "[enabled by default]" at the end of the warning message. For
+ -- continuations, use this in each continuation message.
-- Insertion character ?x? (warning with switch)
-- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
-- "[-gnatwx]" at the end of the warning message. x is a lower case
- -- letter. In the case of continuations, use this on each continuation
- -- message.
+ -- letter. For continuations, use this on each continuation message.
-- Insertion character ?X? (warning with dot switch)
-- Like ?, but if the flag Warn_Doc_Switch is True, adds the string
-- "[-gnatw.x]" at the end of the warning message. X is an upper case
- -- letter corresponding to the lower case letter x in the message. In
- -- the case of continuations, use this on each continuation
- -- message.
+ -- letter corresponding to the lower case letter x in the message.
+ -- For continuations, use this on each continuation message.
-- Insertion character < (Less Than: conditional warning message)
-- The character < appearing anywhere in a message is used for a
-- Insertion character ' (Quote: literal character)
-- Precedes a character which is placed literally into the message.
-- Used to insert characters into messages that are one of the
- -- insertion characters defined here. Also useful in inserting
- -- sequences of upper case letters which are not to be treated as
- -- keywords.
+ -- insertion characters defined here. Also used when insertion
+ -- upper case letter sequences not to be treated as keywords.
-- Insertion character \ (Backslash: continuation message)
-- Indicates that the message is a continuation of a message
if Init_Or_Norm_Scalars and then Is_Subprogram (Spec_Id) then
declare
F : Entity_Id;
+ A : Node_Id;
begin
-- Loop through formals
-- Insert the initialization. We turn off validity checks
-- for this assignment, since we do not want any check on
-- the initial value itself (which may well be invalid).
+ -- Predicate checks are disabled as well (RM 6.4.1 (13/3))
- Insert_Before_And_Analyze (First (L),
- Make_Assignment_Statement (Loc,
+ A := Make_Assignment_Statement (Loc,
Name => New_Occurrence_Of (F, Loc),
- Expression => Get_Simple_Init_Val (Etype (F), N)),
- Suppress => Validity_Check);
+ Expression => Get_Simple_Init_Val (Etype (F), N));
+ Set_Suppress_Assignment_Checks (A);
+
+ Insert_Before_And_Analyze (First (L),
+ A, Suppress => Validity_Check);
end if;
Next_Formal (F);
Rewrite (E, New_Copy_Tree (Subtype_Mark (E)));
Analyze_Allocator (N);
return;
-
- -- Ada 2005, AI-363: if the designated type has a constrained
- -- partial view, it cannot receive a discriminant constraint,
- -- and the allocated object is unconstrained.
-
- elsif Ada_Version >= Ada_2005
- and then Has_Constrained_Partial_View (Base_Typ)
- then
- Error_Msg_N
- ("constraint not allowed when type " &
- "has a constrained partial view", Constraint (E));
end if;
if Expander_Active then
function Effective_Name (N : Node_Id) return Name_Id;
-- N is a pragma node or aspect specification node. This function returns
-- the name of the pragma or aspect, taking into account possible rewrites,
- -- and also cases where a pragma comes from an attribute (in such cases,
+ -- and also cases where a pragma comes from an aspect (in such cases,
-- the name can be different from the pragma name, e.g. Pre generates
- -- a Precondition pragma. This also deals with the presence of 'Class
+ -- a Precondition pragma). This also deals with the presence of 'Class
-- which results in one of the special names Name_uPre, Name_uPost,
-- Name_uInvariant, or Name_uType_Invariant being returned to represent
-- the corresponding aspects with x'Class names.