r266980 - in /trunk/gcc: ada/ChangeLog ada/free...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Tue Dec 11 11:09:00 GMT 2018


Author: pmderodat
Date: Tue Dec 11 11:09:19 2018
New Revision: 266980

URL: https://gcc.gnu.org/viewcvs?rev=266980&root=gcc&view=rev
Log:
[Ada] Spurious errors on aspect specifications in generic units

This patch fixes spurious errors on aspect specifications on record
types when the aspect expression references a component of the type that
is not a discriminant. The patch also cleans up the legality checks on
aspect specifications, and improves error message on illegal aspect
specifications whose expressions are not conformant between
specification and freeze point, because of changes in visibility.

2018-12-11  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

	* sem_ch13.adb (Push_Type, Pop_Type): New procedures, used for
	analysis of aspect expressions for record types, whose
	components (not only discriminants) may be referenced in aspect
	expressions.
	(Analyze_Aspect_Specifications, Analyze_Aspects_At_Freeze_Point,
	Analyze_Aspect_At_End-Of_Declarations,
	Resolve_Aspect_Expressions): Use the new subprograms.
	(Check_Aspect_At_End_Of_Declarations): Improve error message.
	(Build_Predicate_Functions): Do not build their bodies in a
	generic unit.
	(Is_Derived_Type_With_Constraint): New subprogram to uncover and
	reject aspect specificationss on types that appear after the
	type is frozen.
	* sem_ch13.ads (Push_Scope_And_Install_Discriminants,
	Uninstall_Discriminants_And_Pop_Scope): Remove.
	* sem_ch6.adb, sem_ch6.ads (Fully_Conformant_Expressions):
	Additional parameter to improve error message on illegal aspect
	specifications whose resolution differ between aspect
	specification and freeze point.
	* freeze.adb: Remove references to
	Install/Uninstall_Discriminants.

gcc/testsuite/

	* gnat.dg/aspect1.adb, gnat.dg/aspect1_horizontal.adb,
	gnat.dg/aspect1_horizontal.ads, gnat.dg/aspect1_vectors_2d.ads:
	New testcase.
	* gnat.dg/static_pred1.adb: Expect an error message.

Added:
    trunk/gcc/testsuite/gnat.dg/aspect1.adb
    trunk/gcc/testsuite/gnat.dg/aspect1_horizontal.adb
    trunk/gcc/testsuite/gnat.dg/aspect1_horizontal.ads
    trunk/gcc/testsuite/gnat.dg/aspect1_vectors_2d.ads
Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/freeze.adb
    trunk/gcc/ada/sem_ch13.adb
    trunk/gcc/ada/sem_ch13.ads
    trunk/gcc/ada/sem_ch6.adb
    trunk/gcc/ada/sem_ch6.ads
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gnat.dg/static_pred1.adb



More information about the Gcc-cvs mailing list