This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Improper handling of self-reference in limited aggregates.


Tested on i686-linux, committed on trunk

Aggregate components for self-referential types include attribute references
to the current instance, of the form: Typ'access, etc.. These references are
rewritten as references to the target of the aggregate: the left-hand side of
an assignment, the entity in a declaration, or a temporary. This patch fixes
a bug in this transformation, which improperly extended this rewriting to
attribute references whose prefix was not the type of the aggregate.

gnat.dg/self1.adb will now compile quietly.

2008-03-26  Ed Schonberg  <schonberg@adacore.com>

	* exp_aggr.adb (Replace_Type): When checking for self-reference, verify
	that the prefix of an attribute is the type of the aggregate being
	expanded.

Attachment: difs
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]