]> git.ipfire.org Git - thirdparty/gcc.git/commit
[Ada] Fixes for various wrong and missing error messages on ACATS B85100[567]
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Dec 2018 15:49:56 +0000 (15:49 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Dec 2018 15:49:56 +0000 (15:49 +0000)
commit1e9ee6254497be16adbb03f5892e8dd6c501bfc1
treef6ecaa22001984207cf63376bd87a518c9ff4f68
parent974c18979a3bbbbce996115c9b38bce227ee8597
[Ada] Fixes for various wrong and missing error messages on ACATS B85100[567]

GNAT was missing errors as well as issuing messages on legal lines in
new ACATS tests for illegal renamings of discriminant-dependent
components. Cases that are fixed include object names involving
qualified expressions, dereference cases, and generic formal access and
formal derived types. Better implements the "known to be constrained"
rules in the Ada RM.

Tested by new ACATS tests B85100[567] that are soon to be released.

2018-12-03  Gary Dismukes  <dismukes@adacore.com>

gcc/ada/

* sem_aux.adb (Object_Type_Has_Constrained_Partial_View): Return
True for an untagged discriminated formal derived type when
referenced within a generic body (augments existing test for
formal private types).
* sem_util.adb (Is_Dependent_Component_Of_Mutable_Type): If the
prefix of the name is a qualified expression, retrieve the
operand of that. Add a test of whether the (possible)
dereference prefix is a variable, and also test whether that
prefix might just be of an access type (occurs in some implicit
dereference cases) rather than being an explicit dereference.
Retrieve the Original_Node of the object name's main prefix and
handle the possibility of that being a qualified expression.
Remove special-case code for explicit dereferences that don't
come from source. Add test for the renaming not being within a
generic body for proper determination of whether a formal access
type is known to be constrained (it is within a generic spec,
but not in the body).  Fix an existing incorrect test for
renaming of a discriminant-dependent component of a untagged
generic formal type being within a generic body, adding test of
taggedness and calling In_Generic_Body (now properly checks for
cases where the renaming is in a nongeneric body nested within a
generic).  Return False in cases where the selector is not a
component (or discriminant), which can occur for
prefixed-notation calls.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266759 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ada/ChangeLog
gcc/ada/sem_aux.adb
gcc/ada/sem_util.adb