diff options
author | Gary Dismukes <dismukes@adacore.com> | 2021-05-17 03:35:25 -0400 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-07-07 16:23:17 +0000 |
commit | 14212dc422ed09f8324bbfd1dec662cbb2fdbe0e (patch) | |
tree | af2dbac374746f603bbb0e98b8636057ad5ed3b2 /gcc/gimple-array-bounds.cc | |
parent | e5be1e443cef81f458545f5dae1a91860ca1ae71 (diff) | |
download | gcc-14212dc422ed09f8324bbfd1dec662cbb2fdbe0e.zip gcc-14212dc422ed09f8324bbfd1dec662cbb2fdbe0e.tar.gz gcc-14212dc422ed09f8324bbfd1dec662cbb2fdbe0e.tar.bz2 |
[Ada] Implement new legality checks specified by AI12-0412
gcc/ada/
* freeze.adb (Check_Inherited_Conditions): Setting of Ekind,
LSP_Subprogram, and Is_Wrapper needs to happen for null
procedures as well as other wrapper cases, so the code is moved
from the else part in front of the if statement. (Fixes a
latent bug encountered while working on this set of changes.)
* sem_attr.adb (Resolve_Attribute): Report an error for the case
of an Access attribute applied to a primitive of an abstract
type when the primitive has any nonstatic Pre'Class or
Post'Class expressions.
* sem_ch8.adb (Analyze_Subprogram_Renaming): Report an error for
the case of a actual subprogram associated with a nonabstract
formal subprogram when the actual is a primitive of an abstract
type and the primitive has any nonstatic Pre'Class or Post'Class
expressions.
* sem_disp.adb (Check_Dispatching_Context): Remove special
testing for null procedures, and replace it with a relaxed test
that avoids getting an error about illegal calls to abstract
subprograms in cases where RM 6.1.1(7/5) applies in
Pre/Post'Class aspects. Also, remove special test for
Postcondition, which seems to be unnecessary, update associated
comments, and fix a typo in one comment.
(Check_Dispatching_Call): Remove an unneeded return statement,
and report an error for the case of a nondispatching call to a
nonabstract subprogram of an abstract type where the subprogram
has nonstatic Pre/Post'Class aspects.
* sem_util.ads
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function.
(In_Pre_Post_Condition): Add a flag formal Class_Wide_Only,
defaulted to False, for indicating whether the function should
only test for the node being within class-wide pre- and
postconditions.
* sem_util.adb
(Is_Prim_Of_Abst_Type_With_Nonstatic_CW_Pre_Post): New function
to determine whether a subprogram is a primitive of an abstract
type where the primitive has class-wide Pre/Post'Class aspects
specified with nonstatic expressions.
(In_Pre_Post_Condition): Extend testing to account for the new
formal Class_Wide_Only.
Diffstat (limited to 'gcc/gimple-array-bounds.cc')
0 files changed, 0 insertions, 0 deletions