Ed Schonberg
ffdd524878
[Ada] Spurious error on instantiation with type with unknown discriminants
This patch fixes a spurious error when instantiating an indefinite container with a private type with unknown discriminants, when its full view is an unconstrained array type. It also cleans up the inheritance of dynamic predicates inherited by anonymous subtypes of array types. 2018-05-23 Ed Schonberg <schonberg@adacore.com> gcc/ada/ * einfo.ads: New attribute on types: Predicated_Parent, to simplify the retrieval of the applicable predicate function to an itype created for a constrained array component. * einfo.adb: Subprograms for Predicated_Parent. (Predicate_Function): Use new attribute. * exp_util.adb (Make_Predicate_Call): If the predicate function is not available for a subtype, retrieve it from the base type, which may have been frozen after the subtype declaration and not captured by the subtype declaration. * sem_aggr.adb (Resolve_Array_Aggregate): An Others association is legal within a generated initiqlization procedure, as may happen with a predicate check on a component, when the predicate function applies to the base type of the component. * sem_ch3.adb (Analyze_Subtype_Declaration): Clean up inheritance of predicates for subtype declarations and for subtype indications in other contexts. (Process_Subtype): Likewise. Handle properly the case of a private type with unknown discriminants whose full view is an unconstrained array. Use Predicated_Parent to indicate source of predicate function on an itype whose parent is itself an itype. (Complete_Private_Subtype): If the private view has unknown discriminants and the full view is an unconstrained array, set base type of completion to the full view of parent. (Inherit_Predicate_Flags): Prevent double assignment of predicate function and flags. (Build_Subtype): For a constrained array component, propagate predicate information from original component type declaration. gcc/testsuite/ * gnat.dg/discr51.adb: New testcase. From-SVN: r260596
…
…
…
…
…
…
…
…
…
…
This directory contains the GNU Compiler Collection (GCC). The GNU Compiler Collection is free software. See the files whose names start with COPYING for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. The directory INSTALL contains copies of the installation information as HTML and plain text. The source of this information is gcc/doc/install.texi. The installation information includes details of what is included in the GCC sources and what files GCC installs. See the file gcc/doc/gcc.texi (together with other files that it includes) for usage and porting information. An online readable version of the manual is in the files gcc/doc/gcc.info*. See http://gcc.gnu.org/bugs/ for how to report bugs usefully. Copyright years on GCC source files may be listed using range notation, e.g., 1987-2012, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually.
Description
Languages
C
48%
Ada
18.3%
C++
14.1%
Go
7%
GCC Machine Description
4.6%
Other
7.7%