This changes the way some assignments of aggregates of dynamic
discriminated record types are expanded by the front-end: they used to
always give rise to the creation of a temporary, which is unnecessary if
the by-copy semantics can be guaranteed.
This also puts the treatment of qualified aggregat
The routine Determine_License is brittle and doesn't e.g. handle
properly wide characters. Furthermore this is just a heuristic, which
isn't really needed, so remove it to simplify maintenance and remove
latent issues with wide characters.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06
Folding of Enum_Rep attribute was partly done in evaluation (for
expressions like "Typ'Enum_Rep (Enum_Literal)") and partly in expansion
(for expressions like "Enum_Literal'Enum_Rep". Moreover, some of the
code in evaluation was dead and some of the code in expansion was
violating internal assertio
This patch fixes a bug where if pragma Assertion_Policy(Ignore) is in
effect, if the only reference to a given declaration is in an Invariant,
spurious warnings about unused entities are given. For example, if a
compilation unit says "with X;", and the only reference to X is in an
invariant, the co
This makes sure that a Sloc is put on the dereferences inserted by the
new procedure Copy_And_Maybe_Dereference.
No functional changes.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-10 Eric Botcazou
gcc/ada/
* sem_util.adb (Copy_And_Maybe_Dereference): Temporarily copy
This plugs the only loophole in the front-end through which implicit
dereferences can reach the code generator without having being turned
into explicit ones.
No functional changes.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-10 Eric Botcazou
gcc/ada/
* sem_util.adb (C
This removes a block of code in Resolve_Call that inserts an explicit
dereference for a call whose prefix is an access-to-subprogram type, but
this processing is already done earlier in Analyze_Call.
No functional changes.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-10 Eric Botcaz
This patch enhances the warnings on overlapping actuals of composite
types when only one of them is writable. If these parameters are passed
by reference it is the case that assignment to one could have the
undesirable effect of modifying the other inside the called subprogram.
Tested on x86_64-pc
This Ada 202x AI defines among other things new check names. Recognize
them as no-ops for now.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-10 Arnaud Charlet
gcc/ada/
* snames.ads-tmpl (Name_Characters_Assertion_Check,
Name_Containers_Assertion_Check,
Na
This makes sure that the semantics specified by this AI is observed
by using an expression with actions in order to insert the PE raise
statement in a membership context with multiple choices.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-10 Eric Botcazou
gcc/ada/
* exp_c
Working on this AI it appeared that GNAT wasn't implementing the Ada
2012 notion of "require late initialization", so plug this hole and
implement the new rule from AI12-0192 at the same time.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-10 Arnaud Charlet
gcc/ada/
* exp_
Building equivalent record aggregates when the type of the aggregate has
predicate functions can result in Gigi crashes if the type hasn't been
frozen yet. Since Build_Equivalent_Record_Aggregate is an optimization,
it's ok to disable it when encountering aggregates with predicates.
Tested on x86_
This new Ada 202x AI introduces a new package Modular_Arithmetic.
Related discussion also suggested to rename the recently introduced
Arithmetic package -> Integer_Arithmetic, for consistency, so this is
done at the same time.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-10 Arnaud C
The call to Set_Size_Known_At_Compile_Time in
Backend_Processing_Possible happened just after querying
Size_Known_At_Compile_Time several lines before. Both calls operated on
the same type entity, so the call to "Set" routine had no effect and now
is removed.
Tested on x86_64-pc-linux-gnu, committ
This Ada 202x AI clarifies that Root_Storage_Pool_With_Subpools and
Root_Subpool should have pragma Preelaborable_Initialization.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Arnaud Charlet
gcc/ada/
* libgnat/s-stposu.ads (Root_Storage_Pool_With_Subpools,
Root
This patch fixes a bug where if you have a Predicate_Failure aspect on a
nested type, but no Predicate, Static_Predicate, or Dynamic_Predicate,
the compiler crashes when compiled with assertions enabled.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Bob Duff
gcc/ada/
*
Tables with case-choices are sorted by Sort_Case_Table with an insertion
sort. Contrary to what comments for the Case_Table_Type says, this
routine doesn't use the table element at index 0 as a placeholder.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Piotr Trojanek
gcc/ada/
When an assignment of an allocator the type of which has predicate
checks is made inside of a record, GNAT generates a call to the
predicate function. However, before this commit, GNAT wouldn't check if
the subtype mark had a predicate, which would result in the predicate
check function not being c
This patch corrects an issue whereby the compiler would incorrectly
calculate accessibility levels of objects within type conversions -
leading to potentially missing static and dynamic errors.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Justin Squirek
gcc/ada/
* sem
Internally generated static dispatch tables are preferably put in ROM,
so they are declared as constant where possible. However, the Object
Specific Dispatch tables were declared as variables, even though they
are initialized with static aggregates (with only literal integers) and
are never modifie
When iterating over pairs of formal parameters we now finish as soon as
we find a single problematic pair; previously we continued iteration.
This is just a simplification and a compiler performance improvement.
Semantics is not affected.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-
Routines Sem_Aggr.Build_Constrained_Itype and Sem_Ch3.Build_Subtype that
create discriminated itypes were originally identical, but now they are
subtly different. This patch removes one of their two subtle
differences, namely a call to Set_Size_Known_At_Compile_Time that was
meant as a very narrow
When resolving a record aggregate with a box as the value of one of its
component that is itself of a discriminated record type, this box is
replaced with an inner record aggregate. However, while a constrained
itype is created for the outer record aggregate (as described in the
comment of Resolve_
A local variable that is used as a counter (which is clear from both its
comment and its used) will only be assigned with natural numbers. This
is now reflected in its type. Code cleanup only; semantics is
unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Piotr Trojanek
When resolving record aggregates, frontend was creating "others => <>"
association to represent nested components, for example:
type T1 (D1 : Boolean := False) is record
C1 : Boolean := True;
end record;
type T2 is record
C2 : T1;
end record;
X2 : T2 := (others => <>);
Routine Build_Constrained_Itype was created as an exact duplicate
Build_Subtype with a comment suggesting that their code should be
exported from Sem_Util and reused. Unfortunately, since then both
routines diverged and now are subtly different, so reusing is not
straightforward. However, it is sti
Routine Next is implemented both as a procedure and as a function. The
procedure variant seems meant to be used when iterating, e.g.:
Next (Decl);
because it is more readable than the corresponding functions:
Decl := Next (Decl);
(and it is inlined anyway, so there is no performance penal
This consolidates the handling of almost all the implicit dereferences
allowed in Ada 95 into the semantic analysis phase of the compiler, and
more precisely in the Resolve routine of the front-end.
This both means that the generic code handling them in the expander
is removed, and that various co
When looking for references to discriminants within constraint
expressions we now stop once the first such a reference is found. This
is just a tiny performance improvement; semantics is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Piotr Trojanek
gcc/ada/
This patch refines the handling of warnings on overlapping actuals of
composite types when only one of them is writable. Formals of a generic
type are excluded, given that the warning will be given on any instance.
Uniform treatment of formals and actuals.
Tested on x86_64-pc-linux-gnu, committed
Work around the fact that Put_Image doesn't work for private types whose
full type is real. Make Put_Image_Unknown print out the name of the
type. Put_Image is still disabled by default for all types.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Bob Duff
gcc/ada/
*
Routine Get_Value is only called with its Compon parameter equal to
entity ids of components. This is now reflected in the type of this
parameter. Code cleanup only; semantics is unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Piotr Trojanek
gcc/ada/
* sem_a
Previously, the four aspects Async_Readers, Async_Writers,
Effective_Reads, and Effective_Writes could only be specified for
volatile variables and for state abstractions. Allow specifying these
aspects for volatile types.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Steve Baird
SPARK RM 7.1.3(8) has been deleted, but there were actually plenty of
mistakes in references to rules 7.1.3(X). This patch fixes them in both
comments and error messages.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Piotr Trojanek
gcc/ada/
* sem_ch4.adb, sem_ch6.adb,
Large bit-packed arrays, i.e. whose size is greater than 64 bits,
are implemented under the hood by means of arrays of storage units,
the front-end generating the required mask-and-shifts operations to
go back and forth between the two representations.
These operations depend on the endianness of
The Safe_Unchecked_Type_Conversion predicate was invoking the
Has_Discriminant predicate without checking that the Etype really
Is_Type, which is not the case for Standard_Void_Type "returned" by
entry calls.
No functional changes.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Er
This adjusts the new Resolve_Implicit_Dereference procedure to the cases
where nodes in an instance do not have the proper view of a type that
was declared as private (a well-known limitation of the current
implementation of generic instantiations for types that are only
implicitly referenced in th
Work around bug in Put_Image of types in Remote_Types packages. Use the
switch -gnatd_z to control enabling of Put_Image. Put_Image is still
disabled by default for all types.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-11 Bob Duff
gcc/ada/
* exp_put_image.adb (Build_
This patch updates the Put_Image facilities in the Big_Numbers packages
to match the actual implementation of Put_Image.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Bob Duff
gcc/ada/
* libgnat/a-nbnbin.adb, libgnat/a-nbnbin.ads,
libgnat/a-nbnbin__gmp.adb, lib
This implements the AI under the -gnat2020 switch, which extends the
Ada 2005 No_Return aspect/pragma to functions and generic functions.
As explained in the AI, functions subject to this aspect/pragma must
still have a return statement, but it must be of a specific form.
This also fixes the imple
This aligns the handling of Ada 2012 implicit dereferences in the
Is_OK_Variable_For_Out_Formal predicate wih that in Is_Variable,
and removes unreachable code as a result.
This also makes more use of the Get_Reference_Discriminant helper
function to retrieve the reference discriminant of a type.
Enable Put_Image for types that don't cause regressions (which is most
types).
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Bob Duff
gcc/ada/
* debug.adb: Remove usage of -gnatd_z.
* exp_attr.adb, exp_put_image.ads, exp_put_image.adb: Clean up
the enab
Routine Get_Discr_Value takes a name of a discriminant, not its entity,
so its parameter should be a Node_Id, not an Entity_Id. Also, fix typo
in its comment and refactor repeated calls in the body. Semantics is
unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Piotr Troja
Detection of overlapping actuals was suppressed for internal units,
because we were getting spurious warnings on container units. Now this
suppression has no effect (most likely because ignore parameters of
generic types).
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Piotr Trojan
Replace a low-level membership test "Ekind_In (Id, E_Entry,
E_Entry_Family)" with a high-level "Is_Entry (Id)", which is more
readable. Semantics stays the same.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Piotr Trojanek
gcc/ada/
* contracts.adb, einfo.adb, sem_ch4.a
For subprograms we call Warn_On_Overlapping_Actuals in Resolve_Call;
however, for protected entries we didn't call it at all, because
Resolve_Call was executing Resolve_Entry_Call and returning early. As a
result, we didn't detect overlapping actuals in entry calls. Now we do.
Tested on x86_64-pc-
This patch adds checks to reject illegal overriding indicators that
appear on subprogram declarations in protected bodies, where such
a subprogram cannot override any operation. Fixes ACATS test B831006.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Ed Schonberg
gcc/ada/
This acats test shows that we are not checking 13.1(9.2/5) for
representation aspects, now fixed.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Arnaud Charlet
gcc/ada/
* aspects.ads (Is_Representation_Aspect): New array.
* sem_ch13.adb (Analyze_Aspect_Specifica
This patch fixes a crash in the compiler when handling an instantiation
with a formal subprogram that carries an aspect specification, when the
actual in the instantiation is an overloaded name.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Ed Schonberg
gcc/ada/
* sem_
This patch fixes an infinite loop in the compiler on an instantiation
that includes formal packages and formal subprograms with aspect
specifications (but no pre- or postconditions), when compiling with
-gnatX.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Ed Schonberg
gcc/ada
Use Standard'Maximum_Alignment * 2 unconditionally to accommodate
possible requirements by user code compiled with specific cpu/arch
options such as -mavx on x86 targets, which Gigi assumes the SS can
handle.
Such options influence what Standard'Maximum_Alignment returns and are
typically not used
The required level of support for elementary streaming includes support
for 24 bits elements, which is added here.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Arnaud Charlet
gcc/ada/
* exp_strm.adb (Build_Elementary_Input_Call): Add support for 24
bits elemen
We were detecting overlapping actuals in a call like "Proc (A, B, C)"
using two loops that iterated over all parameters, so we were examining
9 pairs:
A-A, A-B, A-C
B-A, B-B, B-C
C-A, C-B, C-C
Now the outer loop iterates over all parameters, while the inner loop
always starts from the next
This implements the AI under the -gnat2020 switch, which extends the
set of calls that can be made during the elaboration of library units
subject to the aspect/pragma Preelaborate, beyond the existing ones
to static functions. Calls to certain functions that are essentially
unchecked conversions
Windows Server 2019 do not need 500ms socket timeout correction. The
problem is that Windows API recommended function
IsWindowsVersionOrGreater is not comparing the build part which is only
difference between Windows 2016 and 2019 servers.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06
Such subprograms are not protected and have convention Intrinsic to
ensure that their 'Access isn't taken as per RM 6.3.1(10/2).
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Arnaud Charlet
gcc/ada/
* exp_ch6.adb (Expand_N_Subprogram_Declaration): Do nothing for
There are some cases where an explicit type conversion from an anonymous
access type to a named access type is legal but an implicit conversion
is not. Ada RM 8.6 requires that for such an implicit conversion (but
not for an explicit conversion), the operand of the conversion "shall
denote a view w
Identifiers in the snames template file are ordered either logically or
alphabetically, but the Test_Case identifier was clearly out-of-order.
Likewise for pragmas. Cleanup before adding a new aspect; semantics in
unaffected.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Piotr Tro
The current code was climbing the tree manually assuming that an array
attribute (e.g. 'First) would appear immediately, which isn't the case
for e.g. a selected component expression.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Arnaud Charlet
gcc/ada/
* sem_res.adb (
This Ada 202x AI makes illegal some cases of out parameters whose type
has a Default_Value aspect.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-12 Arnaud Charlet
gcc/ada/
* sem_res.adb (Resolve_Actuals): Check for AI12-0074.--- gcc/ada/sem_res.adb
+++ gcc/ada/sem_res.adb
This mainly improves the code generated for the assignment of dynamic
record aggregates, which was always going through a temporary if the
target of the assignment was not a simple identifier (this is not the
case for dynamic array aggregates). This also extends a little the
set of acceptable comp
AI12-0369 relaxes the rules for the Static_Barriers and Pure_Barriers
restrictions so that subcomponents of a protected object can be named
(subject to some restrictions) in a barrier expression. Note that one
effect of this is to undo a change that was made recently for AI12-0290.
Tested on x86_6
AI12-0217 made changes in the rules for 'Old; make analogous changes for
'Loop_Entry. In particular, where the rules used to require that the
attribute prefix must "statically denote" an object in some cases, those
rules have been relaxed to say that the prefix must "statically name" an
object inst
This patch corrects an issue in the compiler whereby conditional
expressions used directly as actuals for anonymous access types caused
the callee to fail to generate relevant accessibility checks.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Justin Squirek
gcc/ada/
*
Implement Put_Image for private types whose full type is a fixed or
floating point type. Also implement 'Image for private types in general.
This affects integers and enumeration types.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Bob Duff
gcc/ada/
* exp_imgv.adb (Exp
When the support for Global and Depends (and their Refined variants)
contracts was implemented, it wrongly allowed discriminants to appear in
these contracts. This was later fixed, but we still had task
discriminants installed when resolving the contract items.
Tested on x86_64-pc-linux-gnu, commi
Implement Put_Image for access-to-subprogram, including
access-to-protected-subprogram, and enable.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Bob Duff
gcc/ada/
* libgnat/s-putima.ads, libgnat/s-putima.adb
(Put_Image_Access_Subp, Put_Image_Access_Prot): New
This implements the AI in all versions of the language, since it is a
binding interpretation. The point is to make 'Has_Same_Storage return
false for objects of size zero, as 'Overlaps_Storage already does.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Eric Botcazou
gcc/ada/
This fixes an annoying discrepancy in the resolution of the type of
the elements of the choice list in a membership test. Consider:
Msg : String;
if Msg not in "" | "bypass" then
...
end if;
if not (Msg in "" or else Msg in "bypass") then
...
end if;
function Func return St
Routine Is_Renaming_Declaration was added to support the Ghost aspect in
SPARK, but later its only callee has been removed when handling of this
aspect was fixed; now it is unreferenced. Also, it is dubious whether we
ever needed this routine (and whether we needed to explicitly list
renaming node
A call to an exprewion function generated for a precondition that
applies to a null procedure leaves the freeze node for the expression
function in the wrong context. As a result the body of the function is
not properly compiled and the corresponding symbol is markea as
undefined, leading to a subs
The Global and Depends contracts can only be attached to single task
objects, not to single protected objects.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Piotr Trojanek
gcc/ada/
* contracts.adb (Analyze_Object_Contract): Do not expect
Global/Depends on singl
This reverts a previous commit and reinstalls task discriminants for the
analysis of Global/Depends contracts (and their refined variants). Task
discriminants are rejected in those contracts, but need to be installed
for the analysis, as otherwise we get difficult to understand error
messages.
Tes
Analysis of Relaxed_Initialization is heavily inspired by the existing
code for Global/Depends contract. There was one difference in dealing
with scope tables; it turns out that this difference was a mistake. Now
fixed.
Also, fix a mistake in querying the aspect property for subprogram
parameter,
Some aspects with no corresponding pragmas (Default_Value and
Default_Component_Value) did not have proper checking for rules in RM
13.1(9) and RM 13.1(10)), this is now fixed.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Arnaud Charlet
gcc/ada/
* sem_attr.adb (Eval_A
This implements the AI in all versions of the languages, since it is a
binding interpretation. The goal of the AI is to clarify where three
checks prescribed by the 6.5 clause are done in the case of an extended
return statement (immediately after the return object is created or
immediately before
The current Dynamic_Predicate prevents declaring a variable without also
initializing it at the same time.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Arnaud Charlet
gcc/ada/
* libgnat/a-nbnbin.ads (Big_Positive, Big_Natural): Fix
predicate.--- gcc/ada/libgna
Use string literal syntax for private types whose full type is string,
as was already done for visible string types. Double the double-quote
characters in the literal. Disable Put_Image for unchecked unions, so
they'll just print the type name.
Tested on x86_64-pc-linux-gnu, committed on trunk
2
This reimplements the predicate more efficiently and more strictly.
It is used to implement the part of the 4.9.1 (2/3) subclause that
pertains to predicates:
"A subtype statically matches another subtype of the same type if they
have statically matching constraints, all predicate specifications t
...in preparation for enabling 'Image for all types in Ada 2020, and
having it call 'Put_Image for nonscalar types, and for types with
user-defined 'Put_Image.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Bob Duff
gcc/ada/
* sem_attr.adb (Check_Image_Type): New proced
The compiler blows up processing a constructor function that returns a
limited private tagged type that implements an interface type whose full
view has a task type component.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Javier Miranda
gcc/ada/
* restrict.ads (Set_Glo
When the type of a scalar formal parameter of mode out has the
Default_Value aspect, the actual type is also required to have that
aspect (required now by AI12-0074, RM 6.4.1(5.3/4)), and the value of
the actual must be passed on calls (since the actual is guaranteed to be
initialized and deinitial
This Ada 202x AI introduces new functions Is_Basic and To_Basic in
Ada.Wide_Characters.Handling.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Arnaud Charlet
gcc/ada/
* libgnat/a-wichha.ads, libgnat/a-wichha.adb,
libgnat/a-wichun.ads, libgnat/a-wichun.adb (Is_B
In Ada 2020, T'Image calls T'Put_Image if there is an explicit
aspect_specification for Put_Image, or if U_Type'Image is illegal in
pre-2020 versions of Ada. Scalar types continue to use the old 'Image,
even in Ada 2020.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-15 Bob Duff
gc
The previous change implemented the rule in Freeze_Expression that
expression functions that are not completions are not freeze points.
However, for code generation purposes, the artificial entities that
are created during the expansion of the expressions must still be
frozen inside the body create
This is a fallout of the earlier work on the handling of Ada 95
implicit dereferences. The dereferences are now made explicit
only at the final stage of type resolution and this slightly
changes the way they are analyzed during semantic analysis.
In particular, in the case of an implicit derefere
The compiler creates a link failure involving an expression function
that is not a completion when the expression of the expression function
includes a call to a function F declared in on outer scope of the same
package declaration, becausw the compiler places the freeze node for F
in the generated
Problem: When Passed_By_Reference is used on an incomplete type (e.g.
`type T; B : Boolean := T'Passed_By_Reference;`) GNAT crashes in Gigi
because it doesn't know the size of T. Solution: Reject programs that
use Passed_By_Reference on incomplete types, just like what is currently
done for the Al
This implements the AI in all versions of the language, since it is a
binding interpretation. The AI extends the 12.5.1(8) subclause: "For
a generic formal derived type with no discriminant_part, the actual
subtype shall be statically compatible with the ancestor subtype"
from constained types to
Routine Is_Object_Reference, which implements Ada RM 3.3(2) that says
"All of the following are objects: ..." was slightly diverging from the
exact wording of that rule and from the exact wording of AI05-0003,
which allows qualified expressions to be used as objects (provided that
their expression
This patch fixes regressions in GNATprove, after a previous patch
changed routine Is_Object_Reference to literally implement the Ada RM
and recognize aggregates as objects.
Now routine Evaluate_Name also literally implements the Ada RM rules
about name evaluation; in particular, it restores forced
This is a test against RM 4.5.2(4.1/4), the rule that ensures that
equality is visible for a membership involving objects. GNAT wasn't
handling this case properly because during the rewrite of membership
tests, the legality rules were bypassed as the rewrite was no longer
treated as if it came from
This ACATS test show that GNAT was not implementing AI05-0115 properly,
now fixed by checking the relevant parent type.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-16 Arnaud Charlet
gcc/ada/
* sem_aggr.adb (Resolve_Extension_Aggregate): Fix implementation
of AI0
When renaming a qualified expression with an operator, e.g.:
Y : Boolean renames Boolean'(not X);
routine Evaluate_Name should handle operators just like it handles
function calls. This doesn't appear to matter for GNAT (where this
routine is called in very few cases, as described in the comme
An assertion is code for static membership tests was failing on this
code:
subtype A is Integer with
predicate => A > 0;
subtype B is Integer with
predicate => B in P.A;
where a qualified type name "P.A" appears in the predicate of type B.
The fix is trivial and the problem didn'
This ACATS test shows that we are not checking legality of functions
returning interfaces that need to be abstract.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-16 Arnaud Charlet
gcc/ada/
* sem_ch6.adb (Analyze_Subprogram_Specification): Generate error
message fo
ACATS tests C452005 and C452006 show that GNAT is using the wrong
equality operation for non record/non limited types as defined in RM
4.5.2 (28.1/4).
This is actually a follow up/complement of the previous change for
ACATS B452001 against RM 4.5.2(4.1/4).
Tested on x86_64-pc-linux-gnu, committed
This prevents the compiler from placing the freeze node of an array
subtype, generated for the expression of an if-expression whose type
is an array type declared with a predicate, ahead of this expression
and, in particular, before its declaration.
Tested on x86_64-pc-linux-gnu, committed on trun
Specify the Integer_Literal aspect for the type
Ada.Numerics.Big_Numbers.Big_Integers.Big_Integer. Specify the
Real_Literal aspect for the type
Ada.Numerics.Big_Numbers.Big_Reals.Big_Real.
Tested on x86_64-pc-linux-gnu, committed on trunk
2020-06-16 Steve Baird
gcc/ada/
* libgnat/a-
This patch implements A12-0216, which clarifies RM 6.4.1 (6.16-17/3)
concerning illegal overlappings between actuals in a call. The previous
illegality rule applied to a call in which two writable actuals, one
of them having an elementary type, are known to overlap. The new rule
states that illegal
901 - 1000 of 3386 matches
Mail list logo